Commit 6413a4ba authored by Kevin Hilman's avatar Kevin Hilman

davinci: PSC: finalize decoupling of PSC and MUX settings

Signed-off-by: default avatarKevin Hilman <khilman@deeprootsystems.com>
parent 22d7d0d3
......@@ -573,6 +573,7 @@ static struct davinci_i2c_platform_data i2c_pdata = {
static void __init evm_init_i2c(void)
{
davinci_cfg_reg(DM644X_I2C);
davinci_init_i2c(&i2c_pdata);
i2c_add_driver(&dm6446evm_msp_driver);
i2c_register_board_info(1, i2c_info, ARRAY_SIZE(i2c_info));
......
......@@ -52,6 +52,7 @@
#include <mach/i2c.h>
#include <mach/serial.h>
#include <mach/psc.h>
#include <mach/mux.h>
#define DAVINCI_ASYNC_EMIF_CONTROL_BASE 0x01e00000
#define DAVINCI_ASYNC_EMIF_DATA_CE0_BASE 0x02000000
......@@ -132,6 +133,7 @@ static struct davinci_i2c_platform_data i2c_pdata = {
static void __init sffsdr_init_i2c(void)
{
davinci_cfg_reg(DM644X_I2C);
davinci_init_i2c(&i2c_pdata);
i2c_register_board_info(1, i2c_info, ARRAY_SIZE(i2c_info));
}
......@@ -152,13 +154,16 @@ static void __init davinci_sffsdr_map_io(void)
static __init void davinci_sffsdr_init(void)
{
davinci_psc_init();
platform_add_devices(davinci_sffsdr_devices,
ARRAY_SIZE(davinci_sffsdr_devices));
sffsdr_init_i2c();
davinci_serial_init(&uart_config);
davinci_init_emac(davinci_sffsdr_mac_addr);
setup_usb(0, 0); /* We support only peripheral mode. */
/* mux VLYNQ pins */
davinci_cfg_reg(DM644X_VLYNQEN);
davinci_cfg_reg(DM644X_VLYNQWD);
}
static int davinci_cpmac_eth_setup(char *str)
......
......@@ -377,7 +377,6 @@ int __init davinci_clk_init(struct clk *clocks[])
struct clk *clkp;
int i = 0;
davinci_psc_init();
while ((clkp = clocks[i++])) {
if (clkp->pll_data)
clk_pll_init(clkp);
......
......@@ -190,6 +190,18 @@ void __init davinci_setup_mmc(int module, struct davinci_mmc_config *config)
/* enable RX EDMA */
davinci_cfg_reg(DM355_EVT26_MMC0_RX);
}
else if (cpu_is_davinci_dm644x()) {
/* REVISIT: should this be in board-init code? */
void __iomem *base =
IO_ADDRESS(DAVINCI_SYSTEM_MODULE_BASE);
/* Power-on 3.3V IO cells */
__raw_writel(0, base + DM64XX_VDD3P3V_PWDN);
/*Set up the pull regiter for MMC */
davinci_cfg_reg(DM644X_MSTK);
}
pdev = &davinci_mmcsd0_device;
clockname = cpu_is_davinci_dm355() ? "mmcsd0" : "mmcsd";
break;
......
......@@ -21,4 +21,7 @@
*/
#define DAVINCI_SYSTEM_MODULE_BASE 0x01C40000
/* System control register offsets */
#define DM64XX_VDD3P3V_PWDN 0x48
#endif /* __ASM_ARCH_HARDWARE_H */
......@@ -116,7 +116,6 @@
#define DM646X_LPSC_TIMER1 35
#define DM646X_LPSC_ARM_INTC 45
extern void davinci_psc_init(void);
extern void davinci_psc_config(unsigned int domain, unsigned int id,
char enable);
......
......@@ -39,41 +39,6 @@
#define MDSTAT 0x800
#define MDCTL 0xA00
/* System control register offsets */
#define VDD3P3V_PWDN 0x48
static void (*davinci_psc_mux)(unsigned int id);
static void dm6446_psc_mux(unsigned int id)
{
void __iomem *base = IO_ADDRESS(DAVINCI_SYSTEM_MODULE_BASE);
switch (id) {
case DAVINCI_LPSC_MMC_SD:
/* VDD power manupulations are done in U-Boot for CPMAC
* so applies to MMC as well
*/
/*Set up the pull regiter for MMC */
__raw_writel(0, base + VDD3P3V_PWDN);
davinci_cfg_reg(DM644X_MSTK);
break;
case DAVINCI_LPSC_I2C:
davinci_cfg_reg(DM644X_I2C);
break;
case DAVINCI_LPSC_VLYNQ:
davinci_cfg_reg(DM644X_VLYNQEN);
davinci_cfg_reg(DM644X_VLYNQWD);
break;
default:
break;
}
}
static void nop_psc_mux(unsigned int id)
{
/* nothing */
}
/* Enable or disable a PSC domain */
void davinci_psc_config(unsigned int domain, unsigned int id, char enable)
{
......@@ -125,19 +90,4 @@ void davinci_psc_config(unsigned int domain, unsigned int id, char enable)
do {
mdstat = __raw_readl(psc_base + MDSTAT + 4 * id);
} while (!((mdstat & 0x0000001F) == mdstat_mask));
if (enable)
davinci_psc_mux(id);
}
void __init davinci_psc_init(void)
{
if (cpu_is_davinci_dm644x() || cpu_is_davinci_dm646x()) {
davinci_psc_mux = dm6446_psc_mux;
} else if (cpu_is_davinci_dm355()) {
davinci_psc_mux = nop_psc_mux;
} else {
pr_err("PSC: no PSC mux hooks for this CPU\n");
davinci_psc_mux = nop_psc_mux;
}
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment