diff options
author | Marek Vasut <marex@cvs.openbsd.org> | 2009-09-09 11:34:03 +0000 |
---|---|---|
committer | Marek Vasut <marex@cvs.openbsd.org> | 2009-09-09 11:34:03 +0000 |
commit | 49a72c91a49e1c9c55249f909e9d7cf06b05a135 (patch) | |
tree | e2135e6add188e274b719a2e05e2260ea4433a32 /sys/arch | |
parent | 732a76fbf43d838746322af8a2b99f6d0e15bd8b (diff) |
Palm: Add support for PXA255 Palm Tungsten|C
Diffstat (limited to 'sys/arch')
-rw-r--r-- | sys/arch/palm/dev/palm_mmc.c | 25 | ||||
-rw-r--r-- | sys/arch/palm/dev/palm_udc.c | 4 | ||||
-rw-r--r-- | sys/arch/palm/include/machine_reg.h | 4 | ||||
-rw-r--r-- | sys/arch/palm/include/palm_var.h | 4 | ||||
-rw-r--r-- | sys/arch/palm/palm/palm_lcd.c | 26 | ||||
-rw-r--r-- | sys/arch/palm/palm/palm_machdep.c | 5 |
6 files changed, 58 insertions, 10 deletions
diff --git a/sys/arch/palm/dev/palm_mmc.c b/sys/arch/palm/dev/palm_mmc.c index e9a15d497bb..4718364c64e 100644 --- a/sys/arch/palm/dev/palm_mmc.c +++ b/sys/arch/palm/dev/palm_mmc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: palm_mmc.c,v 1.1 2009/09/05 01:22:11 marex Exp $ */ +/* $OpenBSD: palm_mmc.c,v 1.2 2009/09/09 11:34:02 marex Exp $ */ /* * Copyright (c) 2009 Marek Vasut <marex@openbsd.org> @@ -57,7 +57,24 @@ palm_mmc_attach(struct device *parent, struct device *self, void *aux) sc->tag.get_ocr = palm_mmc_get_ocr; sc->tag.set_power = palm_mmc_set_power; - sc->sc_gpio_detect = GPIO14_MMC_DETECT; + /* + * Configure the GPIO pins. In SD/MMC mode, all pins except + * MMCLK are bidirectional and the direction is controlled in + * hardware without our assistence. + */ + if (mach_is_palmtc) { + pxa2x0_gpio_set_function(6, GPIO_ALT_FN_1_OUT); + pxa2x0_gpio_set_function(8, GPIO_ALT_FN_1_OUT); + sc->sc_gpio_detect = GPIO12_TC_MMC_DETECT; + } else { + pxa2x0_gpio_set_function(32, GPIO_ALT_FN_2_OUT); + pxa2x0_gpio_set_function(112, GPIO_ALT_FN_1_IN); + pxa2x0_gpio_set_function(92, GPIO_ALT_FN_1_IN); + pxa2x0_gpio_set_function(109, GPIO_ALT_FN_1_IN); + pxa2x0_gpio_set_function(110, GPIO_ALT_FN_1_IN); + pxa2x0_gpio_set_function(111, GPIO_ALT_FN_1_IN); + sc->sc_gpio_detect = GPIO14_MMC_DETECT; + } pxammc_attach(sc, aux); } @@ -74,6 +91,8 @@ palm_mmc_set_power(void *cookie, u_int32_t ocr) if (ISSET(ocr, MMC_OCR_3_2V_3_3V | MMC_OCR_3_3V_3_4V)) { if (mach_is_palmz72) pxa2x0_gpio_clear_bit(GPIO98_PALMZ72_MMC_POWER); + else if (mach_is_palmtc) + pxa2x0_gpio_set_bit(GPIO32_PALMTC_MMC_POWER); else pxa2x0_gpio_set_bit(GPIO114_MMC_POWER); return 0; @@ -83,6 +102,8 @@ palm_mmc_set_power(void *cookie, u_int32_t ocr) } else { if (mach_is_palmz72) pxa2x0_gpio_set_bit(GPIO98_PALMZ72_MMC_POWER); + else if (mach_is_palmtc) + pxa2x0_gpio_clear_bit(GPIO32_PALMTC_MMC_POWER); else pxa2x0_gpio_clear_bit(GPIO114_MMC_POWER); return 0; diff --git a/sys/arch/palm/dev/palm_udc.c b/sys/arch/palm/dev/palm_udc.c index 368c98022fc..e63496756c9 100644 --- a/sys/arch/palm/dev/palm_udc.c +++ b/sys/arch/palm/dev/palm_udc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: palm_udc.c,v 1.2 2009/09/05 06:46:34 marex Exp $ */ +/* $OpenBSD: palm_udc.c,v 1.3 2009/09/09 11:34:02 marex Exp $ */ /* * Copyright (c) 2009 Marek Vasut <marex@openbsd.org> @@ -49,7 +49,7 @@ struct cfattach pxaudc_palm_ca = { int palm_udc_match(struct device *parent, void *match, void *aux) { - if (mach_is_palmld) + if (mach_is_palmld || mach_is_palmtc) return 0; return pxaudc_match(); } diff --git a/sys/arch/palm/include/machine_reg.h b/sys/arch/palm/include/machine_reg.h index d11d866ef9a..37e82df19aa 100644 --- a/sys/arch/palm/include/machine_reg.h +++ b/sys/arch/palm/include/machine_reg.h @@ -1,4 +1,4 @@ -/* $OpenBSD: machine_reg.h,v 1.1 2009/09/05 01:22:11 marex Exp $ */ +/* $OpenBSD: machine_reg.h,v 1.2 2009/09/09 11:34:02 marex Exp $ */ /* $NetBSD: lubbock_reg.h,v 1.1 2003/06/18 10:51:15 bsh Exp $ */ /* @@ -57,8 +57,10 @@ /* GPIOs */ #define GPIO14_MMC_DETECT 14 /* MMC detect*/ +#define GPIO12_TC_MMC_DETECT 12 /* TC MMC detect*/ #define GPIO114_MMC_POWER 114 /* MMC power */ #define GPIO98_PALMZ72_MMC_POWER 98 /* Z72 MMC power */ +#define GPIO32_PALMTC_MMC_POWER 32 /* TC MMC power */ #define GPIO13_PALMTX_USB_DETECT 13 #define GPIO15_USB_DETECT 15 diff --git a/sys/arch/palm/include/palm_var.h b/sys/arch/palm/include/palm_var.h index 8ead3c7941d..f26f7571587 100644 --- a/sys/arch/palm/include/palm_var.h +++ b/sys/arch/palm/include/palm_var.h @@ -1,4 +1,4 @@ -/* $OpenBSD: palm_var.h,v 1.1 2009/09/05 01:22:11 marex Exp $ */ +/* $OpenBSD: palm_var.h,v 1.2 2009/09/09 11:34:02 marex Exp $ */ /* $NetBSD: lubbock_var.h,v 1.1 2003/06/18 10:51:15 bsh Exp $ */ /* @@ -42,6 +42,7 @@ extern int mach; +#define mach_is_palmtc ( mach == 918 ? 1 : 0 ) #define mach_is_palmt5 ( mach == 917 ? 1 : 0 ) #define mach_is_palmtx ( mach == 885 ? 1 : 0 ) #define mach_is_palmld ( mach == 835 ? 1 : 0 ) @@ -50,6 +51,7 @@ extern int mach; static inline char *mach_name(void) { if (mach_is_palmt5) return "Palm Tungsten|T5"; + else if (mach_is_palmtc) return "Palm Tungsten|C"; else if (mach_is_palmtx) return "Palm T|X"; else if (mach_is_palmld) return "Palm LifeDrive"; else if (mach_is_palmz72) return "Palm Zire72"; diff --git a/sys/arch/palm/palm/palm_lcd.c b/sys/arch/palm/palm/palm_lcd.c index f1b55b4f15d..b814f25d381 100644 --- a/sys/arch/palm/palm/palm_lcd.c +++ b/sys/arch/palm/palm/palm_lcd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: palm_lcd.c,v 1.1 2009/09/05 01:22:11 marex Exp $ */ +/* $OpenBSD: palm_lcd.c,v 1.2 2009/09/09 11:34:02 marex Exp $ */ /* $NetBSD: lubbock_lcd.c,v 1.1 2003/08/09 19:38:53 bsh Exp $ */ /* @@ -151,6 +151,26 @@ const struct lcd_panel_geometry palm_z72_lcd = 0x08, /* EFW */ }; +const struct lcd_panel_geometry palm_tc_lcd = +{ + 320, /* Width */ + 320, /* Height */ + 0, /* No extra lines */ + + LCDPANEL_ACTIVE | LCDPANEL_VSP | LCDPANEL_HSP, + 2, /* clock divider */ + 0, /* AC bias pin freq */ + + 0x03, /* horizontal sync pulse width */ + 0x1d, /* BLW */ + 0x09, /* ELW */ + + 0x00, /* vertical sync pulse width */ + 0x06, /* BFW */ + 0x07, /* EFW */ +}; + + int lcd_match(struct device *parent, void *cf, void *aux) { @@ -159,7 +179,9 @@ lcd_match(struct device *parent, void *cf, void *aux) const struct lcd_panel_geometry *lcd_geom_get(void) { - if (mach_is_palmz72) + if (mach_is_palmtc) + return &palm_tc_lcd; + else if (mach_is_palmz72) return &palm_z72_lcd; else return &palm_t5_lcd; diff --git a/sys/arch/palm/palm/palm_machdep.c b/sys/arch/palm/palm/palm_machdep.c index c99d678667c..cf095597f85 100644 --- a/sys/arch/palm/palm/palm_machdep.c +++ b/sys/arch/palm/palm/palm_machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: palm_machdep.c,v 1.1 2009/09/05 01:22:11 marex Exp $ */ +/* $OpenBSD: palm_machdep.c,v 1.2 2009/09/09 11:34:02 marex Exp $ */ /* $NetBSD: lubbock_machdep.c,v 1.2 2003/07/15 00:25:06 lukem Exp $ */ /* @@ -625,7 +625,7 @@ initarm(void *arg) */ /* XXX should really be done after setting up the console, but we * XXX need to parse the console selection flags right now. */ - process_kernel_args((int *)0x5c000000); + process_kernel_args((int *)0x40f00008); /* * This test will work for now but has to be revised when support @@ -1104,6 +1104,7 @@ inline void process_kernel_args(int *args) { if (args[0] == 917 || /* Palm T5 */ + args[0] == 918 || /* Palm TC */ args[0] == 885 || /* Palm TX */ args[0] == 835 || /* Palm LD */ args[0] == 904) /* Palm Z72 */ |