 10d0c9705e
			
		
	
	
	10d0c9705e
	
	
	
		
			
			usual for this cycle with lots of clean-up.
 
 - Cross arch clean-up and consolidation of early DT scanning code.
 - Clean-up and removal of arch prom.h headers. Makes arch specific
   prom.h optional on all but Sparc.
 - Addition of interrupts-extended property for devices connected to
   multiple interrupt controllers.
 - Refactoring of DT interrupt parsing code in preparation for deferred
   probe of interrupts.
 - ARM cpu and cpu topology bindings documentation.
 - Various DT vendor binding documentation updates.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.12 (GNU/Linux)
 
 iQEcBAABAgAGBQJSgPQ4AAoJEMhvYp4jgsXif28H/1WkrXq5+lCFQZF8nbYdE2h0
 R8PsfiJJmAl6/wFgQTsRel+ScMk2hiP08uTyqf2RLnB1v87gCF7MKVaLOdONfUDi
 huXbcQGWCmZv0tbBIklxJe3+X3FIJch4gnyUvPudD1m8a0R0LxWXH/NhdTSFyB20
 PNjhN/IzoN40X1PSAhfB5ndWnoxXBoehV/IVHVDU42vkPVbVTyGAw5qJzHW8CLyN
 2oGTOalOO4ffQ7dIkBEQfj0mrgGcODToPdDvUQyyGZjYK2FY2sGrjyquir6SDcNa
 Q4gwatHTu0ygXpyphjtQf5tc3ZCejJ/F0s3olOAS1ahKGfe01fehtwPRROQnCK8=
 =GCbY
 -----END PGP SIGNATURE-----
Merge tag 'devicetree-for-3.13' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux
Pull devicetree updates from Rob Herring:
 "DeviceTree updates for 3.13.  This is a bit larger pull request than
  usual for this cycle with lots of clean-up.
   - Cross arch clean-up and consolidation of early DT scanning code.
   - Clean-up and removal of arch prom.h headers.  Makes arch specific
     prom.h optional on all but Sparc.
   - Addition of interrupts-extended property for devices connected to
     multiple interrupt controllers.
   - Refactoring of DT interrupt parsing code in preparation for
     deferred probe of interrupts.
   - ARM cpu and cpu topology bindings documentation.
   - Various DT vendor binding documentation updates"
* tag 'devicetree-for-3.13' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux: (82 commits)
  powerpc: add missing explicit OF includes for ppc
  dt/irq: add empty of_irq_count for !OF_IRQ
  dt: disable self-tests for !OF_IRQ
  of: irq: Fix interrupt-map entry matching
  MIPS: Netlogic: replace early_init_devtree() call
  of: Add Panasonic Corporation vendor prefix
  of: Add Chunghwa Picture Tubes Ltd. vendor prefix
  of: Add AU Optronics Corporation vendor prefix
  of/irq: Fix potential buffer overflow
  of/irq: Fix bug in interrupt parsing refactor.
  of: set dma_mask to point to coherent_dma_mask
  of: add vendor prefix for PHYTEC Messtechnik GmbH
  DT: sort vendor-prefixes.txt
  of: Add vendor prefix for Cadence
  of: Add empty for_each_available_child_of_node() macro definition
  arm/versatile: Fix versatile irq specifications.
  of/irq: create interrupts-extended property
  microblaze/pci: Drop PowerPC-ism from irq parsing
  of/irq: Create of_irq_parse_and_map_pci() to consolidate arch code.
  of/irq: Use irq_of_parse_and_map()
  ...
		
	
			
		
			
				
	
	
		
			155 lines
		
	
	
	
		
			3.7 KiB
			
		
	
	
	
		
			C
		
	
	
	
	
	
			
		
		
	
	
			155 lines
		
	
	
	
		
			3.7 KiB
			
		
	
	
	
		
			C
		
	
	
	
	
	
| /*
 | |
|  * Platform setup for the MPC8xx based boards from TQM.
 | |
|  *
 | |
|  * Heiko Schocher <hs@denx.de>
 | |
|  * Copyright 2010 DENX Software Engineering GmbH
 | |
|  *
 | |
|  * based on:
 | |
|  * Vitaly Bordug <vbordug@ru.mvista.com>
 | |
|  *
 | |
|  * Copyright 2005 MontaVista Software Inc.
 | |
|  *
 | |
|  * Heavily modified by Scott Wood <scottwood@freescale.com>
 | |
|  * Copyright 2007 Freescale Semiconductor, Inc.
 | |
|  *
 | |
|  * This file is licensed under the terms of the GNU General Public License
 | |
|  * version 2. This program is licensed "as is" without any warranty of any
 | |
|  * kind, whether express or implied.
 | |
|  */
 | |
| 
 | |
| #include <linux/init.h>
 | |
| #include <linux/param.h>
 | |
| #include <linux/string.h>
 | |
| #include <linux/ioport.h>
 | |
| #include <linux/device.h>
 | |
| #include <linux/delay.h>
 | |
| 
 | |
| #include <linux/fs_enet_pd.h>
 | |
| #include <linux/fs_uart_pd.h>
 | |
| #include <linux/fsl_devices.h>
 | |
| #include <linux/mii.h>
 | |
| #include <linux/of_fdt.h>
 | |
| #include <linux/of_platform.h>
 | |
| 
 | |
| #include <asm/delay.h>
 | |
| #include <asm/io.h>
 | |
| #include <asm/machdep.h>
 | |
| #include <asm/page.h>
 | |
| #include <asm/processor.h>
 | |
| #include <asm/time.h>
 | |
| #include <asm/mpc8xx.h>
 | |
| #include <asm/8xx_immap.h>
 | |
| #include <asm/cpm1.h>
 | |
| #include <asm/fs_pd.h>
 | |
| #include <asm/udbg.h>
 | |
| 
 | |
| #include "mpc8xx.h"
 | |
| 
 | |
| struct cpm_pin {
 | |
| 	int port, pin, flags;
 | |
| };
 | |
| 
 | |
| static struct cpm_pin tqm8xx_pins[] __initdata = {
 | |
| 	/* SMC1 */
 | |
| 	{CPM_PORTB, 24, CPM_PIN_INPUT}, /* RX */
 | |
| 	{CPM_PORTB, 25, CPM_PIN_INPUT | CPM_PIN_SECONDARY}, /* TX */
 | |
| 
 | |
| 	/* SCC1 */
 | |
| 	{CPM_PORTA, 5, CPM_PIN_INPUT}, /* CLK1 */
 | |
| 	{CPM_PORTA, 7, CPM_PIN_INPUT}, /* CLK2 */
 | |
| 	{CPM_PORTA, 14, CPM_PIN_INPUT}, /* TX */
 | |
| 	{CPM_PORTA, 15, CPM_PIN_INPUT}, /* RX */
 | |
| 	{CPM_PORTC, 15, CPM_PIN_INPUT | CPM_PIN_SECONDARY}, /* TENA */
 | |
| 	{CPM_PORTC, 10, CPM_PIN_INPUT | CPM_PIN_SECONDARY | CPM_PIN_GPIO},
 | |
| 	{CPM_PORTC, 11, CPM_PIN_INPUT | CPM_PIN_SECONDARY | CPM_PIN_GPIO},
 | |
| };
 | |
| 
 | |
| static struct cpm_pin tqm8xx_fec_pins[] __initdata = {
 | |
| 	/* MII */
 | |
| 	{CPM_PORTD, 3, CPM_PIN_OUTPUT},
 | |
| 	{CPM_PORTD, 4, CPM_PIN_OUTPUT},
 | |
| 	{CPM_PORTD, 5, CPM_PIN_OUTPUT},
 | |
| 	{CPM_PORTD, 6, CPM_PIN_OUTPUT},
 | |
| 	{CPM_PORTD, 7, CPM_PIN_OUTPUT},
 | |
| 	{CPM_PORTD, 8, CPM_PIN_OUTPUT},
 | |
| 	{CPM_PORTD, 9, CPM_PIN_OUTPUT},
 | |
| 	{CPM_PORTD, 10, CPM_PIN_OUTPUT},
 | |
| 	{CPM_PORTD, 11, CPM_PIN_OUTPUT},
 | |
| 	{CPM_PORTD, 12, CPM_PIN_OUTPUT},
 | |
| 	{CPM_PORTD, 13, CPM_PIN_OUTPUT},
 | |
| 	{CPM_PORTD, 14, CPM_PIN_OUTPUT},
 | |
| 	{CPM_PORTD, 15, CPM_PIN_OUTPUT},
 | |
| };
 | |
| 
 | |
| static void __init init_pins(int n, struct cpm_pin *pin)
 | |
| {
 | |
| 	int i;
 | |
| 
 | |
| 	for (i = 0; i < n; i++) {
 | |
| 		cpm1_set_pin(pin->port, pin->pin, pin->flags);
 | |
| 		pin++;
 | |
| 	}
 | |
| }
 | |
| 
 | |
| static void __init init_ioports(void)
 | |
| {
 | |
| 	struct device_node *dnode;
 | |
| 	struct property *prop;
 | |
| 	int	len;
 | |
| 
 | |
| 	init_pins(ARRAY_SIZE(tqm8xx_pins), &tqm8xx_pins[0]);
 | |
| 
 | |
| 	cpm1_clk_setup(CPM_CLK_SMC1, CPM_BRG1, CPM_CLK_RTX);
 | |
| 
 | |
| 	dnode = of_find_node_by_name(NULL, "aliases");
 | |
| 	if (dnode == NULL)
 | |
| 		return;
 | |
| 	prop = of_find_property(dnode, "ethernet1", &len);
 | |
| 	if (prop == NULL)
 | |
| 		return;
 | |
| 
 | |
| 	/* init FEC pins */
 | |
| 	init_pins(ARRAY_SIZE(tqm8xx_fec_pins), &tqm8xx_fec_pins[0]);
 | |
| }
 | |
| 
 | |
| static void __init tqm8xx_setup_arch(void)
 | |
| {
 | |
| 	cpm_reset();
 | |
| 	init_ioports();
 | |
| }
 | |
| 
 | |
| static int __init tqm8xx_probe(void)
 | |
| {
 | |
| 	unsigned long node = of_get_flat_dt_root();
 | |
| 
 | |
| 	return of_flat_dt_is_compatible(node, "tqc,tqm8xx");
 | |
| }
 | |
| 
 | |
| static struct of_device_id __initdata of_bus_ids[] = {
 | |
| 	{ .name = "soc", },
 | |
| 	{ .name = "cpm", },
 | |
| 	{ .name = "localbus", },
 | |
| 	{ .compatible = "simple-bus" },
 | |
| 	{},
 | |
| };
 | |
| 
 | |
| static int __init declare_of_platform_devices(void)
 | |
| {
 | |
| 	of_platform_bus_probe(NULL, of_bus_ids, NULL);
 | |
| 
 | |
| 	return 0;
 | |
| }
 | |
| machine_device_initcall(tqm8xx, declare_of_platform_devices);
 | |
| 
 | |
| define_machine(tqm8xx) {
 | |
| 	.name			= "TQM8xx",
 | |
| 	.probe			= tqm8xx_probe,
 | |
| 	.setup_arch		= tqm8xx_setup_arch,
 | |
| 	.init_IRQ		= mpc8xx_pics_init,
 | |
| 	.get_irq		= mpc8xx_get_irq,
 | |
| 	.restart		= mpc8xx_restart,
 | |
| 	.calibrate_decr		= mpc8xx_calibrate_decr,
 | |
| 	.set_rtc_time		= mpc8xx_set_rtc_time,
 | |
| 	.get_rtc_time		= mpc8xx_get_rtc_time,
 | |
| 	.progress		= udbg_progress,
 | |
| };
 |