aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKristoffer Ericson <kristoffer.ericson@gmail.com>2010-10-24 21:46:03 +0200
committerKristoffer Ericson <kristoffer.ericson@gmail.com>2011-12-10 15:52:30 +0100
commite378dfddef421327f6c071a355c23a7fad1c6d92 (patch)
treecce77ac76fe9eb5d6ddf756e28145d69f841c510
parent5625792f7d1a9a5c54362af03a10f458fabdf1a5 (diff)
downloadlinux-hpc-e378dfddef421327f6c071a355c23a7fad1c6d92.tar.gz
arch/arm/ jornada : Add flashrom support
* Lets add support inside the machine file * and add kconfig option Signed-off-by: Kristoffer Ericson <kristoffer.ericson@gmail.com>
-rw-r--r--arch/arm/mach-sa1100/Kconfig7
-rw-r--r--arch/arm/mach-sa1100/jornada720.c81
2 files changed, 73 insertions, 15 deletions
diff --git a/arch/arm/mach-sa1100/Kconfig b/arch/arm/mach-sa1100/Kconfig
index fd4c52b7ccb68a..86a455029183ae 100644
--- a/arch/arm/mach-sa1100/Kconfig
+++ b/arch/arm/mach-sa1100/Kconfig
@@ -93,6 +93,13 @@ config SA1100_JORNADA720
handheld computer. See <http://www.hp.com/jornada/products/720>
for details.
+config SA1100_JORNADA720_FLASHROM
+ bool "HP Jornada Flashrom"
+ depends on SA1100_JORNADA720
+ help
+ Say Y here if you want to build a kernel for the HP Jornada 720
+ handheld computer and you got an flashrom board.
+
config SA1100_JORNADA720_SSP
bool "HP Jornada 720 Extended SSP driver"
select SA1100_SSP
diff --git a/arch/arm/mach-sa1100/jornada720.c b/arch/arm/mach-sa1100/jornada720.c
index d3ec620618f186..f3cc2a3d1514cb 100644
--- a/arch/arm/mach-sa1100/jornada720.c
+++ b/arch/arm/mach-sa1100/jornada720.c
@@ -35,12 +35,20 @@
#include "generic.h"
+#define SBI_SKCR __REG(SA1111_VBASE)
+#define MDCNFG __REG(0xA0000000)
+#define MDCAS00 __REG(0xA0000004)
+#define MDCAS01 __REG(0xA0000008)
+#define MDCAS02 __REG(0xA000000C)
+#define MDCAS20 __REG(0xA0000020);
+#define MDCAS21 __REG(0xA0000024);
+#define MDCAS22 __REG(0xA0000028);
+#define SMCNFG __REG(0xA0000030);
/*
* HP Documentation referred in this file:
* http://www.jlime.com/downloads/development/docs/jornada7xx/jornada720.txt
*/
-/* line 110 of HP's doc */
#define TUCR_VAL 0x20000400
/* memory space (line 52 of HP's doc) */
@@ -241,32 +249,75 @@ static struct platform_device jornada_ts_device = {
.id = -1,
};
+static struct platform_device jornada_bl_device = {
+ .name = "jornada_bl",
+ .id = -1,
+};
+
+static struct platform_device jornada_lcd_device = {
+ .name = "jornada_lcd",
+ .id = -1,
+};
+
+
static struct platform_device *devices[] __initdata = {
&sa1111_device,
&jornada_ssp_device,
&s1d13xxxfb_device,
&jornada_kbd_device,
&jornada_ts_device,
+ &jornada_bl_device,
+ &jornada_lcd_device,
};
static int __init jornada720_init(void)
{
int ret = -ENODEV;
+ int i;
- if (machine_is_jornada720()) {
- /* we want to use gpio20 as input to drive the clock of our uart 3 */
- GPDR |= GPIO_GPIO20; /* Clear gpio20 pin as input */
- TUCR = TUCR_VAL;
- GPSR = GPIO_GPIO20; /* start gpio20 pin */
- udelay(1);
- GPCR = GPIO_GPIO20; /* stop gpio20 */
- udelay(1);
- GPSR = GPIO_GPIO20; /* restart gpio20 */
- udelay(20); /* give it some time to restart */
-
- ret = platform_add_devices(devices, ARRAY_SIZE(devices));
- }
+#ifdef CONFIG_SA1100_JORNADA720_FLASHROM
+ 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 */
+ TUCR = TUCR_VAL; // reserve GPIO21/22 for use as MBGNT/MBREQ
+ GPSR = GPIO_GPIO20; /* start gpio20 pin */
+ udelay(50);
+ GPCR = GPIO_GPIO20; /* clear pin level gpio20 */
+ udelay(50);
+ GPSR = GPIO_GPIO20; /* restart gpio20 */
+ udelay(50); /* give it some time to restart */
+
+ SBI_SKCR = 0x2081; // (SKCR_OE_EN | SKCR_PLL_BYPASS | SKCR_RDYEN);
+ mdelay(200);
+
+ SBI_SKCR = 0x2083;
+ mdelay(200);
+
+ /* Reset the MCU */
+ PPSR &= (PPC_L_FCLK | 0x80 | PPC_LDD(1) | PPC_LDD(0));
+ udelay(1000);
+
+ PPDR |= (PPC_L_FCLK | 0x80 | PPC_LDD(1) | PPC_LDD(0));
+ udelay(1000);
+
+ PPSR |= PPC_L_FCLK;
+ udelay(1000);
+
+ GPSR = GPIO_GPIO25;
+ GPDR |= GPIO_GPIO25;
+
+ 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;
+#endif
+ ret = platform_add_devices(devices, ARRAY_SIZE(devices));
return ret;
}
@@ -353,7 +404,7 @@ static struct flash_platform_data jornada720_flash_data = {
static struct resource jornada720_flash_resource = {
.start = SA1100_CS0_PHYS,
- .end = SA1100_CS0_PHYS + SZ_32M - 1,
+ .end = SA1100_CS0_PHYS + SZ_64M - 1,
.flags = IORESOURCE_MEM,
};