diff options
author | Matteo Facchinetti <matteo.facchinetti@sirius-es.it> | 2013-04-04 07:57:30 +0400 |
---|---|---|
committer | Anatolij Gustschin <agust@denx.de> | 2013-04-10 22:37:43 +0400 |
commit | a9b6aae496801236cb65d9d5786dba797680cbea (patch) | |
tree | dd6c7be3512aa5c13267ea669d1f420d95daeded /arch/powerpc/platforms/512x/mpc512x_shared.c | |
parent | b9e7196ecdf6d7cd7a41b560e596c9af94413c05 (diff) | |
download | linux-a9b6aae496801236cb65d9d5786dba797680cbea.tar.xz |
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/512x/mpc512x_shared.c')
-rw-r--r-- | arch/powerpc/platforms/512x/mpc512x_shared.c | 20 |
1 files changed, 19 insertions, 1 deletions
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"); |