diff options
author | Kristoffer Ericson <kristoffer.ericson@gmail.com> | 2010-09-29 21:09:54 +0200 |
---|---|---|
committer | Kristoffer Ericson <kristoffer.ericson@gmail.com> | 2011-12-10 15:47:11 +0100 |
commit | 8cf7158ad4e7bda1c1d722ba22b407c83c8e68ea (patch) | |
tree | 5bb00a5140e3608a725ec9a5b9a970befbe10417 | |
parent | 1905d49a7f25c26163fa23e68c7f434df4e69cd7 (diff) | |
download | linux-hpc-8cf7158ad4e7bda1c1d722ba22b407c83c8e68ea.tar.gz |
Clean up the jornada 700 init code.
-rw-r--r-- | arch/arm/mach-sa1100/jornada720.c | 31 | ||||
-rw-r--r-- | arch/arm/mach-sa1100/jornada720_ssp.c | 11 |
2 files changed, 27 insertions, 15 deletions
diff --git a/arch/arm/mach-sa1100/jornada720.c b/arch/arm/mach-sa1100/jornada720.c index ebbd279a675873..c97cb4bee5aeef 100644 --- a/arch/arm/mach-sa1100/jornada720.c +++ b/arch/arm/mach-sa1100/jornada720.c @@ -266,6 +266,7 @@ static struct platform_device *devices[] __initdata = { static int __init jornada720_init(void) { int ret = -ENODEV; + int i; printk(KERN_INFO "HP Jornada 710/720/728 Machine Init\n"); @@ -298,10 +299,7 @@ static int __init jornada720_init(void) * L_BIAS */ - GPDR |= GPIO_GPIO27; // set as output - udelay(50); - GAFR = GPIO_GPIO27; // switch to alternate function - udelay(50); + sa1110_mb_disable(); /* we want to use gpio20 as input to drive the clock of our uart 3 */ GPDR |= GPIO_GPIO20; /* make sure its set as ouput */ @@ -313,32 +311,37 @@ static int __init jornada720_init(void) GPSR = GPIO_GPIO20; /* restart gpio20 */ udelay(50); /* give it some time to restart */ - SBI_SKCR = (SKCR_OE_EN | SKCR_PLL_BYPASS | SKCR_RDYEN | SKCR_RCLKEN); - mdelay(500); + SBI_SKCR = 0x2081; // (SKCR_OE_EN | SKCR_PLL_BYPASS | SKCR_RDYEN); + mdelay(200); - /* disable so we dont get frozen! */ - sa1110_mb_disable(); + SBI_SKCR = 0x2083; + mdelay(200); + +// SBI_SKCR = (SKCR_OE_EN | SKCR_PLL_BYPASS | SKCR_RDYEN | SKCR_RCLKEN); +// PPDR = 0x000049FF; /* Reset the MCU */ - PPSR &= (PPC_L_FCLK | 0x80 | PPC_LDD(1)); - udelay(200); + PPSR &= (PPC_L_FCLK | 0x80 | PPC_LDD(1) | PPC_LDD(0)); + udelay(1000); - PPDR |= (PPC_L_FCLK | 0x80 | PPC_LDD(1));; - udelay(200); + PPDR |= (PPC_L_FCLK | 0x80 | PPC_LDD(1) | PPC_LDD(0)); + udelay(1000); PPSR |= PPC_L_FCLK; - udelay(200); + udelay(1000); GPSR = GPIO_GPIO25; GPDR |= GPIO_GPIO25; - /* MCSR0 */ Ser4SSCR0 = 0x0307; // set 8-bit data, setting transmission rate Ser4MCCR0 = 0x0; // disable MCP and leave everything to the SSP Ser4SSSR = 0x0; // remove overruns (rest is read-only) Ser4SSCR1 = 0x18; // Inactive SCLK = high, starting position Ser4SSCR0 = 0x0387; + while(Ser4SSSR & SSSR_RNE) + i = Ser4SSDR; + ret = platform_add_devices(devices, ARRAY_SIZE(devices)); return ret; } diff --git a/arch/arm/mach-sa1100/jornada720_ssp.c b/arch/arm/mach-sa1100/jornada720_ssp.c index 9d490c66891cfb..2e0641eee1fcdd 100644 --- a/arch/arm/mach-sa1100/jornada720_ssp.c +++ b/arch/arm/mach-sa1100/jornada720_ssp.c @@ -112,7 +112,7 @@ void jornada_ssp_start(void) { spin_lock_irqsave(&jornada_ssp_lock, jornada_ssp_flags); GPCR = GPIO_GPIO25; - udelay(50); + udelay(100); return; }; EXPORT_SYMBOL(jornada_ssp_start); @@ -123,6 +123,7 @@ EXPORT_SYMBOL(jornada_ssp_start); */ void jornada_ssp_end(void) { + udelay(100); GPSR = GPIO_GPIO25; spin_unlock_irqrestore(&jornada_ssp_lock, jornada_ssp_flags); return; @@ -135,6 +136,13 @@ static int __devinit jornada_ssp_probe(struct platform_device *dev) GPSR = GPIO_GPIO25; + PPSR &= ~PPC_L_FCLK; + udelay(500); + PPDR |= PPC_L_FCLK; + udelay(500); + PPSR |= PPC_L_FCLK; + udelay(500); + ret = ssp_init(); /* worked fine, lets not bother with anything else */ @@ -146,6 +154,7 @@ static int __devinit jornada_ssp_probe(struct platform_device *dev) printk(KERN_WARNING "SSP: initialization failed, trying non-irq solution \n"); /* init of Serial 4 port */ + Ser4SSCR0 = 0x0307; Ser4MCCR0 = 0; Ser4SSCR0 = 0x0387; Ser4SSCR1 = 0x18; |