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>
This commit is contained in:

کامیت شده توسط
Anatolij Gustschin

والد
b9e7196ecd
کامیت
a9b6aae496
@@ -29,6 +29,8 @@
|
||||
#include <asm/mpc5121.h>
|
||||
#include <asm/clk_interface.h>
|
||||
|
||||
#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;
|
||||
|
||||
for_each_compatible_node(np, NULL, "fsl,mpc5121-psc") {
|
||||
psc_compat = mpc512x_select_psc_compat();
|
||||
if (!psc_compat)
|
||||
return;
|
||||
|
||||
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);
|
||||
|
@@ -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)
|
||||
|
@@ -28,6 +28,7 @@
|
||||
*/
|
||||
static const char * const board[] __initconst = {
|
||||
"prt,prtlvt",
|
||||
"fsl,mpc5125ads",
|
||||
NULL
|
||||
};
|
||||
|
||||
|
@@ -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");
|
||||
|
||||
|
مرجع در شماره جدید
Block a user