Skip to contentSkip to conversation

8xx: Add support for FSL 8xx, 885ads and 86xads eval boards

PATCH In review Vitaly Bordug 2 participants 9 messages Dec 11, 2006

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

cover 8xx: Add support for FSL 8xx, 885ads and 86xads eval boards

The following series intended to port the 8xx boards support to arch/powerpc together with mpc885ads and mpc86xads reference boards. It features regression-less transaction (all the peripherials work, namely SMC1,2 UARTs, FEC1,2 or SCC3 Ethernet for 885ads for instance).

It is pretty extended comparing to the original stuff because all the comments were addressed+ added support of 86xads family.

--
Sincerely, Vitaly

#1 lore raw

PATCH 1/6 8xx: platform-specific mmu updates

This is just a straight port of the same done in arch/ppc by Marcelo Tosatti. One used to be
[PATCH] ppc32 8xx: update_mmu_cache() needs unconditional tlbie, commit eb07d964b4491d1bb5864cd3d7e7633ccdda9a53

In a nutshell, the board is nearly stuck without this, yet without any visible failure - being just very slow.

---

 arch/powerpc/mm/mem.c |   20 ++++++++++----------
 1 files changed, 10 insertions(+), 10 deletions(-)
arch/powerpc/mm/mem.c +10 -10
index d1c0758..c85eda6 100644
@@ -490,19 +490,19 @@ #endif
 	    !cpu_has_feature(CPU_FTR_NOEXECUTE) &&
 	    pfn_valid(pfn)) {
 		struct page *page = pfn_to_page(pfn);
+#ifdef CONFIG_8xx
+		/* On 8xx, cache control instructions (particularly
+		 * "dcbst" from flush_dcache_icache) fault as write
+		 * operation if there is an unpopulated TLB entry
+		 * for the address in question. To workaround that,
+		 * we invalidate the TLB here, thus avoiding dcbst
+		 * misbehaviour.
+		 */
+		_tlbie(address);
+#endif
 		if (!PageReserved(page)
 		    && !test_bit(PG_arch_1, &page->flags)) {
 			if (vma->vm_mm == current->active_mm) {
-#ifdef CONFIG_8xx
-			/* On 8xx, cache control instructions (particularly 
-		 	 * "dcbst" from flush_dcache_icache) fault as write 
-			 * operation if there is an unpopulated TLB entry 
-			 * for the address in question. To workaround that, 
-			 * we invalidate the TLB here, thus avoiding dcbst 
-			 * misbehaviour.
-			 */
-				_tlbie(address);
-#endif
 				__flush_dcache_icache((void *) address);
 			} else
 				flush_dcache_icache_page(page);
#2 lore raw

PATCH 2/6 8xx: generic 8xx code arch/powerpc port

In reply to Vitaly Bordug

Including support for non-coherent cache, some mm-related things + relevant field in Kconfig and Makefiles. Also included rheap.o compilation if 8xx is defined.

Non-coherent mapping were refined and renamed according to Cristoph Hellwig. Orhaned functions were cleaned up.

---

 arch/powerpc/Kconfig               |   11 +
 arch/powerpc/lib/Makefile          |    2 
 arch/powerpc/lib/dma-noncoherent.c |  418 ++++++++++++++++++++++++++++++++++++
 3 files changed, 429 insertions(+), 2 deletions(-)
arch/powerpc/Kconfig +9 -2
index f81d9f6..f4f5191 100644
@@ -165,6 +165,11 @@ config PPC_86xx
 	help
 	  The Freescale E600 SoCs have 74xx cores.
 
+config PPC_8xx
+	bool "Freescale 8xx"
+	select FSL_SOC
+	select 8xx
+
 config 40x
 	bool "AMCC 40x"
 	select PPC_DCR_NATIVE
@@ -173,8 +178,6 @@ config 44x
 	bool "AMCC 44x"
 	select PPC_DCR_NATIVE
 
-config 8xx
-	bool "Freescale 8xx"
 
 config E200
 	bool "Freescale e200"
@@ -203,6 +206,10 @@ config 6xx
 	bool
 
 # this is temp to handle compat with arch=ppc
+config 8xx
+	bool
+
+# this is temp to handle compat with arch=ppc
 config 83xx
 	bool
 
arch/powerpc/lib/Makefile +2 -0
index a0360ae..e2d4141 100644
@@ -16,6 +16,7 @@ obj-$(CONFIG_PPC64)	+= checksum_64.o cop
 			   strcase.o
 obj-$(CONFIG_QUICC_ENGINE) += rheap.o
 obj-$(CONFIG_XMON)	+= sstep.o
+obj-$(CONFIG_NOT_COHERENT_CACHE)	+= dma-noncoherent.o
 
 ifeq ($(CONFIG_PPC64),y)
 obj-$(CONFIG_SMP)	+= locks.o
@@ -24,5 +25,6 @@ endif
 
 # Temporary hack until we have migrated to asm-powerpc
 ifeq ($(CONFIG_PPC_MERGE),y)
+obj-$(CONFIG_8xx)	+= rheap.o
 obj-$(CONFIG_CPM2)	+= rheap.o
 endif
arch/powerpc/lib/dma-noncoherent.c new file +418 -0

418 lines not on this page · raw message

#3 lore raw

PATCH 3/6 8xx: platform-related changes to the fsl_soc.c

In reply to Vitaly Bordug

Added 8xx SoC peripherials: fec for Ethernet and smc for UARTs. Ordinary routines to extract values from the device tree and insert respective platform devices

---

 arch/powerpc/sysdev/fsl_soc.c |  268 +++++++++++++++++++++++++++++++++++++++++
 1 files changed, 267 insertions(+), 1 deletions(-)
arch/powerpc/sysdev/fsl_soc.c +267 -1
index ad31e56..db09c20 100644
@@ -39,6 +39,8 @@ #include <asm/cpm2.h>
 
 extern void init_fcc_ioports(struct fs_platform_info*);
 extern void init_scc_ioports(struct fs_uart_platform_info*);
+extern void init_fec_ioports(struct fs_platform_info*);
+extern void init_smc_ioports(struct fs_uart_platform_info*);
 static phys_addr_t immrbase = -1;
 
 phys_addr_t get_immrbase(void)
@@ -63,7 +65,7 @@ phys_addr_t get_immrbase(void)
 
 EXPORT_SYMBOL(get_immrbase);
 
-#ifdef CONFIG_CPM2
+#if defined(CONFIG_CPM2) || defined(CONFIG_8xx)
 
 static u32 brgfreq = -1;
 
@@ -792,3 +794,267 @@ err:
 
 arch_initcall(cpm_uart_of_init);
 #endif /* CONFIG_CPM2 */
+
+#ifdef CONFIG_8xx
+
+static int __init fs_enet_mdio_of_init(void)
+{
+	struct device_node *np;
+	unsigned int i;
+	struct platform_device *mdio_dev;
+	struct resource res;
+	int ret;
+
+	for (np = NULL, i = 0;
+	     (np = of_find_compatible_node(np, "mdio", "fs_enet")) != NULL;
+	     i++) {
+		struct fs_mii_fec_platform_info mdio_data;
+
+		memset(&res, 0, sizeof(res));
+		memset(&mdio_data, 0, sizeof(mdio_data));
+
+		ret = of_address_to_resource(np, 0, &res);
+		if (ret)
+			goto err;
+
+		mdio_dev =
+		    platform_device_register_simple("fsl-cpm-fec-mdio",
+						    res.start, &res, 1);
+		if (IS_ERR(mdio_dev)) {
+			ret = PTR_ERR(mdio_dev);
+			goto err;
+		}
+
+		mdio_data.mii_speed = ((((ppc_proc_freq + 4999999) / 2500000) / 2) & 0x3F) << 1;
+
+		ret =
+		    platform_device_add_data(mdio_dev, &mdio_data,
+					     sizeof(struct fs_mii_fec_platform_info));
+		if (ret)
+			goto unreg;
+	}
+	return 0;
+
+unreg:
+	platform_device_unregister(mdio_dev);
+err:
+	return ret;
+}
+
+arch_initcall(fs_enet_mdio_of_init);
+
+static const char *enet_regs = "regs";
+static const char *enet_pram = "pram";
+static const char *enet_irq = "interrupt";
+static char bus_id[9][BUS_ID_SIZE];
+
+static int __init fs_enet_of_init(void)
+{
+	struct device_node *np;
+	unsigned int i;
+	struct platform_device *fs_enet_dev = NULL;
+	struct resource res;
+	int ret;
+
+	for (np = NULL, i = 0;
+	     (np = of_find_compatible_node(np, "network", "fs_enet")) != NULL;
+	     i++) {
+		struct resource r[4];
+		struct device_node *phy = NULL, *mdio = NULL;
+		struct fs_platform_info fs_enet_data;
+		unsigned int *id, *phy_addr;
+		void *mac_addr;
+		phandle *ph;
+		char *model;
+
+		memset(r, 0, sizeof(r));
+		memset(&fs_enet_data, 0, sizeof(fs_enet_data));
+
+		model = (char *)get_property(np, "model", NULL);
+		if (model == NULL) {
+			ret = -ENODEV;
+			goto unreg;
+		}
+
+		id = (u32 *) get_property(np, "device-id", NULL);
+		fs_enet_data.fs_no = *id;
+
+		if (platform_device_skip(model, *id))
+			continue;
+
+		ret = of_address_to_resource(np, 0, &r[0]);
+		if (ret)
+			goto err;
+		r[0].name = enet_regs;
+
+		mac_addr = (void *)get_property(np, "mac-address", NULL);
+		memcpy(fs_enet_data.macaddr, mac_addr, 6);
+
+		ph = (phandle *) get_property(np, "phy-handle", NULL);
+		if (ph != NULL)
+			phy = of_find_node_by_phandle(*ph);
+
+		if (phy != NULL) {
+			phy_addr = (u32 *) get_property(phy, "reg", NULL);
+			fs_enet_data.phy_addr = *phy_addr;
+			fs_enet_data.has_phy = 1;
+
+			mdio = of_get_parent(phy);
+			ret = of_address_to_resource(mdio, 0, &res);
+			if (ret) {
+				of_node_put(phy);
+				of_node_put(mdio);
+                                goto unreg;
+			}
+		}
+
+		model = (char*)get_property(np, "model", NULL);
+		strcpy(fs_enet_data.fs_type, model);
+
+		if (strstr(model, "FEC")) {
+			r[1].start = r[1].end = irq_of_parse_and_map(np, 0);
+			r[1].flags = IORESOURCE_IRQ;
+			r[1].name = enet_irq;
+
+			fs_enet_dev =
+				    platform_device_register_simple("fsl-cpm-fec", i, &r[0], 2);
+
+			if (IS_ERR(fs_enet_dev)) {
+				ret = PTR_ERR(fs_enet_dev);
+				goto err;
+			}
+
+			fs_enet_data.rx_ring = 128;
+			fs_enet_data.tx_ring = 16;
+			fs_enet_data.rx_copybreak = 240;
+			fs_enet_data.use_napi = 1;
+			fs_enet_data.napi_weight = 17;
+
+			snprintf((char*)&bus_id[i], BUS_ID_SIZE, "%x:%02x",
+							(u32)res.start, fs_enet_data.phy_addr);
+			fs_enet_data.bus_id = (char*)&bus_id[i];
+			fs_enet_data.init_ioports = init_fec_ioports;
+		}
+		if (strstr(model, "SCC")) {
+			ret = of_address_to_resource(np, 1, &r[1]);
+			if (ret)
+				goto err;
+			r[1].name = enet_pram;
+
+			r[2].start = r[2].end = irq_of_parse_and_map(np, 0);
+			r[2].flags = IORESOURCE_IRQ;
+			r[2].name = enet_irq;
+
+			fs_enet_dev =
+				    platform_device_register_simple("fsl-cpm-scc", i, &r[0], 3);
+
+			if (IS_ERR(fs_enet_dev)) {
+				ret = PTR_ERR(fs_enet_dev);
+				goto err;
+			}
+
+			fs_enet_data.rx_ring = 64;
+			fs_enet_data.tx_ring = 8;
+			fs_enet_data.rx_copybreak = 240;
+			fs_enet_data.use_napi = 1;
+			fs_enet_data.napi_weight = 17;
+
+			snprintf((char*)&bus_id[i], BUS_ID_SIZE, "%s", "fixed@10:1");
+                        fs_enet_data.bus_id = (char*)&bus_id[i];
+			fs_enet_data.init_ioports = init_scc_ioports;
+		}
+
+		of_node_put(phy);
+		of_node_put(mdio);
+
+		ret = platform_device_add_data(fs_enet_dev, &fs_enet_data,
+					     sizeof(struct
+						    fs_platform_info));
+		if (ret)
+			goto unreg;
+	}
+	return 0;
+
+unreg:
+	platform_device_unregister(fs_enet_dev);
+err:
+	return ret;
+}
+
+arch_initcall(fs_enet_of_init);
+
+
+static const char *smc_regs = "regs";
+static const char *smc_pram = "pram";
+
+static int __init cpm_smc_uart_of_init(void)
+{
+	struct device_node *np;
+	unsigned int i;
+	struct platform_device *cpm_uart_dev;
+	int ret;
+
+	for (np = NULL, i = 0;
+	     (np = of_find_compatible_node(np, "serial", "cpm_uart")) != NULL;
+	     i++) {
+		struct resource r[3];
+		struct fs_uart_platform_info cpm_uart_data;
+		int *id;
+		char *model;
+
+		memset(r, 0, sizeof(r));
+		memset(&cpm_uart_data, 0, sizeof(cpm_uart_data));
+
+		ret = of_address_to_resource(np, 0, &r[0]);
+		if (ret)
+			goto err;
+
+		r[0].name = smc_regs;
+
+		ret = of_address_to_resource(np, 1, &r[1]);
+		if (ret)
+			goto err;
+		r[1].name = smc_pram;
+
+		r[2].start = r[2].end = irq_of_parse_and_map(np, 0);
+		r[2].flags = IORESOURCE_IRQ;
+
+		cpm_uart_dev =
+		    platform_device_register_simple("fsl-cpm-smc:uart", i, &r[0], 3);
+
+		if (IS_ERR(cpm_uart_dev)) {
+			ret = PTR_ERR(cpm_uart_dev);
+			goto err;
+		}
+
+		model = (char*)get_property(np, "model", NULL);
+		strcpy(cpm_uart_data.fs_type, model);
+
+		id = (int*)get_property(np, "device-id", NULL);
+		cpm_uart_data.fs_no = *id;
+		cpm_uart_data.uart_clk = ppc_proc_freq;
+
+		cpm_uart_data.tx_num_fifo = 4;
+		cpm_uart_data.tx_buf_size = 32;
+		cpm_uart_data.rx_num_fifo = 4;
+		cpm_uart_data.rx_buf_size = 32;
+
+		ret =
+		    platform_device_add_data(cpm_uart_dev, &cpm_uart_data,
+					     sizeof(struct
+						    fs_uart_platform_info));
+		if (ret)
+			goto unreg;
+	}
+
+	return 0;
+
+unreg:
+	platform_device_unregister(cpm_uart_dev);
+err:
+	return ret;
+}
+
+arch_initcall(cpm_smc_uart_of_init);
+
+#endif /* CONFIG_8xx */
#4 lore raw

PATCH 4/6 8xx: powerpc port of core CPM, CPM PIC, etc.

In reply to Vitaly Bordug

This covers common CPM access functions, CPM interrupt controller code, micropatch and a few compatibility things to kee the same driver base working with arch/ppc. This version is refined with all the comments (mostly PIC-related) addressed.

---

 arch/powerpc/sysdev/Makefile     |    2 
 arch/powerpc/sysdev/commproc.c   |  398 ++++++++++++++++++++
 arch/powerpc/sysdev/micropatch.c |  743 ++++++++++++++++++++++++++++++++++++++
 arch/powerpc/sysdev/mpc8xx_pic.c |  197 ++++++++++
 arch/powerpc/sysdev/mpc8xx_pic.h |   12 +
 include/asm-powerpc/fs_pd.h      |   44 ++
 include/asm-powerpc/mpc8xx.h     |   24 +
 include/asm-powerpc/time.h       |    2 
 8 files changed, 1412 insertions(+), 10 deletions(-)
arch/powerpc/sysdev/Makefile +2 -0
index 04d4917..821f298 100644
@@ -22,4 +22,6 @@ endif
 # Temporary hack until we have migrated to asm-powerpc
 ifeq ($(ARCH),powerpc)
 obj-$(CONFIG_CPM2)		+= cpm2_common.o cpm2_pic.o
+obj-$(CONFIG_8xx)		+= mpc8xx_pic.o commproc.o
+obj-$(CONFIG_UCODE_PATCH)	+= micropatch.o
 endif
arch/powerpc/sysdev/commproc.c new file +398 -0

398 lines not on this page · raw message

arch/powerpc/sysdev/micropatch.c new file +743 -0

743 lines not on this page · raw message

arch/powerpc/sysdev/mpc8xx_pic.c new file +197 -0

197 lines not on this page · raw message

arch/powerpc/sysdev/mpc8xx_pic.h new file +12 -0
new file mode 100644
index 0000000..afa2ee6
@@ -0,0 +1,12 @@
+#ifndef _PPC_KERNEL_MPC8xx_H
+#define _PPC_KERNEL_MPC8xx_H
+
+#include <linux/irq.h>
+#include <linux/interrupt.h>
+
+extern struct hw_interrupt_type mpc8xx_pic;
+
+int mpc8xx_pic_init(void);
+unsigned int mpc8xx_get_irq(void);
+
+#endif /* _PPC_KERNEL_PPC8xx_H */
include/asm-powerpc/fs_pd.h +34 -10

58 lines not on this page · raw message

include/asm-powerpc/mpc8xx.h new file +24 -0
new file mode 100644
index 0000000..e05ba6b
@@ -0,0 +1,24 @@
+/* This is the single file included by all MPC8xx build options.
+ * Since there are many different boards and no standard configuration,
+ * we have a unique include file for each.  Rather than change every
+ * file that has to include MPC8xx configuration, they all include
+ * this one and the configuration switching is done here.
+ */
+#ifdef __KERNEL__
+#ifndef __CONFIG_8xx_DEFS
+#define __CONFIG_8xx_DEFS
+
+
+#ifdef CONFIG_8xx
+
+#ifdef CONFIG_FADS
+#include <platforms/fads.h>
+#endif
+
+#if defined(CONFIG_MPC885ADS)
+#include <platforms/8xx/mpc885ads.h>
+#endif
+
+#endif /* CONFIG_8xx */
+#endif /* __CONFIG_8xx_DEFS */
+#endif /* __KERNEL__ */
include/asm-powerpc/time.h +2 -0
index 4cff977..3fd57c0 100644
@@ -39,6 +39,8 @@ extern void generic_calibrate_decr(void)
 extern void wakeup_decrementer(void);
 extern void snapshot_timebase(void);
 
+extern void set_dec_cpu6(unsigned int val);
+
 /* Some sane defaults: 125 MHz timebase, 1GHz processor */
 extern unsigned long ppc_proc_freq;
 #define DEFAULT_PROC_FREQ	(DEFAULT_TB_FREQ * 8)
#5 lore raw

Re: [PATCH 4/6] [POWERPC] 8xx: powerpc port of core CPM, CPM PIC, etc.

Hi,

Quoted 8 lines · On Mon, 11 Dec 2006 19:28:48 +0300 Vitaly Bordug <[email protected]> wrote:

This covers common CPM access functions, CPM interrupt controller code, micropatch and a few compatibility things to kee the same driver base working with arch/ppc. This version is refined with all the comments (mostly PIC-related) addressed.

---

Quoted 9 lines
 arch/powerpc/sysdev/Makefile     |    2 
 arch/powerpc/sysdev/commproc.c   |  398 ++++++++++++++++++++
 arch/powerpc/sysdev/micropatch.c |  743 ++++++++++++++++++++++++++++++++++++++
 arch/powerpc/sysdev/mpc8xx_pic.c |  197 ++++++++++
 arch/powerpc/sysdev/mpc8xx_pic.h |   12 +
 include/asm-powerpc/fs_pd.h      |   44 ++
 include/asm-powerpc/mpc8xx.h     |   24 +
 include/asm-powerpc/time.h       |    2 
 8 files changed, 1412 insertions(+), 10 deletions(-)

Are these devices common for more platforms than 8xx? The 8xx in the filenames seems to indicate that they're not.

If so, shouldn't the drivers go under platforms/8xx instead?

-Olof

#6 lore raw

Re: [PATCH 4/6] [POWERPC] 8xx: powerpc port of core CPM, CPM PIC, etc.

Quoted 22 lines · On Mon, 11 Dec 2006 12:20:41 -0600 Olof Johansson <[email protected]> wrote:

Hi,

Quoted 8 lines · On Mon, 11 Dec 2006 19:28:48 +0300 Vitaly Bordug <[email protected]> wrote:

This covers common CPM access functions, CPM interrupt controller code, micropatch and a few compatibility things to kee the same driver base working with arch/ppc. This version is refined with all the comments (mostly PIC-related) addressed.

---

Quoted 9 lines
 arch/powerpc/sysdev/Makefile     |    2 
 arch/powerpc/sysdev/commproc.c   |  398 ++++++++++++++++++++
 arch/powerpc/sysdev/micropatch.c |  743 ++++++++++++++++++++++++++++++++++++++
 arch/powerpc/sysdev/mpc8xx_pic.c |  197 ++++++++++
 arch/powerpc/sysdev/mpc8xx_pic.h |   12 +
 include/asm-powerpc/fs_pd.h      |   44 ++
 include/asm-powerpc/mpc8xx.h     |   24 +
 include/asm-powerpc/time.h       |    2 
 8 files changed, 1412 insertions(+), 10 deletions(-)
Quoted 3 lines

Are these devices common for more platforms than 8xx? The 8xx in the filenames seems to indicate that they're not.

More or less, this is a port from arch/ppc, and cpm2 stuff which is pretty much alike residing in sysdev. Maybe pic stuff should be renamed to cpm_pic, but IMO the upper name is less confusing at the current point.

Quoted 2 lines

If so, shouldn't the drivers go under platforms/8xx instead?

Maybe, but not at the moment: for this code I'd like to keep coherency with arch/ppc in case of something missed/ etc.

Signature · 2 lines
Sincerely, 
Vitaly
#7 lore raw

PATCH 5/6 8xx: Add mpc885ads support and common mpc8xx.

In reply to Vitaly Bordug

This adds the core 8xx stuff and specifically mpc885ads board-specific bits to arch/powerpc. Respective Kconfig has been cleaned up from the stuff not yet ported over to avoid confusion. Updated and cleaned version.

---

 arch/powerpc/boot/dts/mpc885ads.dts          |  185 ++++++
 arch/powerpc/configs/mpc885_ads_defconfig    |  827 ++++++++++++++++++++++++++
 arch/powerpc/platforms/8xx/Kconfig           |  276 ---------
 arch/powerpc/platforms/8xx/Makefile          |    5 
 arch/powerpc/platforms/8xx/m8xx_setup.c      |  303 ++++++++++
 arch/powerpc/platforms/8xx/mpc885ads.h       |   95 +++
 arch/powerpc/platforms/8xx/mpc885ads_setup.c |  377 ++++++++++++
 arch/powerpc/platforms/Makefile              |    1 
 8 files changed, 1803 insertions(+), 266 deletions(-)
arch/powerpc/boot/dts/mpc885ads.dts new file +185 -0
new file mode 100644
index 0000000..cf1a19f
@@ -0,0 +1,185 @@
+/*
+ * MPC885 ADS Device Tree Source
+ *
+ * Copyright 2006 MontaVista Software, Inc.
+ *
+ * This program is free software; you can redistribute  it and/or modify it
+ * under  the terms of  the GNU General  Public License as published by the
+ * Free Software Foundation;  either version 2 of the  License, or (at your
+ * option) any later version.
+ */
+
+
+/ {
+	model = "MPC885ADS";
+	compatible = "mpc8xx";
+	#address-cells = <1>;
+	#size-cells = <1>;
+	linux,phandle = <100>;
+
+	cpus {
+		#cpus = <1>;
+		#address-cells = <1>;
+		#size-cells = <0>;
+		linux,phandle = <200>;
+
+		PowerPC,885@0 {
+			device_type = "cpu";
+			reg = <0>;
+			d-cache-line-size = <20>;	// 32 bytes
+			i-cache-line-size = <20>;	// 32 bytes
+			d-cache-size = <2000>;		// L1, 8K
+			i-cache-size = <2000>;		// L1, 8K
+			timebase-frequency = <0>;
+			bus-frequency = <0>;
+			clock-frequency = <0>;
+			32-bit;
+			interrupts = <f 2>;	// decrementer interrupt
+			interrupt-parent = <ff000000>;
+			linux,phandle = <201>;
+			linux,boot-cpu;
+		};
+	};
+
+	memory {
+		device_type = "memory";
+		linux,phandle = <300>;
+		reg = <00000000 800000>;
+	};
+
+	soc885@ff000000 {
+		#address-cells = <1>;
+		#size-cells = <1>;
+		#interrupt-cells = <2>;
+		device_type = "soc";
+		ranges = <0 ff000000 00100000>;
+		reg = <ff000000 00000200>;
+		bus-frequency = <0>;
+		mdio@e80 {
+			device_type = "mdio";
+			compatible = "fs_enet";
+			reg = <e80 8>;
+			linux,phandle = <e80>;
+			#address-cells = <1>;
+			#size-cells = <0>;
+			ethernet-phy@0 {
+				linux,phandle = <e8000>;
+				reg = <0>;
+				device_type = "ethernet-phy";
+			};
+			ethernet-phy@1 {
+				linux,phandle = <e8001>;
+				reg = <1>;
+				device_type = "ethernet-phy";
+			};
+			ethernet-phy@2 {
+				linux,phandle = <e8002>;
+				reg = <2>;
+				device_type = "ethernet-phy";
+			};
+		};
+
+		fec@e00 {
+			device_type = "network";
+			compatible = "fs_enet";
+			model = "FEC";
+			device-id = <1>;
+			reg = <e00 188>;
+			mac-address = [ 00 00 0C 00 01 FD ];
+			interrupts = <3 1>;
+			interrupt-parent = <ff000000>;
+			phy-handle = <e8000>;
+		};
+
+		fec@1e00 {
+			device_type = "network";
+			compatible = "fs_enet";
+			model = "FEC";
+			device-id = <2>;
+			reg = <1e00 188>;
+			mac-address = [ 00 00 0C 00 02 FD ];
+			interrupts = <7 1>;
+			interrupt-parent = <ff000000>;
+			phy-handle = <e8001>;
+		};
+
+		pic@ff000000 {
+			linux,phandle = <ff000000>;
+			interrupt-controller;
+			#address-cells = <0>;
+			#interrupt-cells = <2>;
+			reg = <0 24>;
+			built-in;
+			device_type = "mpc8xx-pic";
+			compatible = "CPM";
+		};
+
+		cpm@ff000000 {
+			linux,phandle = <ff000000>;
+			#address-cells = <1>;
+			#size-cells = <1>;
+			#interrupt-cells = <2>;
+			device_type = "cpm";
+			model = "CPM";
+			ranges = <0 0 4000>;
+			reg = <860 f0>;
+			command-proc = <9c0>;
+			brg-frequency = <0>;
+			interrupts = <0 2>;	// cpm error interrupt
+			interrupt-parent = <930>;
+
+			pic@930 {
+				linux,phandle = <930>;
+				interrupt-controller;
+				#address-cells = <0>;
+				#interrupt-cells = <2>;
+				interrupts = <5 2 0 2>;
+				interrupt-parent = <ff000000>;
+				reg = <930 20>;
+				built-in;
+				device_type = "cpm-pic";
+				compatible = "CPM";
+			};
+
+			smc@a80 {
+				device_type = "serial";
+				compatible = "cpm_uart";
+				model = "SMC";
+				device-id = <1>;
+				reg = <a80 10 3e80 40>;
+				clock-setup = <00ffffff 0>;
+				rx-clock = <1>;
+				tx-clock = <1>;
+				current-speed = <0>;
+				interrupts = <4 3>;
+				interrupt-parent = <930>;
+			};
+
+			smc@a90 {
+				device_type = "serial";
+				compatible = "cpm_uart";
+				model = "SMC";
+				device-id = <2>;
+				reg = <a90 20 3f80 40>;
+				clock-setup = <ff00ffff 90000>;
+				rx-clock = <2>;
+				tx-clock = <2>;
+				current-speed = <0>;
+				interrupts = <3 3>;
+				interrupt-parent = <930>;
+			};
+
+			scc@a40 {
+				device_type = "network";
+				compatible = "fs_enet";
+				model = "SCC";
+				device-id = <3>;
+				reg = <a40 18 3e00 80>;
+				mac-address = [ 00 00 0C 00 03 FD ];
+				interrupts = <1c 3>;
+				interrupt-parent = <930>;
+				phy-handle = <e8002>;
+			};
+		};
+	};
+};
arch/powerpc/configs/mpc885_ads_defconfig new file +827 -0

827 lines not on this page · raw message

arch/powerpc/platforms/8xx/Kconfig +10 -266

306 lines not on this page · raw message

arch/powerpc/platforms/8xx/Makefile new file +5 -0
new file mode 100644
index 0000000..1b59ffa
@@ -0,0 +1,5 @@
+#
+# Makefile for the PowerPC 8xx linux kernel.
+#
+obj-$(CONFIG_PPC_8xx)	  += m8xx_setup.o
+obj-$(CONFIG_MPC885ADS)   += mpc885ads_setup.o
arch/powerpc/platforms/8xx/m8xx_setup.c new file +303 -0

303 lines not on this page · raw message

arch/powerpc/platforms/8xx/mpc885ads.h new file +95 -0

95 lines not on this page · raw message

arch/powerpc/platforms/8xx/mpc885ads_setup.c new file +377 -0

377 lines not on this page · raw message

arch/powerpc/platforms/Makefile +1 -0
index 44d95ea..961021b 100644
@@ -8,6 +8,7 @@ endif
 obj-$(CONFIG_PPC_CHRP)		+= chrp/
 obj-$(CONFIG_4xx)		+= 4xx/
 obj-$(CONFIG_PPC_MPC52xx)	+= 52xx/
+obj-$(CONFIG_PPC_8xx)		+= 8xx/
 obj-$(CONFIG_PPC_83xx)		+= 83xx/
 obj-$(CONFIG_PPC_85xx)		+= 85xx/
 obj-$(CONFIG_PPC_86xx)		+= 86xx/
#8 lore raw

PATCH 6/6 8xx: Adds mpc885ads board-specific bits to arch/powerpc.

In reply to Vitaly Bordug

This add support of the Freescale mpc86xads reference board to arch/powerpc. Supported SMC1 and SMC2 (UART and serial console), FEC 100Mbps Ethernet, SCC1 Ethernet (10Mbps hdx)

---

 arch/powerpc/boot/dts/mpc866ads.dts          |  162 +++++
 arch/powerpc/configs/mpc866_ads_defconfig    |  829 ++++++++++++++++++++++++++
 arch/powerpc/platforms/8xx/Kconfig           |    8 
 arch/powerpc/platforms/8xx/Makefile          |    1 
 arch/powerpc/platforms/8xx/mpc86xads.h       |   95 +++
 arch/powerpc/platforms/8xx/mpc86xads_setup.c |  295 +++++++++
 include/asm-powerpc/mpc8xx.h                 |    4 
 7 files changed, 1394 insertions(+), 0 deletions(-)
arch/powerpc/boot/dts/mpc866ads.dts new file +162 -0
new file mode 100644
index 0000000..5d40052
@@ -0,0 +1,162 @@
+/*
+ * MPC866 ADS Device Tree Source
+ *
+ * Copyright 2006 MontaVista Software, Inc.
+ *
+ * This program is free software; you can redistribute  it and/or modify it
+ * under  the terms of  the GNU General  Public License as published by the
+ * Free Software Foundation;  either version 2 of the  License, or (at your
+ * option) any later version.
+ */
+
+
+/ {
+	model = "MPC866ADS";
+	compatible = "mpc8xx";
+	#address-cells = <1>;
+	#size-cells = <1>;
+	linux,phandle = <100>;
+
+	cpus {
+		#cpus = <1>;
+		#address-cells = <1>;
+		#size-cells = <0>;
+		linux,phandle = <200>;
+
+		PowerPC,866@0 {
+			device_type = "cpu";
+			reg = <0>;
+			d-cache-line-size = <20>;	// 32 bytes
+			i-cache-line-size = <20>;	// 32 bytes
+			d-cache-size = <2000>;		// L1, 8K
+			i-cache-size = <4000>;		// L1, 16K
+			timebase-frequency = <0>;
+			bus-frequency = <0>;
+			clock-frequency = <0>;
+			32-bit;
+			interrupts = <f 2>;	// decrementer interrupt
+			interrupt-parent = <ff000000>;
+			linux,phandle = <201>;
+			linux,boot-cpu;
+		};
+	};
+
+	memory {
+		device_type = "memory";
+		linux,phandle = <300>;
+		reg = <00000000 800000>;
+	};
+
+	soc866@ff000000 {
+		#address-cells = <1>;
+		#size-cells = <1>;
+		#interrupt-cells = <2>;
+		device_type = "soc";
+		ranges = <0 ff000000 00100000>;
+		reg = <ff000000 00000200>;
+		bus-frequency = <0>;
+		mdio@e80 {
+			device_type = "mdio";
+			compatible = "fs_enet";
+			reg = <e80 8>;
+			linux,phandle = <e80>;
+			#address-cells = <1>;
+			#size-cells = <0>;
+			ethernet-phy@f {
+				linux,phandle = <e800f>;
+				reg = <f>;
+				device_type = "ethernet-phy";
+			};
+		};
+
+		fec@e00 {
+			device_type = "network";
+			compatible = "fs_enet";
+			model = "FEC";
+			device-id = <1>;
+			reg = <e00 188>;
+			mac-address = [ 00 00 0C 00 01 FD ];
+			interrupts = <3 1>;
+			interrupt-parent = <ff000000>;
+			phy-handle = <e800f>;
+		};
+
+		pic@ff000000 {
+			linux,phandle = <ff000000>;
+			interrupt-controller;
+			#address-cells = <0>;
+			#interrupt-cells = <2>;
+			reg = <0 24>;
+			built-in;
+			device_type = "mpc8xx-pic";
+			compatible = "CPM";
+		};
+
+		cpm@ff000000 {
+			linux,phandle = <ff000000>;
+			#address-cells = <1>;
+			#size-cells = <1>;
+			#interrupt-cells = <2>;
+			device_type = "cpm";
+			model = "CPM";
+			ranges = <0 0 4000>;
+			reg = <860 f0>;
+			command-proc = <9c0>;
+			brg-frequency = <0>;
+			interrupts = <0 2>;	// cpm error interrupt
+			interrupt-parent = <930>;
+
+			pic@930 {
+				linux,phandle = <930>;
+				interrupt-controller;
+				#address-cells = <0>;
+				#interrupt-cells = <2>;
+				interrupts = <5 2 0 2>;
+				interrupt-parent = <ff000000>;
+				reg = <930 20>;
+				built-in;
+				device_type = "cpm-pic";
+				compatible = "CPM";
+			};
+
+			smc@a80 {
+				device_type = "serial";
+				compatible = "cpm_uart";
+				model = "SMC";
+				device-id = <1>;
+				reg = <a80 10 3e80 40>;
+				clock-setup = <00ffffff 0>;
+				rx-clock = <1>;
+				tx-clock = <1>;
+				current-speed = <0>;
+				interrupts = <4 3>;
+				interrupt-parent = <930>;
+			};
+
+			smc@a90 {
+				device_type = "serial";
+				compatible = "cpm_uart";
+				model = "SMC";
+				device-id = <2>;
+				reg = <a90 20 3f80 40>;
+				clock-setup = <ff00ffff 90000>;
+				rx-clock = <2>;
+				tx-clock = <2>;
+				current-speed = <0>;
+				interrupts = <3 3>;
+				interrupt-parent = <930>;
+			};
+
+			scc@a00 {
+				device_type = "network";
+				compatible = "fs_enet";
+				model = "SCC";
+				device-id = <1>;
+				reg = <a00 18 3c00 80>;
+				mac-address = [ 00 00 0C 00 03 FD ];
+				interrupts = <1e 3>;
+				interrupt-parent = <930>;
+			};
+		};
+	};
+};
arch/powerpc/configs/mpc866_ads_defconfig new file +829 -0

829 lines not on this page · raw message

arch/powerpc/platforms/8xx/Kconfig +8 -0
index 91a11d9..96ebd3b 100644
@@ -16,6 +16,14 @@ config MPC8XXFADS
 	bool "FADS"
 	select FADS
 
+config MPC86XADS
+	bool "MPC86XADS"
+	select CPM1
+	help
+	  MPC86x Application Development System by Freescale Semiconductor.
+	  The MPC86xADS is meant to serve as a platform for s/w and h/w
+	  development around the MPC86X processor families.
+
 config MPC885ADS
 	bool "MPC885ADS"
 	select CPM1
arch/powerpc/platforms/8xx/Makefile +1 -0
index 1b59ffa..5e2dae3 100644
@@ -3,3 +3,4 @@ # Makefile for the PowerPC 8xx linux ker
 #
 obj-$(CONFIG_PPC_8xx)	  += m8xx_setup.o
 obj-$(CONFIG_MPC885ADS)   += mpc885ads_setup.o
+obj-$(CONFIG_MPC86XADS)   += mpc86xads_setup.o
arch/powerpc/platforms/8xx/mpc86xads.h new file +95 -0

95 lines not on this page · raw message

arch/powerpc/platforms/8xx/mpc86xads_setup.c new file +295 -0

295 lines not on this page · raw message

include/asm-powerpc/mpc8xx.h +4 -0
index e05ba6b..5803711 100644
@@ -15,6 +15,10 @@ #ifdef CONFIG_FADS
 #include <platforms/fads.h>
 #endif
 
+#if defined(CONFIG_MPC86XADS)
+#include <platforms/8xx/mpc86xads.h>
+#endif
+
 #if defined(CONFIG_MPC885ADS)
 #include <platforms/8xx/mpc885ads.h>
 #endif