[U-Boot-Users] [PATCH 5/7] Flat device tree support for 85xx ADS and CDS boards

Andy Fleming afleming at freescale.com
Wed Mar 22 23:39:17 CET 2006


* Added PCI and I2C support to 8540 ADS flat device tree
* Fixed PCI memory definitions
  Patch by Andy Fleming 17-Mar-2006

Signed-off-by: Andy Fleming <afleming at freescale.com>

---

 board/mpc8540ads/mpc8540ads.c |   21 ++-------
 board/mpc8540ads/oftree.dts   |   98 +++++++++++++++++++++++++++++++++++++++++
 include/configs/MPC8540ADS.h  |    9 ++--

78e133998e9e91efcd43bf476681aad123c25aaa
diff --git a/board/mpc8540ads/mpc8540ads.c b/board/mpc8540ads/mpc8540ads.c
index 1252d2a..e7db14b 100644
--- a/board/mpc8540ads/mpc8540ads.c
+++ b/board/mpc8540ads/mpc8540ads.c
@@ -317,24 +317,8 @@ long int fixed_sdram (void)
  * Initialize PCI Devices, report devices found.
  */
 
-#ifndef CONFIG_PCI_PNP
-static struct pci_config_table pci_mpc85xxads_config_table[] = {
-    { PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID,
-      PCI_IDSEL_NUMBER, PCI_ANY_ID,
-      pci_cfgfunc_config_device, { PCI_ENET0_IOADDR,
-				   PCI_ENET0_MEMADDR,
-				   PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER
-      } },
-    { }
-};
-#endif
-
 
-static struct pci_controller hose = {
-#ifndef CONFIG_PCI_PNP
-	config_table: pci_mpc85xxads_config_table,
-#endif
-};
+static struct pci_controller hose;
 
 #endif	/* CONFIG_PCI */
 
@@ -354,6 +338,9 @@ pci_init_board(void)
 void
 ft_board_setup(void *blob, bd_t *bd)
 {
+#ifdef CONFIG_PCI
+	ft_pci_setup(blob, bd);
+#endif
 	ft_cpu_setup(blob, bd);
 }
 #endif
diff --git a/board/mpc8540ads/oftree.dts b/board/mpc8540ads/oftree.dts
index 290e80e..a505f48 100644
--- a/board/mpc8540ads/oftree.dts
+++ b/board/mpc8540ads/oftree.dts
@@ -54,6 +54,15 @@
 		reg = <e0000000 00100000>;	// CCSRBAR 1M
 		bus-frequency = <0>;
 
+		i2c at 3000 {
+			device_type = "i2c";
+			compatible = "fsl-i2c";
+			reg = <3000 100>;
+			interrupts = <1b 0>;
+			interrupt-parent = <40000>;
+			dfsrr;
+		};
+
 		mdio at 24520 {
 			#address-cells = <1>;
 			#size-cells = <0>;
@@ -120,6 +129,95 @@
 			interrupts = <1a 3>;
 			interrupt-parent = <40000>;
 		};
+		pci at 8000 {
+			linux,phandle = <8000>;
+			interrupt-map-mask = <f800 0 0 7>;
+			interrupt-map = <
+
+				/* IDSEL 0x02 */
+				1000 0 0 1 40000 31 0
+				1000 0 0 2 40000 32 0
+				1000 0 0 3 40000 33 0
+				1000 0 0 4 40000 34 0
+
+				/* IDSEL 0x03 */
+				1800 0 0 1 40000 34 0
+				1800 0 0 2 40000 31 0
+				1800 0 0 3 40000 32 0
+				1800 0 0 4 40000 33 0
+
+				/* IDSEL 0x04 */
+				2000 0 0 1 40000 33 0
+				2000 0 0 2 40000 34 0
+				2000 0 0 3 40000 31 0
+				2000 0 0 4 40000 32 0
+
+				/* IDSEL 0x05 */
+				2800 0 0 1 40000 32 0
+				2800 0 0 2 40000 33 0
+				2800 0 0 3 40000 34 0
+				2800 0 0 4 40000 31 0
+
+				/* IDSEL 0x0c */
+				6000 0 0 1 40000 31 0
+				6000 0 0 2 40000 32 0
+				6000 0 0 3 40000 33 0
+				6000 0 0 4 40000 34 0
+
+				/* IDSEL 0x0d */
+				6800 0 0 1 40000 34 0
+				6800 0 0 2 40000 31 0
+				6800 0 0 3 40000 32 0
+				6800 0 0 4 40000 33 0
+
+				/* IDSEL 0x0e */
+				8000 0 0 1 40000 33 0
+				8000 0 0 2 40000 34 0
+				8000 0 0 3 40000 31 0
+				8000 0 0 4 40000 32 0
+
+				/* IDSEL 0x0f */
+				8800 0 0 1 40000 32 0
+				8800 0 0 2 40000 33 0
+				8800 0 0 3 40000 34 0
+				8800 0 0 4 40000 31 0
+
+				/* IDSEL 0x12 */
+				9000 0 0 1 40000 31 0
+				9000 0 0 2 40000 32 0
+				9000 0 0 3 40000 33 0
+				9000 0 0 4 40000 34 0
+
+				/* IDSEL 0x13 */
+				9800 0 0 1 40000 34 0
+				9800 0 0 2 40000 31 0
+				9800 0 0 3 40000 32 0
+				9800 0 0 4 40000 33 0
+
+				/* IDSEL 0x14 */
+				a000 0 0 1 40000 33 0
+				a000 0 0 2 40000 34 0
+				a000 0 0 3 40000 31 0
+				a000 0 0 4 40000 32 0
+
+				/* IDSEL 0x15 */
+				a800 0 0 1 40000 32 0
+				a800 0 0 2 40000 33 0
+				a800 0 0 3 40000 34 0
+				a800 0 0 4 40000 31 0>;
+			interrupt-parent = <40000>;
+			interrupts = <8 0>;
+			bus-range = <0 0>;
+			ranges = <02000000 0 80000000 80000000 0 20000000
+				  01000000 0 00000000 e2000000 0 00100000>;
+			clock-frequency = <3f940aa>;
+			#interrupt-cells = <1>;
+			#size-cells = <2>;
+			#address-cells = <3>;
+			reg = <8000 1000>;
+			compatible = "85xx";
+			device_type = "pci";
+		};
 
 		pic at 40000 {
 			linux,phandle = <40000>;
diff --git a/include/configs/MPC8540ADS.h b/include/configs/MPC8540ADS.h
index d31a18b..81ee945 100644
--- a/include/configs/MPC8540ADS.h
+++ b/include/configs/MPC8540ADS.h
@@ -71,7 +71,7 @@
  */
 
 #ifndef CONFIG_SYS_CLK_FREQ
-#define CONFIG_SYS_CLK_FREQ	33000000
+#define CONFIG_SYS_CLK_FREQ	66000000
 #endif
 
 
@@ -327,9 +327,10 @@
 #define CFG_PCI1_MEM_BASE	0x80000000
 #define CFG_PCI1_MEM_PHYS	CFG_PCI1_MEM_BASE
 #define CFG_PCI1_MEM_SIZE	0x20000000	/* 512M */
-#define CFG_PCI1_IO_BASE	0xe2000000
-#define CFG_PCI1_IO_PHYS	CFG_PCI1_IO_BASE
-#define CFG_PCI1_IO_SIZE	0x1000000	/* 16M */
+
+#define CFG_PCI1_IO_BASE	0x0
+#define CFG_PCI1_IO_PHYS	0xe2000000
+#define CFG_PCI1_IO_SIZE	0x100000	/* 1M */
 
 #if defined(CONFIG_PCI)
 
-- 
1.2.4





More information about the U-Boot mailing list