diff options
author | Matteo Facchinetti <matteo.facchinetti@sirius-es.it> | 2013-04-03 23:57:30 -0400 |
---|---|---|
committer | Anatolij Gustschin <agust@denx.de> | 2013-04-10 14:37:43 -0400 |
commit | a9b6aae496801236cb65d9d5786dba797680cbea (patch) | |
tree | dd6c7be3512aa5c13267ea669d1f420d95daeded /arch/powerpc/platforms | |
parent | b9e7196ecdf6d7cd7a41b560e596c9af94413c05 (diff) |
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 <matteo.facchinetti@sirius-es.it>
Signed-off-by: Anatolij Gustschin <agust@denx.de>
Diffstat (limited to 'arch/powerpc/platforms')
-rw-r--r-- | arch/powerpc/platforms/512x/clock.c | 9 | ||||
-rw-r--r-- | arch/powerpc/platforms/512x/mpc512x.h | 1 | ||||
-rw-r--r-- | arch/powerpc/platforms/512x/mpc512x_generic.c | 1 | ||||
-rw-r--r-- | arch/powerpc/platforms/512x/mpc512x_shared.c | 20 |
4 files changed, 29 insertions, 2 deletions
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 @@ | |||
29 | #include <asm/mpc5121.h> | 29 | #include <asm/mpc5121.h> |
30 | #include <asm/clk_interface.h> | 30 | #include <asm/clk_interface.h> |
31 | 31 | ||
32 | #include "mpc512x.h" | ||
33 | |||
32 | #undef CLK_DEBUG | 34 | #undef CLK_DEBUG |
33 | 35 | ||
34 | static int clocks_initialized; | 36 | static int clocks_initialized; |
@@ -683,8 +685,13 @@ static void psc_clks_init(void) | |||
683 | struct device_node *np; | 685 | struct device_node *np; |
684 | struct platform_device *ofdev; | 686 | struct platform_device *ofdev; |
685 | u32 reg; | 687 | u32 reg; |
688 | const char *psc_compat; | ||
689 | |||
690 | psc_compat = mpc512x_select_psc_compat(); | ||
691 | if (!psc_compat) | ||
692 | return; | ||
686 | 693 | ||
687 | for_each_compatible_node(np, NULL, "fsl,mpc5121-psc") { | 694 | for_each_compatible_node(np, NULL, psc_compat) { |
688 | if (!of_property_read_u32(np, "reg", ®)) { | 695 | if (!of_property_read_u32(np, "reg", ®)) { |
689 | int pscnum = (reg & 0xf00) >> 8; | 696 | int pscnum = (reg & 0xf00) >> 8; |
690 | struct clk *clk = psc_dev_clk(pscnum); | 697 | 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); | |||
15 | extern void __init mpc512x_init(void); | 15 | extern void __init mpc512x_init(void); |
16 | extern int __init mpc5121_clk_init(void); | 16 | extern int __init mpc5121_clk_init(void); |
17 | void __init mpc512x_declare_of_platform_devices(void); | 17 | void __init mpc512x_declare_of_platform_devices(void); |
18 | extern const char *mpc512x_select_psc_compat(void); | ||
18 | extern void mpc512x_restart(char *cmd); | 19 | extern void mpc512x_restart(char *cmd); |
19 | 20 | ||
20 | #if defined(CONFIG_FB_FSL_DIU) || defined(CONFIG_FB_FSL_DIU_MODULE) | 21 | #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 @@ | |||
28 | */ | 28 | */ |
29 | static const char * const board[] __initconst = { | 29 | static const char * const board[] __initconst = { |
30 | "prt,prtlvt", | 30 | "prt,prtlvt", |
31 | "fsl,mpc5125ads", | ||
31 | NULL | 32 | NULL |
32 | }; | 33 | }; |
33 | 34 | ||
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) | |||
347 | 347 | ||
348 | #define DEFAULT_FIFO_SIZE 16 | 348 | #define DEFAULT_FIFO_SIZE 16 |
349 | 349 | ||
350 | const char *mpc512x_select_psc_compat(void) | ||
351 | { | ||
352 | if (of_machine_is_compatible("fsl,mpc5121")) | ||
353 | return "fsl,mpc5121-psc"; | ||
354 | |||
355 | if (of_machine_is_compatible("fsl,mpc5125")) | ||
356 | return "fsl,mpc5125-psc"; | ||
357 | |||
358 | return NULL; | ||
359 | } | ||
360 | |||
350 | static unsigned int __init get_fifo_size(struct device_node *np, | 361 | static unsigned int __init get_fifo_size(struct device_node *np, |
351 | char *prop_name) | 362 | char *prop_name) |
352 | { | 363 | { |
@@ -372,9 +383,16 @@ void __init mpc512x_psc_fifo_init(void) | |||
372 | void __iomem *psc; | 383 | void __iomem *psc; |
373 | unsigned int tx_fifo_size; | 384 | unsigned int tx_fifo_size; |
374 | unsigned int rx_fifo_size; | 385 | unsigned int rx_fifo_size; |
386 | const char *psc_compat; | ||
375 | int fifobase = 0; /* current fifo address in 32 bit words */ | 387 | int fifobase = 0; /* current fifo address in 32 bit words */ |
376 | 388 | ||
377 | for_each_compatible_node(np, NULL, "fsl,mpc5121-psc") { | 389 | psc_compat = mpc512x_select_psc_compat(); |
390 | if (!psc_compat) { | ||
391 | pr_err("%s: no compatible devices found\n", __func__); | ||
392 | return; | ||
393 | } | ||
394 | |||
395 | for_each_compatible_node(np, NULL, psc_compat) { | ||
378 | tx_fifo_size = get_fifo_size(np, "fsl,tx-fifo-size"); | 396 | tx_fifo_size = get_fifo_size(np, "fsl,tx-fifo-size"); |
379 | rx_fifo_size = get_fifo_size(np, "fsl,rx-fifo-size"); | 397 | rx_fifo_size = get_fifo_size(np, "fsl,rx-fifo-size"); |
380 | 398 | ||