* Initial B&N Nook Color support, take four @ 2011-05-22 21:04 green at linuxhacker.ru 2011-05-22 21:04 ` [PATCH 1/3] Initial B&N Nook Color (encore) support green at linuxhacker.ru ` (4 more replies) 0 siblings, 5 replies; 10+ messages in thread From: green at linuxhacker.ru @ 2011-05-22 21:04 UTC (permalink / raw) To: linux-arm-kernel Hello! Next attempt at B&N Nook Color board file submission. USB peripheral mode is fully operational as is serial console and MMC/SDCard. Changes since v3: Separated mach-types change into a separate patch (already got RMK approval) Dramatically cut number of includes in the board file again. No longer set voltage regulator dev, just device name in the supply. Style fixes Serial in uncompress.h sorted by name Corrected MUX package to CBP in board file. omap_i2c_init now has no return since it's unused anyway. Fixed keypad definition. since v2: rebased on devel-cleanup branch since v1: Threw away all the android stuff as suggested Cleaned up voltage regulators and removed the ones our twl chip actually does not have Changed the split of the patches to board file + twl update Bye, Oleg ^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH 1/3] Initial B&N Nook Color (encore) support. 2011-05-22 21:04 Initial B&N Nook Color support, take four green at linuxhacker.ru @ 2011-05-22 21:04 ` green at linuxhacker.ru 2011-05-24 7:07 ` Igor Grinberg 2011-05-22 21:04 ` [PATCH 2/3] Add tps65921 chip green at linuxhacker.ru ` (3 subsequent siblings) 4 siblings, 1 reply; 10+ messages in thread From: green at linuxhacker.ru @ 2011-05-22 21:04 UTC (permalink / raw) To: linux-arm-kernel From: Oleg Drokin <green@linuxhacker.ru> Bare-bones board file, comes with serial console, gpio keys, MMC/SDCard and USB (peripheral) support. Signed-off-by: Oleg Drokin <green@linuxhacker.ru> --- arch/arm/mach-omap2/Kconfig | 5 + arch/arm/mach-omap2/Makefile | 2 + arch/arm/mach-omap2/board-omap3encore.c | 350 ++++++++++++++++++++++++++ arch/arm/plat-omap/include/plat/uncompress.h | 1 + 4 files changed, 358 insertions(+), 0 deletions(-) create mode 100644 arch/arm/mach-omap2/board-omap3encore.c diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig index b997a35..5370561 100644 --- a/arch/arm/mach-omap2/Kconfig +++ b/arch/arm/mach-omap2/Kconfig @@ -173,6 +173,11 @@ config MACH_OMAP3_TORPEDO for full description please see the products webpage at http://www.logicpd.com/products/development-kits/zoom-omap35x-torpedo-development-kit +config MACH_ENCORE + bool "Barnes & Noble Encore (Nook Color)" + depends on ARCH_OMAP3 + select OMAP_PACKAGE_CBP + config MACH_OVERO bool "Gumstix Overo board" depends on ARCH_OMAP3 diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile index a0c2cae..619e5ca 100644 --- a/arch/arm/mach-omap2/Makefile +++ b/arch/arm/mach-omap2/Makefile @@ -189,6 +189,8 @@ obj-$(CONFIG_MACH_OMAP3530_LV_SOM) += board-omap3logic.o \ hsmmc.o obj-$(CONFIG_MACH_OMAP3_TORPEDO) += board-omap3logic.o \ hsmmc.o +obj-$(CONFIG_MACH_ENCORE) += board-omap3encore.o \ + hsmmc.o obj-$(CONFIG_MACH_OVERO) += board-overo.o \ hsmmc.o obj-$(CONFIG_MACH_OMAP3EVM) += board-omap3evm.o \ diff --git a/arch/arm/mach-omap2/board-omap3encore.c b/arch/arm/mach-omap2/board-omap3encore.c new file mode 100644 index 0000000..e4a0a98 --- /dev/null +++ b/arch/arm/mach-omap2/board-omap3encore.c @@ -0,0 +1,350 @@ +/* + * Support for Barns&Noble Nook Color + * + * Loosely based on mach-omap2/board-zoom.c + * Copyright (C) 2008-2010 Texas Instruments Inc. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * May 2011 Oleg Drokin <green@linuxhacker.ru> - Port to 2.6.39 + * + */ + +#include <linux/gpio.h> +#include <linux/gpio_keys.h> +#include <linux/i2c/twl.h> +#include <linux/regulator/machine.h> + +#include <asm/mach-types.h> +#include <asm/mach/arch.h> + +#include <plat/common.h> +#include <plat/usb.h> +#include <plat/mux.h> +#include <plat/mmc.h> + +#include "mux.h" +#include "hsmmc.h" +#include "sdram-hynix-h8mbx00u0mer-0em.h" + +/* Encore-specific device-info and i2c addresses. */ +/* Battery, bus 1 */ +#define MAX17042_I2C_SLAVE_ADDRESS 0x36 +#define MAX17042_GPIO_FOR_IRQ 100 + +/*addition of MAXIM8903/TI GPIO mapping WRT schematics */ +#define MAX8903_UOK_GPIO_FOR_IRQ 115 +#define MAX8903_DOK_GPIO_FOR_IRQ 114 +#define MAX8903_GPIO_CHG_EN 110 +#define MAX8903_GPIO_CHG_STATUS 111 +#define MAX8903_GPIO_CHG_FLT 101 +#define MAX8903_GPIO_CHG_IUSB 102 +#define MAX8903_GPIO_CHG_USUS 104 +#define MAX8903_GPIO_CHG_ILM 61 + +/* TI WLAN */ +#define ENCORE_WIFI_PMENA_GPIO 22 +#define ENCORE_WIFI_IRQ_GPIO 15 +#define ENCORE_WIFI_EN_POW 16 + +/* Accelerometer i2c bus 1*/ +#define KXTF9_I2C_SLAVE_ADDRESS 0x0F +#define KXTF9_GPIO_FOR_PWR 34 +#define KXTF9_GPIO_FOR_IRQ 113 + +/* Touch screen i2c bus 2*/ +#define CYTTSP_I2C_SLAVEADDRESS 34 +#define ENCORE_CYTTSP_GPIO 99 +#define ENCORE_CYTTSP_RESET_GPIO 46 + +/* Audio codec, i2c bus 2 */ +#define AUDIO_CODEC_POWER_ENABLE_GPIO 103 +#define AUDIO_CODEC_RESET_GPIO 37 +#define AUDIO_CODEC_IRQ_GPIO 59 +#define AIC3100_I2CSLAVEADDRESS 0x18 + + +/* Different HW revisions */ +#define BOARD_ENCORE_REV_EVT1A 0x1 +#define BOARD_ENCORE_REV_EVT1B 0x2 +#define BOARD_ENCORE_REV_EVT2 0x3 +#define BOARD_ENCORE_REV_DVT 0x4 +#define BOARD_ENCORE_REV_PVT 0x5 +#define BOARD_ENCORE_REV_UNKNOWN 0x6 + +static inline int is_encore_board_evt2(void) +{ + return system_rev >= BOARD_ENCORE_REV_EVT2; +} + +static inline int is_encore_board_evt1b(void) +{ + return system_rev == BOARD_ENCORE_REV_EVT1B; +} + +static int encore_twl4030_keymap[] = { + KEY(1, 0, KEY_VOLUMEUP), + KEY(2, 0, KEY_VOLUMEDOWN), +}; + +static struct matrix_keymap_data encore_twl4030_keymap_data = { + .keymap = encore_twl4030_keymap, + .keymap_size = ARRAY_SIZE(encore_twl4030_keymap), +}; + +static struct twl4030_keypad_data encore_kp_twl4030_data = { + .rows = 8, + .cols = 8, + .keymap_data = &encore_twl4030_keymap_data, + .rep = 1, +}; + +/* HOME key code for HW > EVT2A */ +static struct gpio_keys_button encore_gpio_buttons[] = { + { + .code = KEY_POWER, + .gpio = 14, + .desc = "POWER", + .active_low = 0, + .wakeup = 1, + }, + { + .code = KEY_HOME, + .gpio = 48, + .desc = "HOME", + .active_low = 1, + .wakeup = 1, + }, +}; + +static struct gpio_keys_platform_data encore_gpio_key_info = { + .buttons = encore_gpio_buttons, + .nbuttons = ARRAY_SIZE(encore_gpio_buttons), +}; + +static struct platform_device encore_keys_gpio = { + .name = "gpio-keys", + .id = -1, + .dev = { + .platform_data = &encore_gpio_key_info, + }, +}; + +static struct platform_device *encore_devices[] __initdata = { + &encore_keys_gpio, +}; + +static void __init omap_encore_init_early(void) +{ + omap2_init_common_infrastructure(); + omap2_init_common_devices(h8mbx00u0mer0em_sdrc_params, + h8mbx00u0mer0em_sdrc_params); +} + +static struct twl4030_usb_data encore_usb_data = { + .usb_mode = T2_USB_MODE_ULPI, +}; + +static struct regulator_consumer_supply encore_vmmc1_supply = { + .supply = "vmmc", + .dev_name = "omap_hsmmc.0" +}; + +static struct regulator_consumer_supply encore_vdda_dac_supply = + REGULATOR_SUPPLY("vdda_dac", "omapdss_venc"); + +/* VMMC1 for OMAP VDD_MMC1 (i/o) and MMC1 card */ +static struct regulator_init_data encore_vmmc1 = { + .constraints = { + .min_uV = 1850000, + .max_uV = 3150000, + .valid_modes_mask = REGULATOR_MODE_NORMAL + | REGULATOR_MODE_STANDBY, + .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE + | REGULATOR_CHANGE_MODE + | REGULATOR_CHANGE_STATUS, + }, + .num_consumer_supplies = 1, + .consumer_supplies = &encore_vmmc1_supply, +}; + +static struct regulator_init_data encore_vdac = { + .constraints = { + .min_uV = 1800000, + .max_uV = 1800000, + .valid_modes_mask = REGULATOR_MODE_NORMAL + | REGULATOR_MODE_STANDBY, + .valid_ops_mask = REGULATOR_CHANGE_MODE + | REGULATOR_CHANGE_STATUS, + }, + .num_consumer_supplies = 1, + .consumer_supplies = &encore_vdda_dac_supply, +}; + +/* + * The order is reverted in this table so that internal eMMC is presented + * as first mmc card for compatibility with existing installations and + * for common sense reasons + */ +static struct omap2_hsmmc_info mmc[] __initdata = { + { + .name = "internal", + .mmc = 2, + .caps = MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA, + .gpio_cd = -EINVAL, + .gpio_wp = -EINVAL, + .nonremovable = true, + .power_saving = true, + .ocr_mask = MMC_VDD_165_195, /* 1.85V */ + }, + { + .name = "external", + .mmc = 1, + .caps = MMC_CAP_4_BIT_DATA, + .gpio_cd = -EINVAL, + .gpio_wp = -EINVAL, + .power_saving = true, + }, + { + .name = "internal", + .mmc = 3, + .caps = MMC_CAP_4_BIT_DATA, + .gpio_cd = -EINVAL, + .gpio_wp = -EINVAL, + .nonremovable = true, + .power_saving = true, + }, + {} /* Terminator */ +}; + +static int encore_hsmmc_card_detect(struct device *dev, int slot) +{ + struct omap_mmc_platform_data *mmc = dev->platform_data; + + /* Encore board EVT2 and later has pin high when card is present */ + return gpio_get_value_cansleep(mmc->slots[0].switch_pin); +} + +static int encore_twl4030_hsmmc_late_init(struct device *dev) +{ + int ret = 0; + struct platform_device *pdev = container_of(dev, + struct platform_device, dev); + struct omap_mmc_platform_data *pdata = dev->platform_data; + + if (is_encore_board_evt2()) { + /* Setting MMC1 (external) Card detect */ + if (pdev->id == 0) + pdata->slots[0].card_detect = encore_hsmmc_card_detect; + } + + return ret; +} + +static __init void encore_hsmmc_set_late_init(struct device *dev) +{ + struct omap_mmc_platform_data *pdata; + + /* dev can be null if CONFIG_MMC_OMAP_HS is not set */ + if (!dev) + return; + + pdata = dev->platform_data; + pdata->init = encore_twl4030_hsmmc_late_init; +} + +static int __ref encore_twl_gpio_setup(struct device *dev, + unsigned gpio, unsigned ngpio) +{ + struct omap2_hsmmc_info *c; + /* + * gpio + 0 is "mmc0_cd" (input/IRQ), + * gpio + 1 is "mmc1_cd" (input/IRQ) + */ + mmc[1].gpio_cd = gpio + 0; + mmc[0].gpio_cd = gpio + 1; + omap2_hsmmc_init(mmc); + for (c = mmc; c->mmc; c++) + encore_hsmmc_set_late_init(c->dev); + + return 0; +} + +static struct twl4030_gpio_platform_data encore_gpio_data = { + .gpio_base = OMAP_MAX_GPIO_LINES, + .irq_base = TWL4030_GPIO_IRQ_BASE, + .irq_end = TWL4030_GPIO_IRQ_END, + .setup = encore_twl_gpio_setup, +}; + +static struct twl4030_madc_platform_data encore_madc_data = { + .irq_line = 1, +}; + +static struct twl4030_platform_data __refdata encore_twldata = { + .irq_base = TWL4030_IRQ_BASE, + .irq_end = TWL4030_IRQ_END, + + .madc = &encore_madc_data, + .usb = &encore_usb_data, + .gpio = &encore_gpio_data, + .keypad = &encore_kp_twl4030_data, + .vmmc1 = &encore_vmmc1, + .vdac = &encore_vdac, +}; + +static struct i2c_board_info __initdata encore_i2c_bus1_info[] = { + { + I2C_BOARD_INFO("tps65921", 0x48), + .flags = I2C_CLIENT_WAKE, + .irq = INT_34XX_SYS_NIRQ, + .platform_data = &encore_twldata, + }, +}; + +static struct i2c_board_info __initdata encore_i2c_bus2_info[] = { +}; + +#ifdef CONFIG_OMAP_MUX +static struct omap_board_mux board_mux[] __initdata = { + { .reg_offset = OMAP_MUX_TERMINATOR }, +}; +#else +#define board_mux NULL +#endif + +static struct omap_board_config_kernel encore_config[] __initdata = { +}; + +static void __init omap_i2c_init(void) +{ + omap_register_i2c_bus(1, 100, encore_i2c_bus1_info, + ARRAY_SIZE(encore_i2c_bus1_info)); + omap_register_i2c_bus(2, 400, encore_i2c_bus2_info, + ARRAY_SIZE(encore_i2c_bus2_info)); +} + +static void __init omap_encore_init(void) +{ + omap3_mux_init(board_mux, OMAP_PACKAGE_CBP); + omap_i2c_init(); + omap_serial_init(); + usb_musb_init(NULL); + + omap_board_config = encore_config; + omap_board_config_size = ARRAY_SIZE(encore_config); + + platform_add_devices(encore_devices, ARRAY_SIZE(encore_devices)); +} + +MACHINE_START(ENCORE, "encore") + .boot_params = 0x80000100, + .reserve = omap_reserve, + .map_io = omap3_map_io, + .init_early = omap_encore_init_early, + .init_irq = omap_init_irq, + .init_machine = omap_encore_init, + .timer = &omap_timer, +MACHINE_END diff --git a/arch/arm/plat-omap/include/plat/uncompress.h b/arch/arm/plat-omap/include/plat/uncompress.h index 30b891c..21c4ca9 100644 --- a/arch/arm/plat-omap/include/plat/uncompress.h +++ b/arch/arm/plat-omap/include/plat/uncompress.h @@ -151,6 +151,7 @@ static inline void __arch_decomp_setup(unsigned long arch_id) DEBUG_LL_OMAP3(3, cm_t3517); DEBUG_LL_OMAP3(3, craneboard); DEBUG_LL_OMAP3(3, devkit8000); + DEBUG_LL_OMAP3(3, encore); DEBUG_LL_OMAP3(3, igep0020); DEBUG_LL_OMAP3(3, igep0030); DEBUG_LL_OMAP3(3, nokia_rm680); -- 1.7.4.4 ^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH 1/3] Initial B&N Nook Color (encore) support. 2011-05-22 21:04 ` [PATCH 1/3] Initial B&N Nook Color (encore) support green at linuxhacker.ru @ 2011-05-24 7:07 ` Igor Grinberg 0 siblings, 0 replies; 10+ messages in thread From: Igor Grinberg @ 2011-05-24 7:07 UTC (permalink / raw) To: linux-arm-kernel Hi Oleg, Some comments below, mostly nitpicking, sorry... On 05/23/11 00:04, green at linuxhacker.ru wrote: > From: Oleg Drokin <green@linuxhacker.ru> > > Bare-bones board file, comes with serial console, gpio keys, > MMC/SDCard and USB (peripheral) support. > > Signed-off-by: Oleg Drokin <green@linuxhacker.ru> > --- > arch/arm/mach-omap2/Kconfig | 5 + > arch/arm/mach-omap2/Makefile | 2 + > arch/arm/mach-omap2/board-omap3encore.c | 350 ++++++++++++++++++++++++++ > arch/arm/plat-omap/include/plat/uncompress.h | 1 + > 4 files changed, 358 insertions(+), 0 deletions(-) > create mode 100644 arch/arm/mach-omap2/board-omap3encore.c > > diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig > index b997a35..5370561 100644 > --- a/arch/arm/mach-omap2/Kconfig > +++ b/arch/arm/mach-omap2/Kconfig > @@ -173,6 +173,11 @@ config MACH_OMAP3_TORPEDO > for full description please see the products webpage at > http://www.logicpd.com/products/development-kits/zoom-omap35x-torpedo-development-kit > > +config MACH_ENCORE > + bool "Barnes & Noble Encore (Nook Color)" > + depends on ARCH_OMAP3 > + select OMAP_PACKAGE_CBP > + > config MACH_OVERO > bool "Gumstix Overo board" > depends on ARCH_OMAP3 > diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile > index a0c2cae..619e5ca 100644 > --- a/arch/arm/mach-omap2/Makefile > +++ b/arch/arm/mach-omap2/Makefile > @@ -189,6 +189,8 @@ obj-$(CONFIG_MACH_OMAP3530_LV_SOM) += board-omap3logic.o \ > hsmmc.o > obj-$(CONFIG_MACH_OMAP3_TORPEDO) += board-omap3logic.o \ > hsmmc.o > +obj-$(CONFIG_MACH_ENCORE) += board-omap3encore.o \ > + hsmmc.o > obj-$(CONFIG_MACH_OVERO) += board-overo.o \ > hsmmc.o > obj-$(CONFIG_MACH_OMAP3EVM) += board-omap3evm.o \ > diff --git a/arch/arm/mach-omap2/board-omap3encore.c b/arch/arm/mach-omap2/board-omap3encore.c > new file mode 100644 > index 0000000..e4a0a98 > --- /dev/null > +++ b/arch/arm/mach-omap2/board-omap3encore.c > @@ -0,0 +1,350 @@ > +/* > + * Support for Barns&Noble Nook Color > + * > + * Loosely based on mach-omap2/board-zoom.c > + * Copyright (C) 2008-2010 Texas Instruments Inc. > + * > + * This program is free software; you can redistribute it and/or modify > + * it under the terms of the GNU General Public License version 2 as > + * published by the Free Software Foundation. > + * > + * May 2011 Oleg Drokin <green@linuxhacker.ru> - Port to 2.6.39 You'd better avoid versions in comments, this information can be mined from git log if needed. I don't really mind if you want to keep it, so do as you like. > + * > + */ > + > +#include <linux/gpio.h> > +#include <linux/gpio_keys.h> > +#include <linux/i2c/twl.h> > +#include <linux/regulator/machine.h> > + > +#include <asm/mach-types.h> > +#include <asm/mach/arch.h> > + > +#include <plat/common.h> > +#include <plat/usb.h> > +#include <plat/mux.h> > +#include <plat/mmc.h> > + > +#include "mux.h" > +#include "hsmmc.h" > +#include "sdram-hynix-h8mbx00u0mer-0em.h" > + > +/* Encore-specific device-info and i2c addresses. */ > +/* Battery, bus 1 */ > +#define MAX17042_I2C_SLAVE_ADDRESS 0x36 > +#define MAX17042_GPIO_FOR_IRQ 100 > + > +/*addition of MAXIM8903/TI GPIO mapping WRT schematics */ > +#define MAX8903_UOK_GPIO_FOR_IRQ 115 > +#define MAX8903_DOK_GPIO_FOR_IRQ 114 > +#define MAX8903_GPIO_CHG_EN 110 > +#define MAX8903_GPIO_CHG_STATUS 111 > +#define MAX8903_GPIO_CHG_FLT 101 > +#define MAX8903_GPIO_CHG_IUSB 102 > +#define MAX8903_GPIO_CHG_USUS 104 > +#define MAX8903_GPIO_CHG_ILM 61 > + > +/* TI WLAN */ > +#define ENCORE_WIFI_PMENA_GPIO 22 > +#define ENCORE_WIFI_IRQ_GPIO 15 > +#define ENCORE_WIFI_EN_POW 16 > + > +/* Accelerometer i2c bus 1*/ > +#define KXTF9_I2C_SLAVE_ADDRESS 0x0F > +#define KXTF9_GPIO_FOR_PWR 34 > +#define KXTF9_GPIO_FOR_IRQ 113 > + > +/* Touch screen i2c bus 2*/ > +#define CYTTSP_I2C_SLAVEADDRESS 34 > +#define ENCORE_CYTTSP_GPIO 99 > +#define ENCORE_CYTTSP_RESET_GPIO 46 > + > +/* Audio codec, i2c bus 2 */ > +#define AUDIO_CODEC_POWER_ENABLE_GPIO 103 > +#define AUDIO_CODEC_RESET_GPIO 37 > +#define AUDIO_CODEC_IRQ_GPIO 59 > +#define AIC3100_I2CSLAVEADDRESS 0x18 > + > + > +/* Different HW revisions */ > +#define BOARD_ENCORE_REV_EVT1A 0x1 > +#define BOARD_ENCORE_REV_EVT1B 0x2 > +#define BOARD_ENCORE_REV_EVT2 0x3 > +#define BOARD_ENCORE_REV_DVT 0x4 > +#define BOARD_ENCORE_REV_PVT 0x5 > +#define BOARD_ENCORE_REV_UNKNOWN 0x6 > + > +static inline int is_encore_board_evt2(void) > +{ > + return system_rev >= BOARD_ENCORE_REV_EVT2; > +} > + > +static inline int is_encore_board_evt1b(void) > +{ > + return system_rev == BOARD_ENCORE_REV_EVT1B; > +} > + > +static int encore_twl4030_keymap[] = { > + KEY(1, 0, KEY_VOLUMEUP), > + KEY(2, 0, KEY_VOLUMEDOWN), > +}; > + > +static struct matrix_keymap_data encore_twl4030_keymap_data = { > + .keymap = encore_twl4030_keymap, > + .keymap_size = ARRAY_SIZE(encore_twl4030_keymap), > +}; > + > +static struct twl4030_keypad_data encore_kp_twl4030_data = { > + .rows = 8, > + .cols = 8, > + .keymap_data = &encore_twl4030_keymap_data, > + .rep = 1, > +}; > + > +/* HOME key code for HW > EVT2A */ > +static struct gpio_keys_button encore_gpio_buttons[] = { > + { > + .code = KEY_POWER, > + .gpio = 14, > + .desc = "POWER", > + .active_low = 0, > + .wakeup = 1, > + }, > + { > + .code = KEY_HOME, > + .gpio = 48, > + .desc = "HOME", > + .active_low = 1, > + .wakeup = 1, > + }, > +}; > + > +static struct gpio_keys_platform_data encore_gpio_key_info = { > + .buttons = encore_gpio_buttons, > + .nbuttons = ARRAY_SIZE(encore_gpio_buttons), > +}; > + > +static struct platform_device encore_keys_gpio = { > + .name = "gpio-keys", > + .id = -1, > + .dev = { > + .platform_data = &encore_gpio_key_info, > + }, > +}; > + > +static struct platform_device *encore_devices[] __initdata = { > + &encore_keys_gpio, > +}; > + > +static void __init omap_encore_init_early(void) > +{ > + omap2_init_common_infrastructure(); > + omap2_init_common_devices(h8mbx00u0mer0em_sdrc_params, > + h8mbx00u0mer0em_sdrc_params); > +} > + > +static struct twl4030_usb_data encore_usb_data = { > + .usb_mode = T2_USB_MODE_ULPI, > +}; > + > +static struct regulator_consumer_supply encore_vmmc1_supply = { > + .supply = "vmmc", > + .dev_name = "omap_hsmmc.0" > +}; Why not REGULATOR_SUPPLY? > + > +static struct regulator_consumer_supply encore_vdda_dac_supply = > + REGULATOR_SUPPLY("vdda_dac", "omapdss_venc"); > + > +/* VMMC1 for OMAP VDD_MMC1 (i/o) and MMC1 card */ > +static struct regulator_init_data encore_vmmc1 = { > + .constraints = { > + .min_uV = 1850000, > + .max_uV = 3150000, > + .valid_modes_mask = REGULATOR_MODE_NORMAL > + | REGULATOR_MODE_STANDBY, > + .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE > + | REGULATOR_CHANGE_MODE > + | REGULATOR_CHANGE_STATUS, > + }, > + .num_consumer_supplies = 1, > + .consumer_supplies = &encore_vmmc1_supply, > +}; > + > +static struct regulator_init_data encore_vdac = { > + .constraints = { > + .min_uV = 1800000, > + .max_uV = 1800000, > + .valid_modes_mask = REGULATOR_MODE_NORMAL > + | REGULATOR_MODE_STANDBY, > + .valid_ops_mask = REGULATOR_CHANGE_MODE > + | REGULATOR_CHANGE_STATUS, > + }, > + .num_consumer_supplies = 1, > + .consumer_supplies = &encore_vdda_dac_supply, > +}; > + > +/* > + * The order is reverted in this table so that internal eMMC is presented > + * as first mmc card for compatibility with existing installations and > + * for common sense reasons > + */ > +static struct omap2_hsmmc_info mmc[] __initdata = { > + { > + .name = "internal", > + .mmc = 2, > + .caps = MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA, > + .gpio_cd = -EINVAL, > + .gpio_wp = -EINVAL, > + .nonremovable = true, > + .power_saving = true, > + .ocr_mask = MMC_VDD_165_195, /* 1.85V */ > + }, > + { > + .name = "external", > + .mmc = 1, > + .caps = MMC_CAP_4_BIT_DATA, > + .gpio_cd = -EINVAL, > + .gpio_wp = -EINVAL, > + .power_saving = true, > + }, > + { > + .name = "internal", > + .mmc = 3, > + .caps = MMC_CAP_4_BIT_DATA, > + .gpio_cd = -EINVAL, > + .gpio_wp = -EINVAL, > + .nonremovable = true, > + .power_saving = true, > + }, > + {} /* Terminator */ > +}; > + > +static int encore_hsmmc_card_detect(struct device *dev, int slot) > +{ > + struct omap_mmc_platform_data *mmc = dev->platform_data; > + > + /* Encore board EVT2 and later has pin high when card is present */ > + return gpio_get_value_cansleep(mmc->slots[0].switch_pin); > +} > + > +static int encore_twl4030_hsmmc_late_init(struct device *dev) > +{ > + int ret = 0; > + struct platform_device *pdev = container_of(dev, > + struct platform_device, dev); > + struct omap_mmc_platform_data *pdata = dev->platform_data; > + > + if (is_encore_board_evt2()) { > + /* Setting MMC1 (external) Card detect */ > + if (pdev->id == 0) > + pdata->slots[0].card_detect = encore_hsmmc_card_detect; > + } > + > + return ret; > +} > + > +static __init void encore_hsmmc_set_late_init(struct device *dev) > +{ > + struct omap_mmc_platform_data *pdata; > + > + /* dev can be null if CONFIG_MMC_OMAP_HS is not set */ > + if (!dev) > + return; > + > + pdata = dev->platform_data; > + pdata->init = encore_twl4030_hsmmc_late_init; > +} > + > +static int __ref encore_twl_gpio_setup(struct device *dev, > + unsigned gpio, unsigned ngpio) > +{ > + struct omap2_hsmmc_info *c; > + /* > + * gpio + 0 is "mmc0_cd" (input/IRQ), > + * gpio + 1 is "mmc1_cd" (input/IRQ) > + */ > + mmc[1].gpio_cd = gpio + 0; > + mmc[0].gpio_cd = gpio + 1; > + omap2_hsmmc_init(mmc); > + for (c = mmc; c->mmc; c++) > + encore_hsmmc_set_late_init(c->dev); > + > + return 0; > +} > + > +static struct twl4030_gpio_platform_data encore_gpio_data = { > + .gpio_base = OMAP_MAX_GPIO_LINES, > + .irq_base = TWL4030_GPIO_IRQ_BASE, > + .irq_end = TWL4030_GPIO_IRQ_END, > + .setup = encore_twl_gpio_setup, > +}; > + > +static struct twl4030_madc_platform_data encore_madc_data = { > + .irq_line = 1, > +}; > + > +static struct twl4030_platform_data __refdata encore_twldata = { > + .irq_base = TWL4030_IRQ_BASE, > + .irq_end = TWL4030_IRQ_END, > + > + .madc = &encore_madc_data, > + .usb = &encore_usb_data, > + .gpio = &encore_gpio_data, > + .keypad = &encore_kp_twl4030_data, > + .vmmc1 = &encore_vmmc1, > + .vdac = &encore_vdac, > +}; > + > +static struct i2c_board_info __initdata encore_i2c_bus1_info[] = { > + { > + I2C_BOARD_INFO("tps65921", 0x48), > + .flags = I2C_CLIENT_WAKE, > + .irq = INT_34XX_SYS_NIRQ, > + .platform_data = &encore_twldata, > + }, > +}; > + > +static struct i2c_board_info __initdata encore_i2c_bus2_info[] = { > +}; > + > +#ifdef CONFIG_OMAP_MUX > +static struct omap_board_mux board_mux[] __initdata = { > + { .reg_offset = OMAP_MUX_TERMINATOR }, > +}; > +#else > +#define board_mux NULL I don't insist, but you don't need the #else for board_mux. mux.h already provides you a stub in case !CONFIG_OMAP_MUX. > +#endif > + > +static struct omap_board_config_kernel encore_config[] __initdata = { > +}; > + > +static void __init omap_i2c_init(void) > +{ > + omap_register_i2c_bus(1, 100, encore_i2c_bus1_info, > + ARRAY_SIZE(encore_i2c_bus1_info)); > + omap_register_i2c_bus(2, 400, encore_i2c_bus2_info, > + ARRAY_SIZE(encore_i2c_bus2_info)); > +} > + > +static void __init omap_encore_init(void) > +{ > + omap3_mux_init(board_mux, OMAP_PACKAGE_CBP); > + omap_i2c_init(); > + omap_serial_init(); > + usb_musb_init(NULL); > + > + omap_board_config = encore_config; > + omap_board_config_size = ARRAY_SIZE(encore_config); > + > + platform_add_devices(encore_devices, ARRAY_SIZE(encore_devices)); > +} > + > +MACHINE_START(ENCORE, "encore") > + .boot_params = 0x80000100, > + .reserve = omap_reserve, > + .map_io = omap3_map_io, > + .init_early = omap_encore_init_early, > + .init_irq = omap_init_irq, > + .init_machine = omap_encore_init, > + .timer = &omap_timer, > +MACHINE_END > diff --git a/arch/arm/plat-omap/include/plat/uncompress.h b/arch/arm/plat-omap/include/plat/uncompress.h > index 30b891c..21c4ca9 100644 > --- a/arch/arm/plat-omap/include/plat/uncompress.h > +++ b/arch/arm/plat-omap/include/plat/uncompress.h > @@ -151,6 +151,7 @@ static inline void __arch_decomp_setup(unsigned long arch_id) > DEBUG_LL_OMAP3(3, cm_t3517); > DEBUG_LL_OMAP3(3, craneboard); > DEBUG_LL_OMAP3(3, devkit8000); > + DEBUG_LL_OMAP3(3, encore); > DEBUG_LL_OMAP3(3, igep0020); > DEBUG_LL_OMAP3(3, igep0030); > DEBUG_LL_OMAP3(3, nokia_rm680); -- Regards, Igor. ^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH 2/3] Add tps65921 chip 2011-05-22 21:04 Initial B&N Nook Color support, take four green at linuxhacker.ru 2011-05-22 21:04 ` [PATCH 1/3] Initial B&N Nook Color (encore) support green at linuxhacker.ru @ 2011-05-22 21:04 ` green at linuxhacker.ru 2011-05-22 21:04 ` [PATCH 3/3] Update Nook Color machine 3284 to common Encore name green at linuxhacker.ru ` (2 subsequent siblings) 4 siblings, 0 replies; 10+ messages in thread From: green at linuxhacker.ru @ 2011-05-22 21:04 UTC (permalink / raw) To: linux-arm-kernel From: Oleg Drokin <green@linuxhacker.ru> Very similar to TPS65920 List of differences: http://www.ti.com/litv/pdf/swcu066b CC: sameo at linux.intel.com Signed-off-by: Oleg Drokin <green@linuxhacker.ru> --- drivers/mfd/twl-core.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/drivers/mfd/twl-core.c b/drivers/mfd/twl-core.c index 960b5be..3daebcc 100644 --- a/drivers/mfd/twl-core.c +++ b/drivers/mfd/twl-core.c @@ -1107,6 +1107,8 @@ static const struct i2c_device_id twl_ids[] = { { "tps65950", 0 }, /* catalog version of twl5030 */ { "tps65930", TPS_SUBSET }, /* fewer LDOs and DACs; no charger */ { "tps65920", TPS_SUBSET }, /* fewer LDOs; no codec or charger */ + { "tps65921", TPS_SUBSET }, /* fewer LDOs; no codec, no LED + and vibrator. Charger in USB module*/ { "twl6030", TWL6030_CLASS }, /* "Phoenix power chip" */ { /* end of list */ }, }; -- 1.7.4.4 ^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH 3/3] Update Nook Color machine 3284 to common Encore name. 2011-05-22 21:04 Initial B&N Nook Color support, take four green at linuxhacker.ru 2011-05-22 21:04 ` [PATCH 1/3] Initial B&N Nook Color (encore) support green at linuxhacker.ru 2011-05-22 21:04 ` [PATCH 2/3] Add tps65921 chip green at linuxhacker.ru @ 2011-05-22 21:04 ` green at linuxhacker.ru 2011-05-24 0:48 ` Initial B&N Nook Color support, take four Theodore Kilgore 2011-05-24 6:19 ` Igor Grinberg 4 siblings, 0 replies; 10+ messages in thread From: green at linuxhacker.ru @ 2011-05-22 21:04 UTC (permalink / raw) To: linux-arm-kernel From: Oleg Drokin <green@linuxhacker.ru> Nachine database already updated: http://www.arm.linux.org.uk/developer/machines/list.php?id=3284 Signed-off-by: Oleg Drokin <green@linuxhacker.ru> --- arch/arm/tools/mach-types | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/arch/arm/tools/mach-types b/arch/arm/tools/mach-types index 7ca41f0..2f0db3e 100644 --- a/arch/arm/tools/mach-types +++ b/arch/arm/tools/mach-types @@ -962,7 +962,7 @@ omapl138_case_a3 MACH_OMAPL138_CASE_A3 OMAPL138_CASE_A3 3280 uemd MACH_UEMD UEMD 3281 ccwmx51mut MACH_CCWMX51MUT CCWMX51MUT 3282 rockhopper MACH_ROCKHOPPER ROCKHOPPER 3283 -nookcolor MACH_NOOKCOLOR NOOKCOLOR 3284 +encore MACH_ENCORE ENCORE 3284 hkdkc100 MACH_HKDKC100 HKDKC100 3285 ts42xx MACH_TS42XX TS42XX 3286 aebl MACH_AEBL AEBL 3287 -- 1.7.4.4 ^ permalink raw reply related [flat|nested] 10+ messages in thread
* Initial B&N Nook Color support, take four 2011-05-22 21:04 Initial B&N Nook Color support, take four green at linuxhacker.ru ` (2 preceding siblings ...) 2011-05-22 21:04 ` [PATCH 3/3] Update Nook Color machine 3284 to common Encore name green at linuxhacker.ru @ 2011-05-24 0:48 ` Theodore Kilgore 2011-05-24 0:57 ` Oleg Drokin 2011-05-24 6:19 ` Igor Grinberg 4 siblings, 1 reply; 10+ messages in thread From: Theodore Kilgore @ 2011-05-24 0:48 UTC (permalink / raw) To: linux-arm-kernel On Sun, 22 May 2011, green at linuxhacker.ru wrote: > Hello! > > Next attempt at B&N Nook Color board file submission. > USB peripheral mode is fully operational as is serial console and > MMC/SDCard. [snip] Thank you very much for this work. I am considering the idea of buying one of these Nook Color things; at least it would get good company from a couple of other half-finished ARM-type projects lying around. But, most particularly, I would be interested to know exactly what is meant by "USB peripheral mode is fully operational" because one of the things I would wish to be able to do with the Nook is to hook up a keyboard or, alternatively, a USB VGA adapter. Thus, do you mean exactly that the Nook is supported as a client when hooked by USB to another computer? Or does this mean that there actually is hope of having it act as a USB host? Theodore Kilgore ^ permalink raw reply [flat|nested] 10+ messages in thread
* Initial B&N Nook Color support, take four 2011-05-24 0:48 ` Initial B&N Nook Color support, take four Theodore Kilgore @ 2011-05-24 0:57 ` Oleg Drokin 0 siblings, 0 replies; 10+ messages in thread From: Oleg Drokin @ 2011-05-24 0:57 UTC (permalink / raw) To: linux-arm-kernel Hello! On May 23, 2011, at 8:48 PM, Theodore Kilgore wrote: > Thank you very much for this work. I am considering the idea of buying one > of these Nook Color things; at least it would get good company from a > couple of other half-finished ARM-type projects lying around. But, most > particularly, I would be interested to know exactly what is meant by > > "USB peripheral mode is fully operational" > > because one of the things I would wish to be able to do with the Nook is > to hook up a keyboard or, alternatively, a USB VGA adapter. Thus, do you > mean exactly that the Nook is supported as a client when hooked by USB to > another computer? Or does this mean that there actually is hope of having > it act as a USB host? It's usb client (peripheral). The host mode is not functional and while there is a slim chance it might work, that's not going to be pretty in the end. If you need USB host, B&N is poised to announce new model tomorrow that will have faster CPU and usb host support. Bye, Oleg ^ permalink raw reply [flat|nested] 10+ messages in thread
* Initial B&N Nook Color support, take four 2011-05-22 21:04 Initial B&N Nook Color support, take four green at linuxhacker.ru ` (3 preceding siblings ...) 2011-05-24 0:48 ` Initial B&N Nook Color support, take four Theodore Kilgore @ 2011-05-24 6:19 ` Igor Grinberg 4 siblings, 0 replies; 10+ messages in thread From: Igor Grinberg @ 2011-05-24 6:19 UTC (permalink / raw) To: linux-arm-kernel On 05/23/11 00:04, green at linuxhacker.ru wrote: > Hello! > > Next attempt at B&N Nook Color board file submission. > USB peripheral mode is fully operational as is serial console and > MMC/SDCard. > > Changes > since v3: > Separated mach-types change into a separate patch (already got RMK approval) > Dramatically cut number of includes in the board file again. > No longer set voltage regulator dev, just device name in the supply. > Style fixes > Serial in uncompress.h sorted by name > Corrected MUX package to CBP in board file. > omap_i2c_init now has no return since it's unused anyway. > Fixed keypad definition. > > since v2: > rebased on devel-cleanup branch > > since v1: > Threw away all the android stuff as suggested > Cleaned up voltage regulators and removed the ones our twl chip actually > does not have > Changed the split of the patches to board file + twl update > > Bye, > Oleg Good cover letter, though keep in mind that making it long long, can hit people laziness ;) -- Regards, Igor. ^ permalink raw reply [flat|nested] 10+ messages in thread
[parent not found: <1308066307-415-1-git-send-email-green@linuxhacker.ru>]
[parent not found: <1308066307-415-4-git-send-email-green@linuxhacker.ru>]
* [PATCH 3/3] Update Nook Color machine 3284 to common Encore name. [not found] ` <1308066307-415-4-git-send-email-green@linuxhacker.ru> @ 2011-06-30 13:35 ` Tony Lindgren 2011-07-11 15:21 ` Russell King - ARM Linux 0 siblings, 1 reply; 10+ messages in thread From: Tony Lindgren @ 2011-06-30 13:35 UTC (permalink / raw) To: linux-arm-kernel * green at linuxhacker.ru <green@linuxhacker.ru> [110614 08:42]: > From: Oleg Drokin <green@linuxhacker.ru> > > Machine database already updated: > http://www.arm.linux.org.uk/developer/machines/list.php?id=3284 > > Signed-off-by: Oleg Drokin <green@linuxhacker.ru> Russell, do have some immutable branch containing the mach-types changes that I could pull for my devel-board branch for this? If you want me to apply this one along with the related board-*.c changes please ack. Regards, Tony > --- > arch/arm/tools/mach-types | 2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > > diff --git a/arch/arm/tools/mach-types b/arch/arm/tools/mach-types > index 3b3776d..fff68d0 100644 > --- a/arch/arm/tools/mach-types > +++ b/arch/arm/tools/mach-types > @@ -910,7 +910,7 @@ omapl138_case_a3 MACH_OMAPL138_CASE_A3 OMAPL138_CASE_A3 3280 > uemd MACH_UEMD UEMD 3281 > ccwmx51mut MACH_CCWMX51MUT CCWMX51MUT 3282 > rockhopper MACH_ROCKHOPPER ROCKHOPPER 3283 > -nookcolor MACH_NOOKCOLOR NOOKCOLOR 3284 > +encore MACH_ENCORE ENCORE 3284 > hkdkc100 MACH_HKDKC100 HKDKC100 3285 > ts42xx MACH_TS42XX TS42XX 3286 > aebl MACH_AEBL AEBL 3287 > -- > 1.7.4.4 > > -- > To unsubscribe from this list: send the line "unsubscribe linux-omap" in > the body of a message to majordomo at vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH 3/3] Update Nook Color machine 3284 to common Encore name. 2011-06-30 13:35 ` [PATCH 3/3] Update Nook Color machine 3284 to common Encore name Tony Lindgren @ 2011-07-11 15:21 ` Russell King - ARM Linux 0 siblings, 0 replies; 10+ messages in thread From: Russell King - ARM Linux @ 2011-07-11 15:21 UTC (permalink / raw) To: linux-arm-kernel On Thu, Jun 30, 2011 at 06:35:38AM -0700, Tony Lindgren wrote: > * green at linuxhacker.ru <green@linuxhacker.ru> [110614 08:42]: > > From: Oleg Drokin <green@linuxhacker.ru> > > > > Machine database already updated: > > http://www.arm.linux.org.uk/developer/machines/list.php?id=3284 > > > > Signed-off-by: Oleg Drokin <green@linuxhacker.ru> > > Russell, do have some immutable branch containing the mach-types changes > that I could pull for my devel-board branch for this? > > If you want me to apply this one along with the related board-*.c > changes please ack. Acked-by: Russell King <rmk+kernel@arm.linux.org.uk> ^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2011-07-11 15:21 UTC | newest] Thread overview: 10+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2011-05-22 21:04 Initial B&N Nook Color support, take four green at linuxhacker.ru 2011-05-22 21:04 ` [PATCH 1/3] Initial B&N Nook Color (encore) support green at linuxhacker.ru 2011-05-24 7:07 ` Igor Grinberg 2011-05-22 21:04 ` [PATCH 2/3] Add tps65921 chip green at linuxhacker.ru 2011-05-22 21:04 ` [PATCH 3/3] Update Nook Color machine 3284 to common Encore name green at linuxhacker.ru 2011-05-24 0:48 ` Initial B&N Nook Color support, take four Theodore Kilgore 2011-05-24 0:57 ` Oleg Drokin 2011-05-24 6:19 ` Igor Grinberg [not found] <1308066307-415-1-git-send-email-green@linuxhacker.ru> [not found] ` <1308066307-415-4-git-send-email-green@linuxhacker.ru> 2011-06-30 13:35 ` [PATCH 3/3] Update Nook Color machine 3284 to common Encore name Tony Lindgren 2011-07-11 15:21 ` Russell King - ARM Linux
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).