From 534ada5ede3c9236f0bf3c5d77e0d060e66caa4f Mon Sep 17 00:00:00 2001 From: Anatolij Gustschin Date: Thu, 24 Jan 2013 10:51:18 +0100 Subject: powerpc/mpc512x: create SoC devices for more nodes Create devices for mbx, sram, pci and gpio-leds nodes and also move nfc compatible to of_bus_id list for automatic nfc device creation. Signed-off-by: Anatolij Gustschin --- arch/powerpc/platforms/512x/mpc512x_shared.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'arch/powerpc/platforms/512x') diff --git a/arch/powerpc/platforms/512x/mpc512x_shared.c b/arch/powerpc/platforms/512x/mpc512x_shared.c index d30235b7e3f7..2765cd1c7678 100644 --- a/arch/powerpc/platforms/512x/mpc512x_shared.c +++ b/arch/powerpc/platforms/512x/mpc512x_shared.c @@ -330,22 +330,19 @@ void __init mpc512x_init_IRQ(void) static struct of_device_id __initdata of_bus_ids[] = { { .compatible = "fsl,mpc5121-immr", }, { .compatible = "fsl,mpc5121-localbus", }, + { .compatible = "fsl,mpc5121-mbx", }, + { .compatible = "fsl,mpc5121-nfc", }, + { .compatible = "fsl,mpc5121-sram", }, + { .compatible = "fsl,mpc5121-pci", }, + { .compatible = "gpio-leds", }, {}, }; void __init mpc512x_declare_of_platform_devices(void) { - struct device_node *np; - if (of_platform_bus_probe(NULL, of_bus_ids, NULL)) printk(KERN_ERR __FILE__ ": " "Error while probing of_platform bus\n"); - - np = of_find_compatible_node(NULL, NULL, "fsl,mpc5121-nfc"); - if (np) { - of_platform_device_create(np, NULL, NULL); - of_node_put(np); - } } #define DEFAULT_FIFO_SIZE 16 -- cgit v1.2.3 From b9e7196ecdf6d7cd7a41b560e596c9af94413c05 Mon Sep 17 00:00:00 2001 From: Matteo Facchinetti Date: Wed, 20 Mar 2013 07:41:52 +0000 Subject: powerpc/512x: move mpc5121_generic platform to mpc512x_generic. This provides a base for using 512x_generic platform on mpc5125 boards. By this way 512x_GENERIC it could be used for all generic mpc512x boards and kernel could be compiled with mpc512x_defconfig. Signed-off-by: Matteo Facchinetti [agust: applied s/mpc5121/mpc512x in mpc512x_generic.c] Signed-off-by: Anatolij Gustschin --- arch/powerpc/platforms/512x/Kconfig | 8 ++--- arch/powerpc/platforms/512x/Makefile | 2 +- arch/powerpc/platforms/512x/mpc5121_generic.c | 52 --------------------------- arch/powerpc/platforms/512x/mpc512x_generic.c | 52 +++++++++++++++++++++++++++ 4 files changed, 57 insertions(+), 57 deletions(-) delete mode 100644 arch/powerpc/platforms/512x/mpc5121_generic.c create mode 100644 arch/powerpc/platforms/512x/mpc512x_generic.c (limited to 'arch/powerpc/platforms/512x') diff --git a/arch/powerpc/platforms/512x/Kconfig b/arch/powerpc/platforms/512x/Kconfig index c16999802ecf..eb4620355e7b 100644 --- a/arch/powerpc/platforms/512x/Kconfig +++ b/arch/powerpc/platforms/512x/Kconfig @@ -15,16 +15,16 @@ config MPC5121_ADS help This option enables support for the MPC5121E ADS board. -config MPC5121_GENERIC - bool "Generic support for simple MPC5121 based boards" +config MPC512x_GENERIC + bool "Generic support for simple MPC512x based boards" depends on PPC_MPC512x select DEFAULT_UIMAGE help - This option enables support for simple MPC5121 based boards + This option enables support for simple MPC512x based boards which do not need custom platform specific setup. Compatible boards include: Protonic LVT base boards (ZANMCU - and VICVT2). + and VICVT2), Freescale MPC5125 Tower system. config PDM360NG bool "ifm PDM360NG board" diff --git a/arch/powerpc/platforms/512x/Makefile b/arch/powerpc/platforms/512x/Makefile index 4efc1c4b6fb5..72fb9340e09f 100644 --- a/arch/powerpc/platforms/512x/Makefile +++ b/arch/powerpc/platforms/512x/Makefile @@ -3,5 +3,5 @@ # obj-y += clock.o mpc512x_shared.o obj-$(CONFIG_MPC5121_ADS) += mpc5121_ads.o mpc5121_ads_cpld.o -obj-$(CONFIG_MPC5121_GENERIC) += mpc5121_generic.o +obj-$(CONFIG_MPC512x_GENERIC) += mpc512x_generic.o obj-$(CONFIG_PDM360NG) += pdm360ng.o diff --git a/arch/powerpc/platforms/512x/mpc5121_generic.c b/arch/powerpc/platforms/512x/mpc5121_generic.c deleted file mode 100644 index ca1ca6669990..000000000000 --- a/arch/powerpc/platforms/512x/mpc5121_generic.c +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (C) 2007,2008 Freescale Semiconductor, Inc. All rights reserved. - * - * Author: John Rigby, - * - * Description: - * MPC5121 SoC setup - * - * This 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. - * - */ - -#include -#include - -#include -#include -#include -#include - -#include "mpc512x.h" - -/* - * list of supported boards - */ -static const char * const board[] __initconst = { - "prt,prtlvt", - NULL -}; - -/* - * Called very early, MMU is off, device-tree isn't unflattened - */ -static int __init mpc5121_generic_probe(void) -{ - return of_flat_dt_match(of_get_flat_dt_root(), board); -} - -define_machine(mpc5121_generic) { - .name = "MPC5121 generic", - .probe = mpc5121_generic_probe, - .init = mpc512x_init, - .init_early = mpc512x_init_diu, - .setup_arch = mpc512x_setup_diu, - .init_IRQ = mpc512x_init_IRQ, - .get_irq = ipic_get_irq, - .calibrate_decr = generic_calibrate_decr, - .restart = mpc512x_restart, -}; diff --git a/arch/powerpc/platforms/512x/mpc512x_generic.c b/arch/powerpc/platforms/512x/mpc512x_generic.c new file mode 100644 index 000000000000..d53fa4fdff26 --- /dev/null +++ b/arch/powerpc/platforms/512x/mpc512x_generic.c @@ -0,0 +1,52 @@ +/* + * Copyright (C) 2007,2008 Freescale Semiconductor, Inc. All rights reserved. + * + * Author: John Rigby, + * + * Description: + * MPC512x SoC setup + * + * This 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. + * + */ + +#include +#include + +#include +#include +#include +#include + +#include "mpc512x.h" + +/* + * list of supported boards + */ +static const char * const board[] __initconst = { + "prt,prtlvt", + NULL +}; + +/* + * Called very early, MMU is off, device-tree isn't unflattened + */ +static int __init mpc512x_generic_probe(void) +{ + return of_flat_dt_match(of_get_flat_dt_root(), board); +} + +define_machine(mpc512x_generic) { + .name = "MPC512x generic", + .probe = mpc512x_generic_probe, + .init = mpc512x_init, + .init_early = mpc512x_init_diu, + .setup_arch = mpc512x_setup_diu, + .init_IRQ = mpc512x_init_IRQ, + .get_irq = ipic_get_irq, + .calibrate_decr = generic_calibrate_decr, + .restart = mpc512x_restart, +}; -- cgit v1.2.3 From a9b6aae496801236cb65d9d5786dba797680cbea Mon Sep 17 00:00:00 2001 From: Matteo Facchinetti Date: Thu, 4 Apr 2013 03:57:30 +0000 Subject: powerpc/mpc512x: add platform code for MPC5125. Tested on MPC5125 Tower evaluation board with mpc512x_defconfig compile configuration. In detail, supports for: - PSC / UART - RTC - ETH - DIU - I2C Signed-off-by: Matteo Facchinetti Signed-off-by: Anatolij Gustschin --- arch/powerpc/platforms/512x/clock.c | 9 ++++++++- arch/powerpc/platforms/512x/mpc512x.h | 1 + arch/powerpc/platforms/512x/mpc512x_generic.c | 1 + arch/powerpc/platforms/512x/mpc512x_shared.c | 20 +++++++++++++++++++- 4 files changed, 29 insertions(+), 2 deletions(-) (limited to 'arch/powerpc/platforms/512x') diff --git a/arch/powerpc/platforms/512x/clock.c b/arch/powerpc/platforms/512x/clock.c index 52d57d281724..e504166e089a 100644 --- a/arch/powerpc/platforms/512x/clock.c +++ b/arch/powerpc/platforms/512x/clock.c @@ -29,6 +29,8 @@ #include #include +#include "mpc512x.h" + #undef CLK_DEBUG static int clocks_initialized; @@ -683,8 +685,13 @@ static void psc_clks_init(void) struct device_node *np; struct platform_device *ofdev; u32 reg; + const char *psc_compat; + + psc_compat = mpc512x_select_psc_compat(); + if (!psc_compat) + return; - for_each_compatible_node(np, NULL, "fsl,mpc5121-psc") { + for_each_compatible_node(np, NULL, psc_compat) { if (!of_property_read_u32(np, "reg", ®)) { int pscnum = (reg & 0xf00) >> 8; struct clk *clk = psc_dev_clk(pscnum); diff --git a/arch/powerpc/platforms/512x/mpc512x.h b/arch/powerpc/platforms/512x/mpc512x.h index c32b399eb952..0a8e60023944 100644 --- a/arch/powerpc/platforms/512x/mpc512x.h +++ b/arch/powerpc/platforms/512x/mpc512x.h @@ -15,6 +15,7 @@ extern void __init mpc512x_init_IRQ(void); extern void __init mpc512x_init(void); extern int __init mpc5121_clk_init(void); void __init mpc512x_declare_of_platform_devices(void); +extern const char *mpc512x_select_psc_compat(void); extern void mpc512x_restart(char *cmd); #if defined(CONFIG_FB_FSL_DIU) || defined(CONFIG_FB_FSL_DIU_MODULE) diff --git a/arch/powerpc/platforms/512x/mpc512x_generic.c b/arch/powerpc/platforms/512x/mpc512x_generic.c index d53fa4fdff26..6dfcb5138990 100644 --- a/arch/powerpc/platforms/512x/mpc512x_generic.c +++ b/arch/powerpc/platforms/512x/mpc512x_generic.c @@ -28,6 +28,7 @@ */ static const char * const board[] __initconst = { "prt,prtlvt", + "fsl,mpc5125ads", NULL }; diff --git a/arch/powerpc/platforms/512x/mpc512x_shared.c b/arch/powerpc/platforms/512x/mpc512x_shared.c index 2765cd1c7678..7642cd7aad73 100644 --- a/arch/powerpc/platforms/512x/mpc512x_shared.c +++ b/arch/powerpc/platforms/512x/mpc512x_shared.c @@ -347,6 +347,17 @@ void __init mpc512x_declare_of_platform_devices(void) #define DEFAULT_FIFO_SIZE 16 +const char *mpc512x_select_psc_compat(void) +{ + if (of_machine_is_compatible("fsl,mpc5121")) + return "fsl,mpc5121-psc"; + + if (of_machine_is_compatible("fsl,mpc5125")) + return "fsl,mpc5125-psc"; + + return NULL; +} + static unsigned int __init get_fifo_size(struct device_node *np, char *prop_name) { @@ -372,9 +383,16 @@ void __init mpc512x_psc_fifo_init(void) void __iomem *psc; unsigned int tx_fifo_size; unsigned int rx_fifo_size; + const char *psc_compat; int fifobase = 0; /* current fifo address in 32 bit words */ - for_each_compatible_node(np, NULL, "fsl,mpc5121-psc") { + psc_compat = mpc512x_select_psc_compat(); + if (!psc_compat) { + pr_err("%s: no compatible devices found\n", __func__); + return; + } + + for_each_compatible_node(np, NULL, psc_compat) { tx_fifo_size = get_fifo_size(np, "fsl,tx-fifo-size"); rx_fifo_size = get_fifo_size(np, "fsl,rx-fifo-size"); -- cgit v1.2.3 From fdeaf0e20e9f3999c5cb129e821595fe927bf259 Mon Sep 17 00:00:00 2001 From: Anatolij Gustschin Date: Wed, 10 Apr 2013 20:46:27 +0200 Subject: powerpc/512x: add ifm ac14xx board Add dts file for ac14xx board and its board compatible string to the generic mpc512x board match list. Also add phandle to the dma DT node since there is a change (for MPC5121 SDHC DMA support) merged via linux-mmc tree with reference to the dma controller node in the sdhc node. Signed-off-by: Anatolij Gustschin --- arch/powerpc/platforms/512x/mpc512x_generic.c | 1 + 1 file changed, 1 insertion(+) (limited to 'arch/powerpc/platforms/512x') diff --git a/arch/powerpc/platforms/512x/mpc512x_generic.c b/arch/powerpc/platforms/512x/mpc512x_generic.c index 6dfcb5138990..5fb919b30924 100644 --- a/arch/powerpc/platforms/512x/mpc512x_generic.c +++ b/arch/powerpc/platforms/512x/mpc512x_generic.c @@ -29,6 +29,7 @@ static const char * const board[] __initconst = { "prt,prtlvt", "fsl,mpc5125ads", + "ifm,ac14xx", NULL }; -- cgit v1.2.3