[U-Boot] [PATCH 00/12] LG Optimus Black (P970) codename sniper support series (and driver-model issue)

This patch series adds support for the LG Optimus Black (P970) codename sniper, see the commit that introduces the board and config files for a short description of the device.
This should be applied on top of patches that I have submitted to the list but were not merged yet, especially: * omap-common: Common boot code OMAP3 support and cleanup * omap3: CONFIG_REVISION_TAG ifdef check for get_board_rev
At this point, support as submitted as this point is minimalistic. It is not ready for daily use, but introduces the basic elements that are needed to have a sane base upon which the rest of the device support will be introduced.
In particular, the device is currently headless, mainly because the display backlight is not enabled. Other important features such as the MUIC are not enabled, so USB will only work in U-Boot when the device boots with an USB cable already attached. In addition, the external MMC is not supported in U-Boot either, as it requires support for a separate PMIC.
A work in progress commit introduces support for (some of) those bits in a dirty and non-mergeable way is available at: http://git.code.paulk.fr/gitweb/?p=u-boot.git;a=shortlog;h=refs/heads/sniper...
Having those bits written correctly would require writing some drivers using the power framework. In the long run, those would have to use the driver model API, which would involve converting the I2C driver to DM as well. This is too much overhead for now, but it will be done eventually.
The main problem I see with doing that work now is that I2C DM seems to heavily rely on device-tree. Other parts of the OMAP platform support were converted to DM but use platform data defined in each board. That solution looks good to me, but doesn't work with I2C. Thus, we could either modify the I2C driver to cope with the lack of device-tree or make the use of device-tree a hard requirement for driver model, implying that each omap3 boards would have to provide a device-tree file as well.
Both solutions look good to me and I'll let experts decide what to do. Either way, I need to know what the right solution to this problem is to be able to move forward.

This adds support for powering off (the omap3 SoC) from the twl4030. This is especially useful when the kernel does not actually power off the device using this method but reboots and leaves it up to the bootloader to actually turn the power off. --- drivers/power/twl4030.c | 60 +++++++++++++++++++++++++++++++++++++++++++++++++ include/twl4030.h | 32 +++++++++++++++++++------- 2 files changed, 84 insertions(+), 8 deletions(-)
diff --git a/drivers/power/twl4030.c b/drivers/power/twl4030.c index 7f1fdd1..8866bf1 100644 --- a/drivers/power/twl4030.c +++ b/drivers/power/twl4030.c @@ -46,6 +46,66 @@ void twl4030_power_reset_init(void) }
/* + * Power off + */ +void twl4030_power_off(void) +{ + u8 data; + + /* PM master unlock (CFG and TST keys) */ + + data = 0xCE; + twl4030_i2c_write_u8(TWL4030_CHIP_PM_MASTER, + TWL4030_PM_MASTER_PROTECT_KEY, data); + data = 0xEC; + twl4030_i2c_write_u8(TWL4030_CHIP_PM_MASTER, + TWL4030_PM_MASTER_PROTECT_KEY, data); + + /* VBAT start disable */ + + twl4030_i2c_read_u8(TWL4030_CHIP_PM_MASTER, + TWL4030_PM_MASTER_CFG_P1_TRANSITION, &data); + data &= ~TWL4030_PM_MASTER_CFG_TRANSITION_STARTON_VBAT; + twl4030_i2c_write_u8(TWL4030_CHIP_PM_MASTER, + TWL4030_PM_MASTER_CFG_P1_TRANSITION, data); + + twl4030_i2c_read_u8(TWL4030_CHIP_PM_MASTER, + TWL4030_PM_MASTER_CFG_P2_TRANSITION, &data); + data &= ~TWL4030_PM_MASTER_CFG_TRANSITION_STARTON_VBAT; + twl4030_i2c_write_u8(TWL4030_CHIP_PM_MASTER, + TWL4030_PM_MASTER_CFG_P2_TRANSITION, data); + + twl4030_i2c_read_u8(TWL4030_CHIP_PM_MASTER, + TWL4030_PM_MASTER_CFG_P3_TRANSITION, &data); + data &= ~TWL4030_PM_MASTER_CFG_TRANSITION_STARTON_VBAT; + twl4030_i2c_write_u8(TWL4030_CHIP_PM_MASTER, + TWL4030_PM_MASTER_CFG_P3_TRANSITION, data); + + /* High jitter for PWRANA2 */ + + twl4030_i2c_read_u8(TWL4030_CHIP_PM_MASTER, + TWL4030_PM_MASTER_CFG_PWRANA2, &data); + data &= ~(TWL4030_PM_MASTER_CFG_PWRANA2_LOJIT0_LOWV | + TWL4030_PM_MASTER_CFG_PWRANA2_LOJIT1_LOWV); + twl4030_i2c_write_u8(TWL4030_CHIP_PM_MASTER, + TWL4030_PM_MASTER_CFG_PWRANA2, data); + + /* PM master lock */ + + data = 0xFF; + twl4030_i2c_write_u8(TWL4030_CHIP_PM_MASTER, + TWL4030_PM_MASTER_PROTECT_KEY, data); + + /* Power off */ + + twl4030_i2c_read_u8(TWL4030_CHIP_PM_MASTER, + TWL4030_PM_MASTER_P1_SW_EVENTS, &data); + data |= TWL4030_PM_MASTER_SW_EVENTS_DEVOFF; + twl4030_i2c_write_u8(TWL4030_CHIP_PM_MASTER, + TWL4030_PM_MASTER_P1_SW_EVENTS, data); +} + +/* * Set Device Group and Voltage */ void twl4030_pmrecv_vsel_cfg(u8 vsel_reg, u8 vsel_val, diff --git a/include/twl4030.h b/include/twl4030.h index 50f8da8..2d0ca18 100644 --- a/include/twl4030.h +++ b/include/twl4030.h @@ -129,14 +129,6 @@ #define TWL4030_PM_MASTER_BB_CFG 0x6D #define TWL4030_PM_MASTER_MISC_TST 0x6E #define TWL4030_PM_MASTER_TRIM1 0x6F -/* P[1-3]_SW_EVENTS */ -#define TWL4030_PM_MASTER_SW_EVENTS_STOPON_PWRON (1 << 6) -#define TWL4030_PM_MASTER_SW_EVENTS_STOPON_SYSEN (1 << 5) -#define TWL4030_PM_MASTER_SW_EVENTS_ENABLE_WARMRESET (1 << 4) -#define TWL4030_PM_MASTER_SW_EVENTS_LVL_WAKEUP (1 << 3) -#define TWL4030_PM_MASTER_SW_EVENTS_DEVACT (1 << 2) -#define TWL4030_PM_MASTER_SW_EVENTS_DEVSLP (1 << 1) -#define TWL4030_PM_MASTER_SW_EVENTS_DEVOFF (1 << 0)
/* Power bus message definitions */
@@ -207,6 +199,28 @@ /* Power Reference */ #define RES_Main_Ref 28
+/* P[1-3]_SW_EVENTS */ +#define TWL4030_PM_MASTER_SW_EVENTS_STOPON_PWRON (1 << 6) +#define TWL4030_PM_MASTER_SW_EVENTS_STOPON_SYSEN (1 << 5) +#define TWL4030_PM_MASTER_SW_EVENTS_ENABLE_WARMRESET (1 << 4) +#define TWL4030_PM_MASTER_SW_EVENTS_LVL_WAKEUP (1 << 3) +#define TWL4030_PM_MASTER_SW_EVENTS_DEVACT (1 << 2) +#define TWL4030_PM_MASTER_SW_EVENTS_DEVSLP (1 << 1) +#define TWL4030_PM_MASTER_SW_EVENTS_DEVOFF (1 << 0) + +/* Power transition */ +#define TWL4030_PM_MASTER_CFG_TRANSITION_STARTON_PWON (1 << 0) +#define TWL4030_PM_MASTER_CFG_TRANSITION_STARTON_CHG (1 << 1) +#define TWL4030_PM_MASTER_CFG_TRANSITION_STARTON_USB (1 << 2) +#define TWL4030_PM_MASTER_CFG_TRANSITION_STARTON_RTC (1 << 3) +#define TWL4030_PM_MASTER_CFG_TRANSITION_STARTON_VBAT (1 << 4) +#define TWL4030_PM_MASTER_CFG_TRANSITION_STARTON_VBUS (1 << 5) +#define TWL4030_PM_MASTER_CFG_TRANSITION_STARTON_SWBUG (1 << 7) + +/* PWRANA2 */ +#define TWL4030_PM_MASTER_CFG_PWRANA2_LOJIT0_LOWV (1 << 1) +#define TWL4030_PM_MASTER_CFG_PWRANA2_LOJIT1_LOWV (1 << 2) + #define TOTAL_RESOURCES 28 /* * Power Bus Message Format ... these can be sent individually by Linux, @@ -645,6 +659,8 @@ static inline int twl4030_i2c_read_u8(u8 chip_no, u8 reg, u8 *val)
/* For hardware resetting */ void twl4030_power_reset_init(void); +/* For power off */ +void twl4030_power_off(void); /* For setting device group and voltage */ void twl4030_pmrecv_vsel_cfg(u8 vsel_reg, u8 vsel_val, u8 dev_grp, u8 dev_grp_sel);

On Mon, Jul 20, 2015 at 03:17:07PM +0200, Paul Kocialkowski wrote:
This adds support for powering off (the omap3 SoC) from the twl4030. This is especially useful when the kernel does not actually power off the device using this method but reboots and leaves it up to the bootloader to actually turn the power off.
Reviewed-by: Tom Rini trini@konsulko.com

Le lundi 03 août 2015 à 22:07 -0400, Tom Rini a écrit :
On Mon, Jul 20, 2015 at 03:17:07PM +0200, Paul Kocialkowski wrote:
This adds support for powering off (the omap3 SoC) from the twl4030. This is especially useful when the kernel does not actually power off the device using this method but reboots and leaves it up to the bootloader to actually turn the power off.
Reviewed-by: Tom Rini trini@konsulko.com
Signed-off-by: Paul Kocialkowski contact@paulk.fr

On Mon, Jul 20, 2015 at 10:17 AM, Paul Kocialkowski contact@paulk.fr wrote:
This adds support for powering off (the omap3 SoC) from the twl4030. This is especially useful when the kernel does not actually power off the device using this method but reboots and leaves it up to the bootloader to actually turn the power off.
Signed-off-by tag is missing.

Hello Paul,
On 07/20/2015 03:17 PM, Paul Kocialkowski wrote:
This adds support for powering off (the omap3 SoC) from the twl4030. This is especially useful when the kernel does not actually power off the device using this method but reboots and leaves it up to the bootloader to actually turn the power off.
drivers/power/twl4030.c | 60 +++++++++++++++++++++++++++++++++++++++++++++++++ include/twl4030.h | 32 +++++++++++++++++++------- 2 files changed, 84 insertions(+), 8 deletions(-)
Acked-by: Przemyslaw Marczak p.marczak@samsung.com
Best regards,

On Mon, Jul 20, 2015 at 03:17:07PM +0200, Paul Kocialkowski wrote:
This adds support for powering off (the omap3 SoC) from the twl4030. This is especially useful when the kernel does not actually power off the device using this method but reboots and leaves it up to the bootloader to actually turn the power off. Reviewed-by: Tom Rini trini@konsulko.com Acked-by: Przemyslaw Marczak p.marczak@samsung.com Signed-off-by: Paul Kocialkowski contact@paulk.fr
Applied to u-boot/master, thanks!

This adds support for detecting a few inputs exported by the TWL4030. Currently-supported inputs are the power button, USB and charger presence. --- drivers/input/Makefile | 1 + drivers/input/twl4030.c | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ include/twl4030.h | 14 ++++++++++++++ 3 files changed, 64 insertions(+) create mode 100644 drivers/input/twl4030.c
diff --git a/drivers/input/Makefile b/drivers/input/Makefile index a8e9be2..24fec9b 100644 --- a/drivers/input/Makefile +++ b/drivers/input/Makefile @@ -7,6 +7,7 @@
obj-$(CONFIG_I8042_KBD) += i8042.o obj-$(CONFIG_TEGRA_KEYBOARD) += tegra-kbc.o +obj-$(CONFIG_TWL4030_INPUT) += twl4030.o obj-$(CONFIG_CROS_EC_KEYB) += cros_ec_keyb.o ifdef CONFIG_PS2KBD obj-y += keyboard.o pc_keyb.o diff --git a/drivers/input/twl4030.c b/drivers/input/twl4030.c new file mode 100644 index 0000000..a5ded35 --- /dev/null +++ b/drivers/input/twl4030.c @@ -0,0 +1,49 @@ +/* + * TWL4030 input + * + * Copyright (C) 2015 Paul Kocialkowski contact@paulk.fr + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +#include <twl4030.h> + +int twl4030_input_power_button(void) +{ + u8 data; + + twl4030_i2c_read_u8(TWL4030_CHIP_PM_MASTER, + TWL4030_PM_MASTER_STS_HW_CONDITIONS, &data); + + if (data & TWL4030_PM_MASTER_STS_HW_CONDITIONS_PWON) + return 1; + + return 0; +} + +int twl4030_input_charger(void) +{ + u8 data; + + twl4030_i2c_read_u8(TWL4030_CHIP_PM_MASTER, + TWL4030_PM_MASTER_STS_HW_CONDITIONS, &data); + + if (data & TWL4030_PM_MASTER_STS_HW_CONDITIONS_CHG) + return 1; + + return 0; +} + +int twl4030_input_usb(void) +{ + u8 data; + + twl4030_i2c_read_u8(TWL4030_CHIP_PM_MASTER, + TWL4030_PM_MASTER_STS_HW_CONDITIONS, &data); + + if (data & TWL4030_PM_MASTER_STS_HW_CONDITIONS_USB || + data & TWL4030_PM_MASTER_STS_HW_CONDITIONS_VBUS) + return 1; + + return 0; +} diff --git a/include/twl4030.h b/include/twl4030.h index 2d0ca18..a4d5fbd 100644 --- a/include/twl4030.h +++ b/include/twl4030.h @@ -208,6 +208,12 @@ #define TWL4030_PM_MASTER_SW_EVENTS_DEVSLP (1 << 1) #define TWL4030_PM_MASTER_SW_EVENTS_DEVOFF (1 << 0)
+/* HW conditions */ +#define TWL4030_PM_MASTER_STS_HW_CONDITIONS_PWON (1 << 0) +#define TWL4030_PM_MASTER_STS_HW_CONDITIONS_CHG (1 << 1) +#define TWL4030_PM_MASTER_STS_HW_CONDITIONS_USB (1 << 2) +#define TWL4030_PM_MASTER_STS_HW_CONDITIONS_VBUS (1 << 7) + /* Power transition */ #define TWL4030_PM_MASTER_CFG_TRANSITION_STARTON_PWON (1 << 0) #define TWL4030_PM_MASTER_CFG_TRANSITION_STARTON_CHG (1 << 1) @@ -670,6 +676,14 @@ void twl4030_power_init(void); void twl4030_power_mmc_init(int dev_index);
/* + * Input + */ + +int twl4030_input_power_button(void); +int twl4030_input_charger(void); +int twl4030_input_usb(void); + +/* * LED */ void twl4030_led_init(unsigned char ledon_mask);

On Mon, Jul 20, 2015 at 03:17:08PM +0200, Paul Kocialkowski wrote:
This adds support for detecting a few inputs exported by the TWL4030. Currently-supported inputs are the power button, USB and charger presence.
Reviewed-by: Tom Rini trini@konsulko.com

Le lundi 03 août 2015 à 22:07 -0400, Tom Rini a écrit :
On Mon, Jul 20, 2015 at 03:17:08PM +0200, Paul Kocialkowski wrote:
This adds support for detecting a few inputs exported by the TWL4030. Currently-supported inputs are the power button, USB and charger presence.
Reviewed-by: Tom Rini trini@konsulko.com
Signed-off-by: Paul Kocialkowski contact@paulk.fr

On Mon, Jul 20, 2015 at 03:17:08PM +0200, Paul Kocialkowski wrote:
This adds support for detecting a few inputs exported by the TWL4030. Currently-supported inputs are the power button, USB and charger presence. Reviewed-by: Tom Rini trini@konsulko.com Signed-off-by: Paul Kocialkowski contact@paulk.fr
Applied to u-boot/master, thanks!

This allows scanning the twl4030 keypad, storing the result in a 64-byte long matrix with the twl4030_keypad_scan function.
Detecting a key at a given column and row is made easier with the twl4030_keypad_key function.
Signed-off-by: Paul Kocialkowski contact@paulk.fr --- drivers/input/twl4030.c | 39 +++++++++++++++++++++++++++++++++++++++ include/twl4030.h | 3 +++ 2 files changed, 42 insertions(+)
diff --git a/drivers/input/twl4030.c b/drivers/input/twl4030.c index a5ded35..dc5868c 100644 --- a/drivers/input/twl4030.c +++ b/drivers/input/twl4030.c @@ -47,3 +47,42 @@ int twl4030_input_usb(void)
return 0; } + +int twl4030_keypad_scan(unsigned char *matrix) +{ + u8 data; + u8 c, r; + + twl4030_i2c_read_u8(TWL4030_CHIP_KEYPAD, + TWL4030_KEYPAD_KEYP_CTRL_REG, &data); + + data |= TWL4030_KEYPAD_CTRL_SOFT_NRST | TWL4030_KEYPAD_CTRL_KBD_ON; + data &= ~TWL4030_KEYPAD_CTRL_SOFTMODEN; + + twl4030_i2c_write_u8(TWL4030_CHIP_KEYPAD, + TWL4030_KEYPAD_KEYP_CTRL_REG, data); + + for (c = 0; c < 8; c++) { + data = 0xff & ~(1 << c); + twl4030_i2c_write_u8(TWL4030_CHIP_KEYPAD, + TWL4030_KEYPAD_KBC_REG, data); + + data = 0xff; + twl4030_i2c_read_u8(TWL4030_CHIP_KEYPAD, + TWL4030_KEYPAD_KBR_REG, &data); + + for (r = 0; r < 8; r++) + matrix[c * 8 + r] = !(data & (1 << r)); + } + + data = 0xff & ~(TWL4030_KEYPAD_CTRL_SOFT_NRST); + twl4030_i2c_write_u8(TWL4030_CHIP_KEYPAD, + TWL4030_KEYPAD_KEYP_CTRL_REG, data); + + return 0; +} + +int twl4030_keypad_key(unsigned char *matrix, u8 c, u8 r) +{ + return matrix[c * 8 + r]; +} diff --git a/include/twl4030.h b/include/twl4030.h index a4d5fbd..1031373 100644 --- a/include/twl4030.h +++ b/include/twl4030.h @@ -683,6 +683,9 @@ int twl4030_input_power_button(void); int twl4030_input_charger(void); int twl4030_input_usb(void);
+int twl4030_keypad_scan(unsigned char *matrix); +int twl4030_keypad_key(unsigned char *matrix, u8 c, u8 r); + /* * LED */

On Mon, Jul 20, 2015 at 03:17:09PM +0200, Paul Kocialkowski wrote:
This allows scanning the twl4030 keypad, storing the result in a 64-byte long matrix with the twl4030_keypad_scan function.
Detecting a key at a given column and row is made easier with the twl4030_keypad_key function.
Signed-off-by: Paul Kocialkowski contact@paulk.fr
Reviewed-by: Tom Rini trini@konsulko.com

On Mon, Jul 20, 2015 at 03:17:09PM +0200, Paul Kocialkowski wrote:
This allows scanning the twl4030 keypad, storing the result in a 64-byte long matrix with the twl4030_keypad_scan function.
Detecting a key at a given column and row is made easier with the twl4030_keypad_key function.
Signed-off-by: Paul Kocialkowski contact@paulk.fr Reviewed-by: Tom Rini trini@konsulko.com
Applied to u-boot/master, thanks!

Reboot mode is written in scratchpad memory before reboot in the form of a single char, that is the first letter of the reboot mode string as passed to the reboot function.
This mechanism is supported on OMAP3 both my the upstream kernel and by various TI kernels.
It is up to each board to make use of this mechanism or not.
Signed-off-by: Paul Kocialkowski contact@paulk.fr --- arch/arm/cpu/armv7/omap3/boot.c | 38 ++++++++++++++++++++++++++++++++++ arch/arm/include/asm/arch-omap3/omap.h | 7 +++++++ 2 files changed, 45 insertions(+)
diff --git a/arch/arm/cpu/armv7/omap3/boot.c b/arch/arm/cpu/armv7/omap3/boot.c index 66576b2..44d7c30 100644 --- a/arch/arm/cpu/armv7/omap3/boot.c +++ b/arch/arm/cpu/armv7/omap3/boot.c @@ -56,3 +56,41 @@ u32 omap_sys_boot_device(void)
return boot_devices[sys_boot]; } + +char omap_reboot_mode(void) +{ + u32 reboot_mode; + char c; + + reboot_mode = readl((u32 *)(OMAP34XX_SCRATCHPAD + 4)); + + c = (reboot_mode >> 24) & 0xff; + if (c != 'B') + return -1; + + c = (reboot_mode >> 16) & 0xff; + if (c != 'M') + return -1; + + c = reboot_mode & 0xff; + + return c; +} + +int omap_reboot_mode_clear(void) +{ + writel(0, (u32 *)(OMAP34XX_SCRATCHPAD + 4)); + + return 0; +} + +int omap_reboot_mode_store(char c) +{ + u32 reboot_mode; + + reboot_mode = 'B' << 24 | 'M' << 16 | c; + + writel(reboot_mode, (u32 *)(OMAP34XX_SCRATCHPAD + 4)); + + return 0; +} diff --git a/arch/arm/include/asm/arch-omap3/omap.h b/arch/arm/include/asm/arch-omap3/omap.h index 537d13b..2c94a81 100644 --- a/arch/arm/include/asm/arch-omap3/omap.h +++ b/arch/arm/include/asm/arch-omap3/omap.h @@ -51,6 +51,9 @@ struct control_prog_io { /* Bit definition for CONTROL_PROG_IO1 */ #define PRG_I2C2_PULLUPRESX 0x00000001
+/* Scratchpad memory */ +#define OMAP34XX_SCRATCHPAD (OMAP34XX_CTRL_BASE + 0x910) + /* UART */ #define OMAP34XX_UART1 (OMAP34XX_L4_IO_BASE + 0x6a000) #define OMAP34XX_UART2 (OMAP34XX_L4_IO_BASE + 0x6c000) @@ -256,6 +259,10 @@ struct omap_boot_parameters { unsigned char ch_flags; unsigned int boot_device_descriptor; }; + +char omap_reboot_mode(void); +int omap_reboot_mode_clear(void); +int omap_reboot_mode_store(char c); #endif
#endif

On Mon, Jul 20, 2015 at 03:17:10PM +0200, Paul Kocialkowski wrote:
Reboot mode is written in scratchpad memory before reboot in the form of a single char, that is the first letter of the reboot mode string as passed to the reboot function.
This mechanism is supported on OMAP3 both my the upstream kernel and by various TI kernels.
It is up to each board to make use of this mechanism or not.
Signed-off-by: Paul Kocialkowski contact@paulk.fr
Reviewed-by: Tom Rini trini@konsulko.com

On Mon, Jul 20, 2015 at 03:17:10PM +0200, Paul Kocialkowski wrote:
Reboot mode is written in scratchpad memory before reboot in the form of a single char, that is the first letter of the reboot mode string as passed to the reboot function.
This mechanism is supported on OMAP3 both my the upstream kernel and by various TI kernels.
It is up to each board to make use of this mechanism or not.
Signed-off-by: Paul Kocialkowski contact@paulk.fr Reviewed-by: Tom Rini trini@konsulko.com
Applied to u-boot/master, thanks!

The LG Optimus Black (P970) codename sniper is a smartphone that was designed and manufactured by LG Electronics (LGE) and released back in 2011.
It is using an OMAP3630 SoC GP version, which allows running U-Boot and the U-Boot SPL from the ground up. This port is aimed at running an Android version such as Replicant, the fully free Android distribution. However, support for upstream Linux with device-tree and common GNU/Linux distros boot commands could be added in the future.
For more information about the journey to freeing this device, please read the series of blog posts at: http://code.paulk.fr/article20/a-hacker-s-journey-freeing-a-phone-from-the-g...
Signed-off-by: Paul Kocialkowski contact@paulk.fr --- arch/arm/cpu/armv7/omap3/Kconfig | 8 + board/lge/sniper/Kconfig | 12 ++ board/lge/sniper/MAINTAINERS | 6 + board/lge/sniper/Makefile | 9 + board/lge/sniper/sniper.c | 85 +++++++++ board/lge/sniper/sniper.h | 365 +++++++++++++++++++++++++++++++++++++++ configs/sniper_defconfig | 7 + include/configs/sniper.h | 265 ++++++++++++++++++++++++++++ 8 files changed, 757 insertions(+) create mode 100644 board/lge/sniper/Kconfig create mode 100644 board/lge/sniper/MAINTAINERS create mode 100644 board/lge/sniper/Makefile create mode 100644 board/lge/sniper/sniper.c create mode 100644 board/lge/sniper/sniper.h create mode 100644 configs/sniper_defconfig create mode 100644 include/configs/sniper.h
diff --git a/arch/arm/cpu/armv7/omap3/Kconfig b/arch/arm/cpu/armv7/omap3/Kconfig index b32a6b0..f4fb6cb 100644 --- a/arch/arm/cpu/armv7/omap3/Kconfig +++ b/arch/arm/cpu/armv7/omap3/Kconfig @@ -114,6 +114,13 @@ config TARGET_OMAP3_CAIRO select DM_SERIAL select DM_GPIO
+config TARGET_SNIPER + bool "Sniper" + select SUPPORT_SPL + select DM + select DM_SERIAL + select DM_GPIO + endchoice
config SYS_SOC @@ -142,5 +149,6 @@ source "board/nokia/rx51/Kconfig" source "board/technexion/tao3530/Kconfig" source "board/technexion/twister/Kconfig" source "board/quipos/cairo/Kconfig" +source "board/lge/sniper/Kconfig"
endif diff --git a/board/lge/sniper/Kconfig b/board/lge/sniper/Kconfig new file mode 100644 index 0000000..f7a682e --- /dev/null +++ b/board/lge/sniper/Kconfig @@ -0,0 +1,12 @@ +if TARGET_SNIPER + +config SYS_BOARD + default "sniper" + +config SYS_VENDOR + default "lge" + +config SYS_CONFIG_NAME + default "sniper" + +endif diff --git a/board/lge/sniper/MAINTAINERS b/board/lge/sniper/MAINTAINERS new file mode 100644 index 0000000..0e7baa5 --- /dev/null +++ b/board/lge/sniper/MAINTAINERS @@ -0,0 +1,6 @@ +SNIPER BOARD +M: Paul Kocialkowski contact@paulk.fr +S: Maintained +F: board/lge/sniper/ +F: include/configs/sniper.h +F: configs/sniper_defconfig diff --git a/board/lge/sniper/Makefile b/board/lge/sniper/Makefile new file mode 100644 index 0000000..2d216fc --- /dev/null +++ b/board/lge/sniper/Makefile @@ -0,0 +1,9 @@ +# +# LG Optimus Black (P970) codename sniper board +# +# Copyright (C) 2015 Paul Kocialkowski contact@paulk.fr +# +# SPDX-License-Identifier: GPL-2.0+ +# + +obj-y := sniper.o diff --git a/board/lge/sniper/sniper.c b/board/lge/sniper/sniper.c new file mode 100644 index 0000000..d5318c4 --- /dev/null +++ b/board/lge/sniper/sniper.c @@ -0,0 +1,85 @@ +/* + * LG Optimus Black (P970) codename sniper board + * + * Copyright (C) 2015 Paul Kocialkowski contact@paulk.fr + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +#include <config.h> +#include <common.h> +#include <dm.h> +#include <asm/arch/mmc_host_def.h> +#include <asm/arch/sys_proto.h> +#include <asm/arch/mem.h> +#include <asm/io.h> +#include <ns16550.h> +#include <twl4030.h> +#include "sniper.h" + +DECLARE_GLOBAL_DATA_PTR; + +const omap3_sysinfo sysinfo = { + .mtype = DDR_STACKED, + .board_string = "Sniper", + .nand_string = "MMC" +}; + +static const struct ns16550_platdata serial_omap_platdata = { + .base = OMAP34XX_UART3, + .reg_shift = 2, + .clock = V_NS16550_CLK +}; + +U_BOOT_DEVICE(sniper_serial) = { + .name = "serial_omap", + .platdata = &serial_omap_platdata +}; + +#ifdef CONFIG_SPL_BUILD +void get_board_mem_timings(struct board_sdrc_timings *timings) +{ + timings->mcfg = HYNIX_V_MCFG_200(256 << 20); + timings->ctrla = HYNIX_V_ACTIMA_200; + timings->ctrlb = HYNIX_V_ACTIMB_200; + timings->rfr_ctrl = SDP_3430_SDRC_RFR_CTRL_200MHz; + timings->mr = MICRON_V_MR_165; +} +#endif + +u32 get_board_rev(void) +{ + /* Sold devices are expected to be at least revision F. */ + return 6; +} + +int board_init(void) +{ + /* GPMC init */ + gpmc_init(); + + /* MACH number */ + gd->bd->bi_arch_number = 3000; + + /* ATAGs location */ + gd->bd->bi_boot_params = OMAP34XX_SDRC_CS0 + 0x100; + + return 0; +} + +void set_muxconf_regs(void) +{ + MUX_SNIPER(); +} + +#ifndef CONFIG_SPL_BUILD +int board_mmc_init(bd_t *bis) +{ + return omap_mmc_init(1, 0, 0, -1, -1); +} +#endif + +void board_mmc_power_init(void) +{ + twl4030_power_mmc_init(1); +} diff --git a/board/lge/sniper/sniper.h b/board/lge/sniper/sniper.h new file mode 100644 index 0000000..b2a09b3 --- /dev/null +++ b/board/lge/sniper/sniper.h @@ -0,0 +1,365 @@ +/* + * LG Optimus Black (P970) codename sniper board + * + * Copyright (C) 2015 Paul Kocialkowski contact@paulk.fr + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +#ifndef _SNIPER_H_ +#define _SNIPER_H_ + +#include <asm/arch/mux.h> + +#define MUX_SNIPER() \ + /* SDRC */ \ + MUX_VAL(CP(SDRC_D0), (IEN | PTD | DIS | M0)) /* SDRC_D0 */\ + MUX_VAL(CP(SDRC_D1), (IEN | PTD | DIS | M0)) /* SDRC_D1 */\ + MUX_VAL(CP(SDRC_D2), (IEN | PTD | DIS | M0)) /* SDRC_D2 */\ + MUX_VAL(CP(SDRC_D3), (IEN | PTD | DIS | M0)) /* SDRC_D3 */\ + MUX_VAL(CP(SDRC_D4), (IEN | PTD | DIS | M0)) /* SDRC_D4 */\ + MUX_VAL(CP(SDRC_D5), (IEN | PTD | DIS | M0)) /* SDRC_D5 */\ + MUX_VAL(CP(SDRC_D6), (IEN | PTD | DIS | M0)) /* SDRC_D6 */\ + MUX_VAL(CP(SDRC_D7), (IEN | PTD | DIS | M0)) /* SDRC_D7 */\ + MUX_VAL(CP(SDRC_D8), (IEN | PTD | DIS | M0)) /* SDRC_D8 */\ + MUX_VAL(CP(SDRC_D9), (IEN | PTD | DIS | M0)) /* SDRC_D9 */\ + MUX_VAL(CP(SDRC_D10), (IEN | PTD | DIS | M0)) /* SDRC_D10 */\ + MUX_VAL(CP(SDRC_D11), (IEN | PTD | DIS | M0)) /* SDRC_D11 */\ + MUX_VAL(CP(SDRC_D12), (IEN | PTD | DIS | M0)) /* SDRC_D12 */\ + MUX_VAL(CP(SDRC_D13), (IEN | PTD | DIS | M0)) /* SDRC_D13 */\ + MUX_VAL(CP(SDRC_D14), (IEN | PTD | DIS | M0)) /* SDRC_D14 */\ + MUX_VAL(CP(SDRC_D15), (IEN | PTD | DIS | M0)) /* SDRC_D15 */\ + MUX_VAL(CP(SDRC_D16), (IEN | PTD | DIS | M0)) /* SDRC_D16 */\ + MUX_VAL(CP(SDRC_D17), (IEN | PTD | DIS | M0)) /* SDRC_D17 */\ + MUX_VAL(CP(SDRC_D18), (IEN | PTD | DIS | M0)) /* SDRC_D18 */\ + MUX_VAL(CP(SDRC_D19), (IEN | PTD | DIS | M0)) /* SDRC_D19 */\ + MUX_VAL(CP(SDRC_D20), (IEN | PTD | DIS | M0)) /* SDRC_D20 */\ + MUX_VAL(CP(SDRC_D21), (IEN | PTD | DIS | M0)) /* SDRC_D21 */\ + MUX_VAL(CP(SDRC_D22), (IEN | PTD | DIS | M0)) /* SDRC_D22 */\ + MUX_VAL(CP(SDRC_D23), (IEN | PTD | DIS | M0)) /* SDRC_D23 */\ + MUX_VAL(CP(SDRC_D24), (IEN | PTD | DIS | M0)) /* SDRC_D24 */\ + MUX_VAL(CP(SDRC_D25), (IEN | PTD | DIS | M0)) /* SDRC_D25 */\ + MUX_VAL(CP(SDRC_D26), (IEN | PTD | DIS | M0)) /* SDRC_D26 */\ + MUX_VAL(CP(SDRC_D27), (IEN | PTD | DIS | M0)) /* SDRC_D27 */\ + MUX_VAL(CP(SDRC_D28), (IEN | PTD | DIS | M0)) /* SDRC_D28 */\ + MUX_VAL(CP(SDRC_D29), (IEN | PTD | DIS | M0)) /* SDRC_D29 */\ + MUX_VAL(CP(SDRC_D30), (IEN | PTD | DIS | M0)) /* SDRC_D30 */\ + MUX_VAL(CP(SDRC_D31), (IEN | PTD | DIS | M0)) /* SDRC_D31 */\ + MUX_VAL(CP(SDRC_CLK), (IEN | PTD | DIS | M0)) /* SDRC_CLK */\ + MUX_VAL(CP(SDRC_DQS0), (IEN | PTD | DIS | M0)) /* SDRC_DQS0 */\ + MUX_VAL(CP(SDRC_DQS1), (IEN | PTD | DIS | M0)) /* SDRC_DQS1 */\ + MUX_VAL(CP(SDRC_DQS2), (IEN | PTD | DIS | M0)) /* SDRC_DQS2 */\ + MUX_VAL(CP(SDRC_DQS3), (IEN | PTD | DIS | M0)) /* SDRC_DQS3 */ \ + /* GPMC */ \ + MUX_VAL(CP(GPMC_A1), (IDIS | PTU | DIS | M4)) /* GPIO_34: LCD_RESET_N */ \ + MUX_VAL(CP(GPMC_A2), (IEN | PTU | DIS | M4)) /* GPIO_35: TOUCH_INT_N */ \ + MUX_VAL(CP(GPMC_A3), (IDIS | PTU | DIS | M4)) /* GPIO_36: VT_CAM_PWDN */ \ + MUX_VAL(CP(GPMC_A4), (IDIS | PTU | DIS | M4)) /* GPIO_37: CAM_SUBPM_EN */\ + MUX_VAL(CP(GPMC_A5), (IEN | PTD | DIS | M4)) /* GPIO_38: MODEM_PWR_CHK */\ + MUX_VAL(CP(GPMC_A6), (IDIS | PTD | DIS | M4)) /* GPIO_39: MODEM_WAKE */\ + MUX_VAL(CP(GPMC_A7), (IEN | PTU | DIS | M4)) /* GPIO_40: MUIC_INT_N */\ + MUX_VAL(CP(GPMC_A8), (IEN | PTD | DIS | M4)) /* GPIO_41: GYRO_INT_N */\ + MUX_VAL(CP(GPMC_A9), (IEN | PTD | EN | M4)) /* GPIO_42: MOTION_INT_N */\ + MUX_VAL(CP(GPMC_A10), (IEN | PTD | DIS | M4)) /* GPIO_43: BT_HOST_WAKEUP */\ + MUX_VAL(CP(GPMC_D0), (IEN | PTD | DIS | M0)) /* GPMC_D0 */ \ + MUX_VAL(CP(GPMC_D1), (IEN | PTD | DIS | M0)) /* GPMC_D1 */ \ + MUX_VAL(CP(GPMC_D2), (IEN | PTD | DIS | M0)) /* GPMC_D2 */ \ + MUX_VAL(CP(GPMC_D3), (IEN | PTD | DIS | M0)) /* GPMC_D3 */ \ + MUX_VAL(CP(GPMC_D4), (IEN | PTD | DIS | M0)) /* GPMC_D4 */ \ + MUX_VAL(CP(GPMC_D5), (IEN | PTD | DIS | M0)) /* GPMC_D5 */ \ + MUX_VAL(CP(GPMC_D6), (IEN | PTD | DIS | M0)) /* GPMC_D6 */ \ + MUX_VAL(CP(GPMC_D7), (IEN | PTD | DIS | M0)) /* GPMC_D7 */ \ + MUX_VAL(CP(GPMC_D8), (IEN | PTD | DIS | M0)) /* GPMC_D8 */ \ + MUX_VAL(CP(GPMC_D9), (IEN | PTD | DIS | M0)) /* GPMC_D9 */ \ + MUX_VAL(CP(GPMC_D10), (IEN | PTD | DIS | M0)) /* GPMC_D10 */ \ + MUX_VAL(CP(GPMC_D11), (IEN | PTD | DIS | M0)) /* GPMC_D11 */ \ + MUX_VAL(CP(GPMC_D12), (IEN | PTD | DIS | M0)) /* GPMC_D12 */ \ + MUX_VAL(CP(GPMC_D13), (IEN | PTD | DIS | M0)) /* GPMC_D13 */ \ + MUX_VAL(CP(GPMC_D14), (IEN | PTD | DIS | M0)) /* GPMC_D14 */ \ + MUX_VAL(CP(GPMC_NCS0), (IDIS | PTD | DIS | M7)) \ + MUX_VAL(CP(GPMC_NCS1), (IDIS | PTD | DIS | M4)) /* GPIO_52: BT_WAKE_UP */ \ + MUX_VAL(CP(GPMC_NCS2), (IEN | PTD | DIS | M4)) /* GPIO_53: LCD_TE */ \ + MUX_VAL(CP(GPMC_NCS3), (IDIS | PTD | DIS | M4)) /* GPIO_54: LCD_CS */ \ + MUX_VAL(CP(GPMC_NCS4), (IDIS | PTD | DIS | M4)) /* GPIO_55: BT_MAKER_ID */ \ + MUX_VAL(CP(GPMC_NCS5), (IDIS | PTD | DIS | M3)) /* GPIO_56: VIBE_PWM */ \ + MUX_VAL(CP(GPMC_NCS6), (IDIS | PTD | DIS | M4)) /* GPIO_57: VIBE_EN */ \ + MUX_VAL(CP(GPMC_NCS7), (IEN | PTD | DIS | M4)) /* GPIO_58: COM_INT */ \ + MUX_VAL(CP(GPMC_CLK), (IDIS | PTD | DIS | M7)) /* SAFE_MODE */ \ + MUX_VAL(CP(GPMC_NADV_ALE), (IDIS | PTD | DIS | M7)) \ + MUX_VAL(CP(GPMC_NOE), (IDIS | PTD | DIS | M7)) \ + MUX_VAL(CP(GPMC_NWE), (IDIS | PTD | DIS | M7)) \ + MUX_VAL(CP(GPMC_NBE0_CLE), (IDIS | PTD | DIS | M4)) /* GPIO_60: PROXI_LDO_EN */ \ + MUX_VAL(CP(GPMC_NBE1), (IDIS | PTD | DIS | M4)) /* GPIO_61: VT_RESET_N */ \ + MUX_VAL(CP(GPMC_NWP), (IDIS | PTD | DIS | M4)) /* GPIO_62: LCD_CP_EN */ \ + MUX_VAL(CP(GPMC_WAIT0), (IEN | PTU | EN | M4)) \ + MUX_VAL(CP(GPMC_WAIT1), (IEN | PTD | DIS | M4)) /* GPIO_63: ONENAND_INT */ \ + MUX_VAL(CP(GPMC_WAIT2), (IDIS | PTD | DIS | M2)) /* GPIO_64: UART4_TX_IPC */ \ + MUX_VAL(CP(GPMC_WAIT3), (IEN | PTD | DIS | M2)) /* GPIO_65: UART4_RX_IPC */ \ + /* DSS */ \ + MUX_VAL(CP(DSS_PCLK), (IEN | PTD | EN | M7)) /* SAFE_MODE */ \ + MUX_VAL(CP(DSS_HSYNC), (IEN | PTD | EN | M7)) /* SAFE_MODE */ \ + MUX_VAL(CP(DSS_VSYNC), (IEN | PTD | EN | M7)) /* SAFE_MODE */ \ + MUX_VAL(CP(DSS_ACBIAS), (IEN | PTD | EN | M7)) /* SAFE_MODE */ \ + MUX_VAL(CP(DSS_DATA0), (IDIS | PTD | DIS | M1)) /* DSI_DX0 */ \ + MUX_VAL(CP(DSS_DATA1), (IDIS | PTD | DIS | M1)) /* DSI_DY0 */ \ + MUX_VAL(CP(DSS_DATA2), (IDIS | PTD | DIS | M1)) /* DSI_DX1 */ \ + MUX_VAL(CP(DSS_DATA3), (IDIS | PTD | DIS | M1)) /* DSI_DY1 */ \ + MUX_VAL(CP(DSS_DATA4), (IDIS | PTD | DIS | M1)) /* DSI_DX2 */ \ + MUX_VAL(CP(DSS_DATA5), (IDIS | PTD | DIS | M1)) /* DSI_DY2 */ \ + MUX_VAL(CP(DSS_DATA6), (IEN | PTD | EN | M7)) /* SAFE_MODE */ \ + MUX_VAL(CP(DSS_DATA7), (IEN | PTD | EN | M7)) /* SAFE_MODE */ \ + MUX_VAL(CP(DSS_DATA8), (IEN | PTD | EN | M7)) /* SAFE_MODE */ \ + MUX_VAL(CP(DSS_DATA9), (IEN | PTD | EN | M7)) /* SAFE_MODE */ \ + MUX_VAL(CP(DSS_DATA10), (IEN | PTD | EN | M7)) /* SAFE_MODE */ \ + MUX_VAL(CP(DSS_DATA11), (IEN | PTD | EN | M7)) /* SAFE_MODE */ \ + MUX_VAL(CP(DSS_DATA12), (IEN | PTD | EN | M7)) /* SAFE_MODE */ \ + MUX_VAL(CP(DSS_DATA13), (IEN | PTD | EN | M7)) /* SAFE_MODE */ \ + MUX_VAL(CP(DSS_DATA14), (IEN | PTD | EN | M7)) /* SAFE_MODE */ \ + MUX_VAL(CP(DSS_DATA15), (IEN | PTD | EN | M7)) /* SAFE_MODE */ \ + MUX_VAL(CP(DSS_DATA16), (IEN | PTD | EN | M7)) /* SAFE_MODE */ \ + MUX_VAL(CP(DSS_DATA17), (IDIS | PTD | DIS | M4)) /* GPIO_87: MIC_SEL */ \ + MUX_VAL(CP(DSS_DATA18), (IEN | PTD | EN | M7)) /* SAFE_MODE */ \ + MUX_VAL(CP(DSS_DATA19), (IEN | PTD | EN | M7)) /* SAFE_MODE */ \ + MUX_VAL(CP(DSS_DATA20), (IEN | PTD | EN | M7)) /* SAFE_MODE */ \ + MUX_VAL(CP(DSS_DATA21), (IEN | PTD | EN | M7)) /* SAFE_MODE */ \ + MUX_VAL(CP(DSS_DATA22), (IEN | PTD | EN | M7)) /* SAFE_MODE */ \ + MUX_VAL(CP(DSS_DATA23), (IEN | PTD | EN | M7)) /* SAFE_MODE */ \ + /* CAM */ \ + MUX_VAL(CP(CAM_HS), (IEN | PTD | EN | M0)) /* CAM_HS */ \ + MUX_VAL(CP(CAM_VS), (IEN | PTD | EN | M0)) /* CAM_VS */ \ + MUX_VAL(CP(CAM_XCLKA), (IDIS | PTD | DIS | M0)) /* CAM_XCLKA */ \ + MUX_VAL(CP(CAM_PCLK), (IEN | PTD | EN | M0)) /* CAM_PCLK */ \ + MUX_VAL(CP(CAM_FLD), (IDIS | PTU | DIS | M4)) /* GPIO_98: 5M_RESET_N */ \ + MUX_VAL(CP(CAM_D0), (IEN | PTD | DIS | M2)) /* CSI2_DX2 */ \ + MUX_VAL(CP(CAM_D1), (IEN | PTD | DIS | M2)) /* CSI2_DY2 */ \ + MUX_VAL(CP(CAM_D2), (IDIS | PTD | EN | M4)) /* GPIO_101: IFX_USB_VBUS_EN */ \ + MUX_VAL(CP(CAM_D3), (IDIS | PTD | DIS | M7)) /* SAFE_MODE */ \ + MUX_VAL(CP(CAM_D4), (IEN | PTD | DIS | M0)) /* CAM_D4 */ \ + MUX_VAL(CP(CAM_D5), (IEN | PTD | DIS | M0)) /* CAM_D5 */ \ + MUX_VAL(CP(CAM_D6), (IEN | PTD | DIS | M0)) /* CAM_D6 */ \ + MUX_VAL(CP(CAM_D7), (IEN | PTD | DIS | M0)) /* CAM_D7 */ \ + MUX_VAL(CP(CAM_D8), (IEN | PTD | DIS | M0)) /* CAM_D8 */ \ + MUX_VAL(CP(CAM_D9), (IEN | PTD | DIS | M0)) /* CAM_D9 */ \ + MUX_VAL(CP(CAM_D10), (IEN | PTD | DIS | M0)) /* CAM_D10 */ \ + MUX_VAL(CP(CAM_D11), (IEN | PTD | DIS | M0)) /* CAM_D11 */ \ + MUX_VAL(CP(CAM_XCLKB), (IEN | PTD | DIS | M0)) /* CAM_XCLKB */ \ + MUX_VAL(CP(CAM_WEN), (IDIS | PTD | DIS | M4)) /* GPIO_167: 5M_CAM_VCN_EN */ \ + MUX_VAL(CP(CAM_STROBE), (IEN | PTD | DIS | M7)) /* SAFE_MODE */ \ + /* CSI2 */ \ + MUX_VAL(CP(CSI2_DX0), (IEN | PTD | DIS | M0)) /* CSI2_DX0 */ \ + MUX_VAL(CP(CSI2_DY0), (IEN | PTD | DIS | M0)) /* CSI2_DY0 */ \ + MUX_VAL(CP(CSI2_DX1), (IEN | PTD | DIS | M0)) /* CSI2_DX1 */ \ + MUX_VAL(CP(CSI2_DY1), (IEN | PTD | DIS | M0)) /* CSI2_DY1 */ \ + /* MCBSP2 */ \ + MUX_VAL(CP(MCBSP2_FSX), (IEN | PTD | DIS | M0)) /* MCBSP2_FSX */ \ + MUX_VAL(CP(MCBSP2_CLKX), (IEN | PTD | DIS | M0)) /* MCBSP2_CLKX */ \ + MUX_VAL(CP(MCBSP2_DR), (IEN | PTD | DIS | M0)) /* MCBSP2_DR */ \ + MUX_VAL(CP(MCBSP2_DX), (IDIS | PTD | DIS | M0)) /* MCBSP2_DX */ \ + /* MMC1 */ \ + MUX_VAL(CP(MMC1_CLK), (IDIS | PTD | DIS | M0)) /* MMC1_CLK */ \ + MUX_VAL(CP(MMC1_CMD), (IEN | PTU | DIS | M0)) /* MMC1_CMD */ \ + MUX_VAL(CP(MMC1_DAT0), (IEN | PTU | DIS | M0)) /* MMC1_DAT0 */ \ + MUX_VAL(CP(MMC1_DAT1), (IEN | PTU | DIS | M0)) /* MMC1_DAT1 */ \ + MUX_VAL(CP(MMC1_DAT2), (IEN | PTU | DIS | M0)) /* MMC1_DAT2 */ \ + MUX_VAL(CP(MMC1_DAT3), (IEN | PTU | DIS | M0)) /* MMC1_DAT3 */ \ + MUX_VAL(CP(MMC1_DAT4), (IEN | PTD | DIS | M7)) /* SAFE_MODE */ \ + MUX_VAL(CP(MMC1_DAT5), (IEN | PTD | DIS | M7)) /* SAFE_MODE */ \ + MUX_VAL(CP(MMC1_DAT6), (IEN | PTD | DIS | M7)) /* SAFE_MODE */ \ + MUX_VAL(CP(MMC1_DAT7), (IEN | PTD | DIS | M7)) /* SAFE_MODE */ \ + /* MMC2 */ \ + MUX_VAL(CP(MMC2_CLK), (IEN | PTD | DIS | M0)) /* MMC2_CLK */ \ + MUX_VAL(CP(MMC2_CMD), (IEN | PTD | DIS | M0)) /* MMC2_CMD */ \ + MUX_VAL(CP(MMC2_DAT0), (IEN | PTD | DIS | M0)) /* MMC2_DAT0 */ \ + MUX_VAL(CP(MMC2_DAT1), (IEN | PTD | DIS | M0)) /* MMC2_DAT1 */ \ + MUX_VAL(CP(MMC2_DAT2), (IEN | PTD | DIS | M0)) /* MMC2_DAT2 */ \ + MUX_VAL(CP(MMC2_DAT3), (IEN | PTD | DIS | M0)) /* MMC2_DAT3 */ \ + MUX_VAL(CP(MMC2_DAT4), (IEN | PTD | DIS | M0)) /* MMC2_DAT4 */ \ + MUX_VAL(CP(MMC2_DAT5), (IEN | PTD | DIS | M0)) /* MMC2_DAT5 */ \ + MUX_VAL(CP(MMC2_DAT6), (IEN | PTD | DIS | M0)) /* MMC2_DAT6 */ \ + MUX_VAL(CP(MMC2_DAT7), (IEN | PTD | DIS | M0)) /* MMC2_DAT7 */ \ + /* MCBSP3 */ \ + MUX_VAL(CP(MCBSP3_DX), (IDIS | PTD | DIS | M0)) /* MCBSP3_DX */ \ + MUX_VAL(CP(MCBSP3_DR), (IEN | PTD | DIS | M0)) /* MCBSP3_DR */ \ + MUX_VAL(CP(MCBSP3_CLKX), (IEN | PTD | DIS | M0)) /* MCBSP3_CLKX */ \ + MUX_VAL(CP(MCBSP3_FSX), (IEN | PTD | DIS | M0)) /* MCBSP3_FSX */ \ + /* UART2 */ \ + MUX_VAL(CP(UART2_CTS), (IEN | PTU | DIS | M0)) /* UART2_CTS */ \ + MUX_VAL(CP(UART2_RTS), (IDIS | PTU | DIS | M0)) /* UART2_RTS */ \ + MUX_VAL(CP(UART2_TX), (IDIS | PTD | DIS | M0)) /* UART2_TX */ \ + MUX_VAL(CP(UART2_RX), (IEN | PTD | DIS | M0)) /* UART2_RX */ \ + /* UART1 */ \ + MUX_VAL(CP(UART1_TX), (IDIS | PTU | DIS | M0)) /* UART1_TX */ \ + MUX_VAL(CP(UART1_RTS), (IDIS | PTU | DIS | M0)) /* UART1_RTS */ \ + MUX_VAL(CP(UART1_CTS), (IEN | PTU | DIS | M0)) /* UART1_CTS */ \ + MUX_VAL(CP(UART1_RX), (IEN | PTU | DIS | M0)) /* UART1_RX */ \ + /* MCBSP4 */ \ + MUX_VAL(CP(MCBSP4_CLKX), (IDIS | PTD | DIS | M4)) /* GPIO_152: GPS_PWR_ON */ \ + MUX_VAL(CP(MCBSP4_DR), (IDIS | PTD | DIS | M4)) /* GPIO_153: GPS_RESET_N */ \ + MUX_VAL(CP(MCBSP4_DX), (IDIS | PTD | DIS | M4)) /* GPIO_154: FLASH_LED_TORCH */ \ + MUX_VAL(CP(MCBSP4_FSX), (IDIS | PTD | DIS | M4)) /* GPIO_155: FLASH_LED_EN */ \ + /* MCBSP1 */ \ + MUX_VAL(CP(MCBSP1_CLKR), (IEN | PTD | DIS | M0)) /* MCBSP1_CLKR */ \ + MUX_VAL(CP(MCBSP1_FSR), (IEN | PTD | DIS | M0)) /* MCBSP1_FSR */ \ + MUX_VAL(CP(MCBSP1_DX), (IDIS | PTD | DIS | M0)) /* MCBSP1_DX */ \ + MUX_VAL(CP(MCBSP1_DR), (IEN | PTD | DIS | M0)) /* MCBSP1_DR */ \ + MUX_VAL(CP(MCBSP_CLKS), (IDIS | PTD | DIS | M7)) /* SAFE_MODE */ \ + MUX_VAL(CP(MCBSP1_FSX), (IDIS | PTD | DIS | M4)) /* GPIO_161: OMAP_UART_SW */ \ + MUX_VAL(CP(MCBSP1_CLKX), (IDIS | PTD | DIS | M4)) /* GPIO_162: IFX_UART_SW */ \ + /* UART3 */ \ + MUX_VAL(CP(UART3_CTS_RCTX), (IEN | PTD | EN | M4)) /* GPIO_163: HOOK_DIG */ \ + MUX_VAL(CP(UART3_RTS_SD), (IEN | PTD | EN | M7)) /* SAFE_MODE */ \ + MUX_VAL(CP(UART3_RX_IRRX), (IEN | PTD | DIS | M0)) /* UART3_RX_IRRX */ \ + MUX_VAL(CP(UART3_TX_IRTX), (IDIS | PTD | DIS | M0)) /* UART3_TX_IRTX */ \ + /* HSUSB0 */ \ + MUX_VAL(CP(HSUSB0_CLK), (IEN | PTD | EN | M0)) /* HSUSB0_CLK */\ + MUX_VAL(CP(HSUSB0_STP), (IDIS | PTD | DIS | M0)) /* HSUSB0_STP */\ + MUX_VAL(CP(HSUSB0_DIR), (IEN | PTD | EN | M0)) /* HSUSB0_DIR */\ + MUX_VAL(CP(HSUSB0_NXT), (IEN | PTD | EN | M0)) /* HSUSB0_NXT */\ + MUX_VAL(CP(HSUSB0_DATA0), (IEN | PTD | EN | M0)) /* HSUSB0_DATA0 */\ + MUX_VAL(CP(HSUSB0_DATA1), (IEN | PTD | EN | M0)) /* HSUSB0_DATA1 */\ + MUX_VAL(CP(HSUSB0_DATA2), (IEN | PTD | EN | M0)) /* HSUSB0_DATA2 */\ + MUX_VAL(CP(HSUSB0_DATA3), (IEN | PTD | EN | M0)) /* HSUSB0_DATA3 */\ + MUX_VAL(CP(HSUSB0_DATA4), (IEN | PTD | EN | M0)) /* HSUSB0_DATA4 */\ + MUX_VAL(CP(HSUSB0_DATA5), (IEN | PTD | EN | M0)) /* HSUSB0_DATA5 */\ + MUX_VAL(CP(HSUSB0_DATA6), (IEN | PTD | EN | M0)) /* HSUSB0_DATA6 */\ + MUX_VAL(CP(HSUSB0_DATA7), (IEN | PTD | EN | M0)) /* HSUSB0_DATA7 */ \ + /* I2C1 */ \ + MUX_VAL(CP(I2C1_SCL), (IEN | PTU | EN | M0)) /* I2C1_SCL */ \ + MUX_VAL(CP(I2C1_SDA), (IEN | PTU | EN | M0)) /* I2C1_SDA */ \ + /* I2C2 */ \ + MUX_VAL(CP(I2C2_SCL), (IEN | PTU | DIS | M0)) /* I2C2_SCL */ \ + MUX_VAL(CP(I2C2_SDA), (IEN | PTU | DIS | M0)) /* I2C2_SDA */ \ + /* I2C3 */ \ + MUX_VAL(CP(I2C3_SCL), (IEN | PTU | DIS | M0)) /* I2C3_SCL */ \ + MUX_VAL(CP(I2C3_SDA), (IEN | PTU | DIS | M0)) /* I2C3_SDA */ \ + /* I2C4 */ \ + MUX_VAL(CP(I2C4_SCL), (IEN | PTU | EN | M0)) /* I2C4_SCL */ \ + MUX_VAL(CP(I2C4_SDA), (IEN | PTU | EN | M0)) /* I2C4_SDA */ \ + /* HDQ */ \ + MUX_VAL(CP(HDQ_SIO), (IEN | PTD | EN | M4)) /* GPIO_170: EAR_SENSE */ \ + /* MCSPI1 */ \ + MUX_VAL(CP(MCSPI1_CLK), (IEN | PTD | EN | M7)) /* SAFE_MODE */ \ + MUX_VAL(CP(MCSPI1_SIMO), (IEN | PTD | EN | M7)) /* SAFE_MODE */ \ + MUX_VAL(CP(MCSPI1_SOMI), (IEN | PTD | EN | M7)) /* SAFE_MODE */ \ + MUX_VAL(CP(MCSPI1_CS0), (IEN | PTD | EN | M7)) /* SAFE_MODE */ \ + MUX_VAL(CP(MCSPI1_CS1), (IEN | PTU | DIS | M4)) /* GPIO_175: GAUGE_INT */ \ + MUX_VAL(CP(MCSPI1_CS2), (IEN | PTU | DIS | M4)) /* GPIO_176: MODEM_SEND */ \ + MUX_VAL(CP(MCSPI1_CS3), (IDIS | PTU | DIS | M4)) /* GPIO_177: MODEM_CHK */ \ + MUX_VAL(CP(MCSPI2_CLK), (IEN | PTD | EN | M0)) /* MCSPI2_CLK */ \ + MUX_VAL(CP(MCSPI2_SIMO), (IDIS | PTD | DIS | M0)) /* MCSPI2_SIMO */ \ + MUX_VAL(CP(MCSPI2_SOMI), (IEN | PTD | DIS | M0)) /* MCSPI2_SOMI */ \ + MUX_VAL(CP(MCSPI2_CS0), (IDIS | PTU | DIS | M4)) /* GPIO_181: WLAN_WAKEUP */ \ + MUX_VAL(CP(MCSPI2_CS1), (IDIS | PTD | DIS | M4)) /* GPIO_182: USIF1_SW */ \ + /* SYS */ \ + MUX_VAL(CP(SYS_32K), (IEN | PTD | DIS | M0)) /* SYS_32K */ \ + MUX_VAL(CP(SYS_CLKREQ), (IEN | PTD | DIS | M0)) /* SYS_CLKREQ */ \ + MUX_VAL(CP(SYS_NIRQ), (IEN | PTU | EN | M0)) /* SYS_NIRQ */ \ + MUX_VAL(CP(SYS_BOOT0), (IEN | PTU | EN | M7)) /* SAFE_MODE */ \ + MUX_VAL(CP(SYS_BOOT1), (IEN | PTD | EN | M7)) /* SAFE_MODE */ \ + MUX_VAL(CP(SYS_BOOT2), (IEN | PTU | EN | M7)) /* SAFE_MODE */ \ + MUX_VAL(CP(SYS_BOOT3), (IEN | PTD | EN | M7)) /* SAFE_MODE */ \ + MUX_VAL(CP(SYS_BOOT4), (IEN | PTD | EN | M7)) /* SAFE_MODE */ \ + MUX_VAL(CP(SYS_BOOT5), (IEN | PTD | EN | M7)) /* SAFE_MODE */ \ + MUX_VAL(CP(SYS_BOOT6), (IEN | PTU | EN | M7)) /* SAFE_MODE */ \ + MUX_VAL(CP(SYS_OFF_MODE), (IDIS | PTD | DIS | M0)) /* SYS_OFF_MODE */ \ + MUX_VAL(CP(SYS_CLKOUT1), (IEN | PTU | DIS | M4)) /* GPIO_10: MICROSD_DET_N */ \ + MUX_VAL(CP(SYS_CLKOUT2), (IDIS | PTD | EN | M7)) /* SAFE_MODE */ \ + /* JTAG */ \ + MUX_VAL(CP(JTAG_NTRST), (IEN | PTD | DIS | M0)) /* JTAG_NTRST */ \ + MUX_VAL(CP(JTAG_TCK), (IEN | PTD | DIS | M0)) /* JTAG_TCK */ \ + MUX_VAL(CP(JTAG_TMS), (IEN | PTU | EN | M0)) /* JTAG_TMS */ \ + MUX_VAL(CP(JTAG_TDI), (IEN | PTU | EN | M0)) /* JTAG_TDI */ \ + MUX_VAL(CP(JTAG_EMU0), (IEN | PTU | DIS | M0)) /* JTAG_EMU0 */ \ + MUX_VAL(CP(JTAG_EMU1), (IEN | PTU | DIS | M0)) /* JTAG_EMU1 */ \ + /* ETK */ \ + MUX_VAL(CP(ETK_CLK_ES2), (IEN | PTD | DIS | M2)) /* SDMMC3_CLK */ \ + MUX_VAL(CP(ETK_CTL_ES2), (IEN | PTU | EN | M2)) /* SDMMC3_CMD */ \ + MUX_VAL(CP(ETK_D0_ES2), (IEN | PTD | EN | M4)) /* GPIO_14: PROX_OUT */ \ + MUX_VAL(CP(ETK_D1_ES2), (IEN | PTU | DIS | M4)) /* GPIO_15: CHG_STATUS_N_OMAP */ \ + MUX_VAL(CP(ETK_D2_ES2), (IEN | PTD | DIS | M4)) /* GPIO_16: BT_EN */ \ + MUX_VAL(CP(ETK_D3_ES2), (IEN | PTU | DIS | M2)) /* SDMMC3_DAT3 */ \ + MUX_VAL(CP(ETK_D4_ES2), (IEN | PTU | DIS | M2)) /* SDMMC3_DAT0 */ \ + MUX_VAL(CP(ETK_D5_ES2), (IEN | PTU | DIS | M2)) /* SDMMC3_DAT1 */ \ + MUX_VAL(CP(ETK_D6_ES2), (IEN | PTU | DIS | M2)) /* SDMMC3_DAT2 */ \ + MUX_VAL(CP(ETK_D7_ES2), (IEN | PTD | EN | M4)) /* GPIO_21: IPC_SRDY */ \ + MUX_VAL(CP(ETK_D8_ES2), (IDIS | PTD | DIS | M4)) /* GPIO_22: IPC_MRDY */ \ + MUX_VAL(CP(ETK_D9_ES2), (IDIS | PTD | DIS | M4)) /* GPIO_23: WLAN_EN */ \ + MUX_VAL(CP(ETK_D10_ES2), (IEN | PTD | EN | M4)) /* GPIO_24: WLAN_HOST_WAKEUP */ \ + MUX_VAL(CP(ETK_D11_ES2), (IDIS | PTD | DIS | M4)) /* GPIO_25: CHG_EN_SET_N_OMAP */ \ + MUX_VAL(CP(ETK_D12_ES2), (IDIS | PTD | DIS | M4)) /* GPIO_26: IFX_RESET_1.8V */ \ + MUX_VAL(CP(ETK_D13_ES2), (IDIS | PTD | DIS | M4)) /* GPIO_27: IFX_PWRON_1.8V */ \ + MUX_VAL(CP(ETK_D14_ES2), (IEN | PTU | EN | M4)) /* GPIO_28: CRADLE_DETECT_N */ \ + MUX_VAL(CP(ETK_D15_ES2), (IEN | PTU | EN | M4)) /* GPIO_29: CRADLE_DETECT_S */ \ + /* D2D */ \ + MUX_VAL(CP(D2D_MCAD0), (IEN | PTD | EN | M0)) /* D2D_MCAD0 */ \ + MUX_VAL(CP(D2D_MCAD1), (IEN | PTD | EN | M0)) /* D2D_MCAD1 */ \ + MUX_VAL(CP(D2D_MCAD2), (IEN | PTD | EN | M0)) /* D2D_MCAD2 */ \ + MUX_VAL(CP(D2D_MCAD3), (IEN | PTD | EN | M0)) /* D2D_MCAD3 */ \ + MUX_VAL(CP(D2D_MCAD4), (IEN | PTD | EN | M0)) /* D2D_MCAD4 */ \ + MUX_VAL(CP(D2D_MCAD5), (IEN | PTD | EN | M0)) /* D2D_MCAD5 */ \ + MUX_VAL(CP(D2D_MCAD6), (IEN | PTD | EN | M0)) /* D2D_MCAD6 */ \ + MUX_VAL(CP(D2D_MCAD7), (IEN | PTD | EN | M0)) /* D2D_MCAD7 */ \ + MUX_VAL(CP(D2D_MCAD8), (IEN | PTD | EN | M0)) /* D2D_MCAD8 */ \ + MUX_VAL(CP(D2D_MCAD9), (IEN | PTD | EN | M0)) /* D2D_MCAD9 */ \ + MUX_VAL(CP(D2D_MCAD10), (IEN | PTD | EN | M0)) /* D2D_MCAD10 */ \ + MUX_VAL(CP(D2D_MCAD11), (IEN | PTD | EN | M0)) /* D2D_MCAD11 */ \ + MUX_VAL(CP(D2D_MCAD12), (IEN | PTD | EN | M0)) /* D2D_MCAD12 */ \ + MUX_VAL(CP(D2D_MCAD13), (IEN | PTD | EN | M0)) /* D2D_MCAD13 */ \ + MUX_VAL(CP(D2D_MCAD14), (IEN | PTD | EN | M0)) /* D2D_MCAD14 */ \ + MUX_VAL(CP(D2D_MCAD15), (IEN | PTD | EN | M0)) /* D2D_MCAD15 */ \ + MUX_VAL(CP(D2D_MCAD16), (IEN | PTD | EN | M0)) /* D2D_MCAD16 */ \ + MUX_VAL(CP(D2D_MCAD17), (IEN | PTD | EN | M0)) /* D2D_MCAD17 */ \ + MUX_VAL(CP(D2D_MCAD18), (IEN | PTD | EN | M0)) /* D2D_MCAD18 */ \ + MUX_VAL(CP(D2D_MCAD19), (IEN | PTD | EN | M0)) /* D2D_MCAD19 */ \ + MUX_VAL(CP(D2D_MCAD20), (IEN | PTD | EN | M0)) /* D2D_MCAD20 */ \ + MUX_VAL(CP(D2D_MCAD21), (IEN | PTD | EN | M0)) /* D2D_MCAD21 */ \ + MUX_VAL(CP(D2D_MCAD22), (IEN | PTD | EN | M0)) /* D2D_MCAD22 */ \ + MUX_VAL(CP(D2D_MCAD23), (IEN | PTD | EN | M0)) /* D2D_MCAD23 */ \ + MUX_VAL(CP(D2D_MCAD24), (IEN | PTD | EN | M0)) /* D2D_MCAD24 */ \ + MUX_VAL(CP(D2D_MCAD25), (IEN | PTD | EN | M0)) /* D2D_MCAD25 */ \ + MUX_VAL(CP(D2D_MCAD26), (IEN | PTD | EN | M0)) /* D2D_MCAD26 */ \ + MUX_VAL(CP(D2D_MCAD27), (IEN | PTD | EN | M0)) /* D2D_MCAD27 */ \ + MUX_VAL(CP(D2D_MCAD28), (IEN | PTD | EN | M0)) /* D2D_MCAD28 */ \ + MUX_VAL(CP(D2D_MCAD29), (IEN | PTD | EN | M0)) /* D2D_MCAD29 */ \ + MUX_VAL(CP(D2D_MCAD30), (IEN | PTD | EN | M0)) /* D2D_MCAD30 */ \ + MUX_VAL(CP(D2D_MCAD31), (IEN | PTD | EN | M0)) /* D2D_MCAD31 */ \ + MUX_VAL(CP(D2D_MCAD32), (IEN | PTD | EN | M0)) /* D2D_MCAD32 */ \ + MUX_VAL(CP(D2D_MCAD33), (IEN | PTD | EN | M0)) /* D2D_MCAD33 */ \ + MUX_VAL(CP(D2D_MCAD34), (IEN | PTD | EN | M0)) /* D2D_MCAD34 */ \ + MUX_VAL(CP(D2D_MCAD35), (IEN | PTD | EN | M0)) /* D2D_MCAD35 */ \ + MUX_VAL(CP(D2D_MCAD36), (IEN | PTD | EN | M0)) /* D2D_MCAD36 */ \ + MUX_VAL(CP(D2D_CLK26MI), (IDIS | PTD | DIS | M0)) /* D2D_CLK26MI */ \ + MUX_VAL(CP(D2D_NRESPWRON), (IEN | PTU | EN | M0)) /* D2D_NRESPWRON */ \ + MUX_VAL(CP(D2D_NRESWARM), (IDIS | PTU | DIS | M0)) /* D2D_NRESWARM */ \ + MUX_VAL(CP(D2D_ARM9NIRQ), (IDIS | PTD | DIS | M0)) /* D2D_ARM9NIRQ */ \ + MUX_VAL(CP(D2D_UMA2P6FIQ), (IDIS | PTD | DIS | M0)) /* D2D_UMA2P6FIQ */ \ + MUX_VAL(CP(D2D_SPINT), (IEN | PTD | DIS | M0)) /* D2D_SPINT */ \ + MUX_VAL(CP(D2D_FRINT), (IEN | PTD | DIS | M0)) /* D2D_FRINT */ \ + MUX_VAL(CP(D2D_DMAREQ0), (IDIS | PTD | DIS | M0)) /* D2D_DMAREQ0 */ \ + MUX_VAL(CP(D2D_DMAREQ1), (IDIS | PTD | DIS | M0)) /* D2D_DMAREQ1 */ \ + MUX_VAL(CP(D2D_DMAREQ2), (IDIS | PTD | DIS | M0)) /* D2D_DMAREQ2 */ \ + MUX_VAL(CP(D2D_DMAREQ3), (IDIS | PTD | DIS | M0)) /* D2D_DMAREQ3 */ \ + MUX_VAL(CP(D2D_N3GTRST), (IEN | PTD | DIS | M0)) /* D2D_N3GTRST */ \ + MUX_VAL(CP(D2D_N3GTDI), (IEN | PTU | EN | M0)) /* D2D_N3GTDI */ \ + MUX_VAL(CP(D2D_N3GTDO), (IDIS | PTD | DIS | M0)) /* D2D_N3GTDO */ \ + MUX_VAL(CP(D2D_N3GTMS), (IEN | PTU | EN | M0)) /* D2D_N3GTMS */ \ + MUX_VAL(CP(D2D_N3GTCK), (IEN | PTD | DIS | M0)) /* D2D_N3GTCK */ \ + MUX_VAL(CP(D2D_N3GRTCK), (IEN | PTD | DIS | M0)) /* D2D_N3GRTCK */ \ + MUX_VAL(CP(D2D_MSTDBY), (IEN | PTU | EN | M0)) /* D2D_MSTDBY */ \ + MUX_VAL(CP(D2D_SWAKEUP), (IEN | PTD | EN | M0)) /* D2D_SWAKEUP */ \ + MUX_VAL(CP(D2D_IDLEREQ), (IEN | PTD | DIS | M0)) /* D2D_IDLEREQ */ \ + MUX_VAL(CP(D2D_IDLEACK), (IEN | PTU | EN | M0)) /* D2D_IDLEACK */ \ + MUX_VAL(CP(D2D_MWRITE), (IEN | PTD | DIS | M0)) /* D2D_MWRITE */ \ + MUX_VAL(CP(D2D_SWRITE), (IEN | PTD | DIS | M0)) /* D2D_SWRITE */ \ + MUX_VAL(CP(D2D_MREAD), (IEN | PTD | DIS | M0)) /* D2D_MREAD */ \ + MUX_VAL(CP(D2D_SREAD), (IEN | PTD | DIS | M0)) /* D2D_SREAD */ \ + MUX_VAL(CP(D2D_MBUSFLAG), (IEN | PTD | DIS | M0)) /* D2D_MBUSFLAG */ \ + MUX_VAL(CP(D2D_SBUSFLAG), (IEN | PTD | DIS | M0)) /* D2D_SBUSFLAG */ \ + MUX_VAL(CP(SDRC_CKE0), (IDIS | PTU | DIS | M0)) /* SDRC_CKE0 */ \ + MUX_VAL(CP(SDRC_CKE1), (IDIS | PTU | DIS | M0)) /* SDRC_CKE1 */ \ + MUX_VAL(CP(GPIO127), (IEN | PTD | DIS | M7)) /* SAFE_MODE */ \ + MUX_VAL(CP(GPIO126), (IDIS | PTD | DIS | M4)) /* GPIO_126: OMAP_SEND */ \ + MUX_VAL(CP(GPIO128), (IDIS | PTD | DIS | M4)) /* GPIO_128: KEY_LED_RESET */ \ + MUX_VAL(CP(GPIO129), (IEN | PTD | DIS | M4)) /* GPIO_129: MODEM_AP_WAKE */ + +#endif diff --git a/configs/sniper_defconfig b/configs/sniper_defconfig new file mode 100644 index 0000000..d2e10a9 --- /dev/null +++ b/configs/sniper_defconfig @@ -0,0 +1,7 @@ +CONFIG_ARM=y +CONFIG_OMAP34XX=y +CONFIG_TARGET_SNIPER=y +CONFIG_SPL=y +# CONFIG_CMD_IMLS is not set +# CONFIG_CMD_FLASH is not set +# CONFIG_CMD_FPGA is not set diff --git a/include/configs/sniper.h b/include/configs/sniper.h new file mode 100644 index 0000000..ef7a2bf --- /dev/null +++ b/include/configs/sniper.h @@ -0,0 +1,265 @@ +/* + * LG Optimus Black (P970) codename sniper config + * + * Copyright (C) 2015 Paul Kocialkowski contact@paulk.fr + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +#ifndef __CONFIG_H +#define __CONFIG_H + +#include <asm/arch/cpu.h> +#include <asm/arch/omap.h> + +/* + * CPU + */ + +#define CONFIG_SYS_CACHELINE_SIZE 64 + +#define CONFIG_ARM_ARCH_CP15_ERRATA +#define CONFIG_ARM_ERRATA_454179 +#define CONFIG_ARM_ERRATA_430973 +#define CONFIG_ARM_ERRATA_621766 + +/* + * Platform + */ + +#define CONFIG_OMAP +#define CONFIG_OMAP_COMMON + +/* + * Board + */ + +#define CONFIG_SYS_GENERIC_BOARD + +/* + * Clocks + */ + +#define CONFIG_SYS_TIMERBASE OMAP34XX_GPT2 +#define CONFIG_SYS_PTV 2 + +#define V_NS16550_CLK 48000000 +#define V_OSCK 26000000 +#define V_SCLK (V_OSCK >> 1) + +/* + * DRAM + */ + +#define CONFIG_SDRC +#define CONFIG_NR_DRAM_BANKS 2 +#define PHYS_SDRAM_1 OMAP34XX_SDRC_CS0 +#define PHYS_SDRAM_2 OMAP34XX_SDRC_CS1 + +/* + * Memory + */ + +#define CONFIG_SYS_TEXT_BASE 0x80100000 +#define CONFIG_SYS_SDRAM_BASE OMAP34XX_SDRC_CS0 +#define CONFIG_SYS_INIT_RAM_ADDR 0x4020F800 +#define CONFIG_SYS_INIT_RAM_SIZE 0x800 +#define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SYS_INIT_RAM_ADDR + \ + CONFIG_SYS_INIT_RAM_SIZE - \ + GENERATED_GBL_DATA_SIZE) + +#define CONFIG_SYS_MALLOC_LEN (1024 * 1024 + CONFIG_ENV_SIZE) + +/* + * GPIO + */ + +#define CONFIG_OMAP_GPIO +#define CONFIG_OMAP3_GPIO_2 +#define CONFIG_OMAP3_GPIO_3 +#define CONFIG_OMAP3_GPIO_4 +#define CONFIG_OMAP3_GPIO_5 +#define CONFIG_OMAP3_GPIO_6 + +/* + * I2C + */ + +#define CONFIG_SYS_I2C +#define CONFIG_SYS_OMAP24_I2C_SPEED 400000 +#define CONFIG_SYS_OMAP24_I2C_SLAVE 1 +#define CONFIG_SYS_I2C_OMAP34XX +#define CONFIG_I2C_MULTI_BUS + +#define CONFIG_CMD_I2C + +/* + * Flash + */ + +#define CONFIG_SYS_NO_FLASH + +/* + * MMC + */ + +#define CONFIG_GENERIC_MMC +#define CONFIG_MMC +#define CONFIG_OMAP_HSMMC + +#define CONFIG_CMD_MMC + +/* + * Power + */ + +#define CONFIG_TWL4030_POWER + +/* + * Input + */ + +#define CONFIG_TWL4030_INPUT + +/* + * Partitions + */ + +#define CONFIG_PARTITION_UUIDS +#define CONFIG_DOS_PARTITION +#define CONFIG_EFI_PARTITION + +#define CONFIG_CMD_PART + +/* + * Filesystems + */ + +#define CONFIG_CMD_FS_GENERIC +#define CONFIG_CMD_EXT2 +#define CONFIG_CMD_EXT4 +#define CONFIG_CMD_FAT + +/* + * SPL + */ + +#define CONFIG_SPL_FRAMEWORK + +#define CONFIG_SPL_TEXT_BASE 0x40200000 +#define CONFIG_SPL_MAX_SIZE (54 * 1024) +#define CONFIG_SPL_BSS_START_ADDR 0x80000000 +#define CONFIG_SPL_BSS_MAX_SIZE (512 * 1024) +#define CONFIG_SYS_SPL_MALLOC_START 0x80208000 +#define CONFIG_SYS_SPL_MALLOC_SIZE (1024 * 1024) +#define CONFIG_SPL_STACK LOW_LEVEL_SRAM_STACK + +#define CONFIG_SPL_LDSCRIPT "$(CPUDIR)/omap-common/u-boot-spl.lds" +#define CONFIG_SPL_BOARD_INIT + +#define CONFIG_SPL_LIBGENERIC_SUPPORT +#define CONFIG_SPL_LIBCOMMON_SUPPORT +#define CONFIG_SPL_LIBDISK_SUPPORT +#define CONFIG_SPL_SERIAL_SUPPORT +#define CONFIG_SPL_POWER_SUPPORT +#define CONFIG_SPL_GPIO_SUPPORT +#define CONFIG_SPL_I2C_SUPPORT +#define CONFIG_SPL_MMC_SUPPORT +#define CONFIG_SPL_FAT_SUPPORT + +#define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_PARTITION 2 + +#define CONFIG_SYS_MMCSD_FS_BOOT_PARTITION 1 +#define CONFIG_SPL_FS_LOAD_PAYLOAD_NAME "u-boot.img" + +/* + * Console + */ + +#define CONFIG_SYS_CONSOLE_IS_IN_ENV + +#define CONFIG_DISPLAY_CPUINFO +#define CONFIG_DISPLAY_BOARDINFO + +#define CONFIG_AUTO_COMPLETE + +#define CONFIG_SYS_PROMPT "Sniper # " +#define CONFIG_SYS_LONGHELP +#define CONFIG_SYS_HUSH_PARSER + +#define CONFIG_SYS_MAXARGS 16 +#define CONFIG_SYS_CBSIZE 512 +#define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT) \ + + 16) + +/* + * Serial + */ + + +#ifndef CONFIG_SPL_BUILD +#define CONFIG_OMAP_SERIAL +#else +#define CONFIG_SYS_NS16550_SERIAL +#define CONFIG_SYS_NS16550_REG_SIZE (-4) +#define CONFIG_SYS_NS16550_CLK V_NS16550_CLK +#endif + +#define CONFIG_SYS_NS16550 +#define CONFIG_SYS_NS16550_COM3 OMAP34XX_UART3 +#define CONFIG_CONS_INDEX 3 +#define CONFIG_SERIAL3 3 + +#define CONFIG_BAUDRATE 115200 +#define CONFIG_SYS_BAUDRATE_TABLE { 4800, 9600, 19200, 38400, 57600, \ + 115200 } + +/* + * Environment + */ + +#define CONFIG_ENV_SIZE (128 * 1024) +#define CONFIG_ENV_IS_NOWHERE + +#define CONFIG_ENV_OVERWRITE + +#define CONFIG_EXTRA_ENV_SETTINGS \ + "kernel_addr_r=0x82000000\0" \ + "boot_mmc_dev=0\0" \ + "kernel_mmc_part=3\0" \ + "recovery_mmc_part=4\0" \ + "bootargs=console=ttyO2 vram=5M,0x9FA00000 omapfb.vram=0:5M\0" + +/* + * ATAGs + */ + +#define CONFIG_SETUP_MEMORY_TAGS +#define CONFIG_CMDLINE_TAG +#define CONFIG_INITRD_TAG +#define CONFIG_REVISION_TAG + +/* + * Boot + */ + +#define CONFIG_SYS_LOAD_ADDR 0x82000000 +#define CONFIG_BOOTDELAY 1 + +#define CONFIG_ANDROID_BOOT_IMAGE + +#define CONFIG_BOOTCOMMAND \ + "setenv boot_mmc_part ${kernel_mmc_part}; " \ + "part start mmc ${boot_mmc_dev} ${boot_mmc_part} boot_mmc_start; " \ + "part size mmc ${boot_mmc_dev} ${boot_mmc_part} boot_mmc_size; " \ + "mmc dev ${boot_mmc_dev}; " \ + "mmc read ${kernel_addr_r} ${boot_mmc_start} ${boot_mmc_size} && " \ + "bootm ${kernel_addr_r};" + +/* + * Defaults + */ + +#include <config_defaults.h> + +#endif

On Mon, Jul 20, 2015 at 03:17:11PM +0200, Paul Kocialkowski wrote:
The LG Optimus Black (P970) codename sniper is a smartphone that was designed and manufactured by LG Electronics (LGE) and released back in 2011.
It is using an OMAP3630 SoC GP version, which allows running U-Boot and the U-Boot SPL from the ground up. This port is aimed at running an Android version such as Replicant, the fully free Android distribution. However, support for upstream Linux with device-tree and common GNU/Linux distros boot commands could be added in the future.
For more information about the journey to freeing this device, please read the series of blog posts at: http://code.paulk.fr/article20/a-hacker-s-journey-freeing-a-phone-from-the-g...
Signed-off-by: Paul Kocialkowski contact@paulk.fr
Reviewed-by: Tom Rini trini@konsulko.com

On Mon, Jul 20, 2015 at 03:17:11PM +0200, Paul Kocialkowski wrote:
The LG Optimus Black (P970) codename sniper is a smartphone that was designed and manufactured by LG Electronics (LGE) and released back in 2011.
It is using an OMAP3630 SoC GP version, which allows running U-Boot and the U-Boot SPL from the ground up. This port is aimed at running an Android version such as Replicant, the fully free Android distribution. However, support for upstream Linux with device-tree and common GNU/Linux distros boot commands could be added in the future.
For more information about the journey to freeing this device, please read the series of blog posts at: http://code.paulk.fr/article20/a-hacker-s-journey-freeing-a-phone-from-the-g...
Signed-off-by: Paul Kocialkowski contact@paulk.fr Reviewed-by: Tom Rini trini@konsulko.com
Applied to u-boot/master, thanks!

This adds support for the omap3 reboot mode mechanism and exports the reboot mode via an environment variable, that is used in the boot command to make it possible to boot from the recovery partition.
Signed-off-by: Paul Kocialkowski contact@paulk.fr --- board/lge/sniper/sniper.c | 18 ++++++++++++++++++ include/configs/sniper.h | 3 +++ 2 files changed, 21 insertions(+)
diff --git a/board/lge/sniper/sniper.c b/board/lge/sniper/sniper.c index d5318c4..44d422d 100644 --- a/board/lge/sniper/sniper.c +++ b/board/lge/sniper/sniper.c @@ -9,6 +9,7 @@ #include <config.h> #include <common.h> #include <dm.h> +#include <linux/ctype.h> #include <asm/arch/mmc_host_def.h> #include <asm/arch/sys_proto.h> #include <asm/arch/mem.h> @@ -67,6 +68,23 @@ int board_init(void) return 0; }
+int misc_init_r(void) +{ + char reboot_mode[2] = { 0 }; + + /* Reboot mode */ + + reboot_mode[0] = omap_reboot_mode(); + if (reboot_mode[0] > 0 && isascii(reboot_mode[0])) { + if (!getenv("reboot-mode")) + setenv("reboot-mode", (char *)reboot_mode); + + omap_reboot_mode_clear(); + } + + return 0; +} + void set_muxconf_regs(void) { MUX_SNIPER(); diff --git a/include/configs/sniper.h b/include/configs/sniper.h index ef7a2bf..eb1252d 100644 --- a/include/configs/sniper.h +++ b/include/configs/sniper.h @@ -35,6 +35,7 @@ */
#define CONFIG_SYS_GENERIC_BOARD +#define CONFIG_MISC_INIT_R
/* * Clocks @@ -250,6 +251,8 @@
#define CONFIG_BOOTCOMMAND \ "setenv boot_mmc_part ${kernel_mmc_part}; " \ + "if test reboot-${reboot-mode} = reboot-r; then " \ + "echo recovery; setenv boot_mmc_part ${recovery_mmc_part}; fi; " \ "part start mmc ${boot_mmc_dev} ${boot_mmc_part} boot_mmc_start; " \ "part size mmc ${boot_mmc_dev} ${boot_mmc_part} boot_mmc_size; " \ "mmc dev ${boot_mmc_dev}; " \

On Mon, Jul 20, 2015 at 03:17:12PM +0200, Paul Kocialkowski wrote:
This adds support for the omap3 reboot mode mechanism and exports the reboot mode via an environment variable, that is used in the boot command to make it possible to boot from the recovery partition.
Signed-off-by: Paul Kocialkowski contact@paulk.fr
Reviewed-by: Tom Rini trini@konsulko.com

On Mon, Jul 20, 2015 at 03:17:12PM +0200, Paul Kocialkowski wrote:
This adds support for the omap3 reboot mode mechanism and exports the reboot mode via an environment variable, that is used in the boot command to make it possible to boot from the recovery partition.
Signed-off-by: Paul Kocialkowski contact@paulk.fr Reviewed-by: Tom Rini trini@konsulko.com
Applied to u-boot/master, thanks!

The OMAP3 has some die-specific ID bits that we can use to give the device a (more or less) unique serial number. This is particularly useful for e.g. USB.
Signed-off-by: Paul Kocialkowski contact@paulk.fr --- board/lge/sniper/sniper.c | 13 +++++++++++++ 1 file changed, 13 insertions(+)
diff --git a/board/lge/sniper/sniper.c b/board/lge/sniper/sniper.c index 44d422d..f26855d 100644 --- a/board/lge/sniper/sniper.c +++ b/board/lge/sniper/sniper.c @@ -70,7 +70,9 @@ int board_init(void)
int misc_init_r(void) { + char serial_string[17] = { 0 }; char reboot_mode[2] = { 0 }; + u32 dieid[4] = { 0 };
/* Reboot mode */
@@ -82,6 +84,17 @@ int misc_init_r(void) omap_reboot_mode_clear(); }
+ /* Serial number */ + + get_dieid((u32 *)&dieid); + + if (!getenv("serial#")) { + snprintf(serial_string, sizeof(serial_string), + "%08x%08x", dieid[0], dieid[3]); + + setenv("serial#", serial_string); + } + return 0; }

On Mon, Jul 20, 2015 at 03:17:13PM +0200, Paul Kocialkowski wrote:
The OMAP3 has some die-specific ID bits that we can use to give the device a (more or less) unique serial number. This is particularly useful for e.g. USB.
Signed-off-by: Paul Kocialkowski contact@paulk.fr
board/lge/sniper/sniper.c | 13 +++++++++++++ 1 file changed, 13 insertions(+)
diff --git a/board/lge/sniper/sniper.c b/board/lge/sniper/sniper.c index 44d422d..f26855d 100644 --- a/board/lge/sniper/sniper.c +++ b/board/lge/sniper/sniper.c @@ -70,7 +70,9 @@ int board_init(void)
int misc_init_r(void) {
char serial_string[17] = { 0 }; char reboot_mode[2] = { 0 };
u32 dieid[4] = { 0 };
/* Reboot mode */
@@ -82,6 +84,17 @@ int misc_init_r(void) omap_reboot_mode_clear(); }
- /* Serial number */
- get_dieid((u32 *)&dieid);
- if (!getenv("serial#")) {
snprintf(serial_string, sizeof(serial_string),
"%08x%08x", dieid[0], dieid[3]);
setenv("serial#", serial_string);
- }
- return 0;
}
Shouldn't this be in more generic code so everyone gets this set now? Thanks!

Le lundi 03 août 2015 à 22:08 -0400, Tom Rini a écrit :
On Mon, Jul 20, 2015 at 03:17:13PM +0200, Paul Kocialkowski wrote:
The OMAP3 has some die-specific ID bits that we can use to give the device a (more or less) unique serial number. This is particularly useful for e.g. USB.
Signed-off-by: Paul Kocialkowski contact@paulk.fr
board/lge/sniper/sniper.c | 13 +++++++++++++ 1 file changed, 13 insertions(+)
diff --git a/board/lge/sniper/sniper.c b/board/lge/sniper/sniper.c index 44d422d..f26855d 100644 --- a/board/lge/sniper/sniper.c +++ b/board/lge/sniper/sniper.c @@ -70,7 +70,9 @@ int board_init(void)
int misc_init_r(void) {
char serial_string[17] = { 0 }; char reboot_mode[2] = { 0 };
u32 dieid[4] = { 0 };
/* Reboot mode */
@@ -82,6 +84,17 @@ int misc_init_r(void) omap_reboot_mode_clear(); }
- /* Serial number */
- get_dieid((u32 *)&dieid);
- if (!getenv("serial#")) {
snprintf(serial_string, sizeof(serial_string),
"%08x%08x", dieid[0], dieid[3]);
setenv("serial#", serial_string);
- }
- return 0;
}
Shouldn't this be in more generic code so everyone gets this set now? Thanks!
Well, we had a similar discussion for sunxi, and the outcome was that serial number could be obtained from other places on other devices (e.g. EEPROM) or be calculated from the dieid bits in a different way, so I prefer to keep this board-specific instead of omap3-generic for now.
This merely matches what is done on Android OMAP devices, but one could do it another way, too.
What do you think?

On Tue, Aug 04, 2015 at 08:02:40PM +0200, Paul Kocialkowski wrote:
Le lundi 03 août 2015 à 22:08 -0400, Tom Rini a écrit :
On Mon, Jul 20, 2015 at 03:17:13PM +0200, Paul Kocialkowski wrote:
The OMAP3 has some die-specific ID bits that we can use to give the device a (more or less) unique serial number. This is particularly useful for e.g. USB.
Signed-off-by: Paul Kocialkowski contact@paulk.fr
board/lge/sniper/sniper.c | 13 +++++++++++++ 1 file changed, 13 insertions(+)
diff --git a/board/lge/sniper/sniper.c b/board/lge/sniper/sniper.c index 44d422d..f26855d 100644 --- a/board/lge/sniper/sniper.c +++ b/board/lge/sniper/sniper.c @@ -70,7 +70,9 @@ int board_init(void)
int misc_init_r(void) {
char serial_string[17] = { 0 }; char reboot_mode[2] = { 0 };
u32 dieid[4] = { 0 };
/* Reboot mode */
@@ -82,6 +84,17 @@ int misc_init_r(void) omap_reboot_mode_clear(); }
- /* Serial number */
- get_dieid((u32 *)&dieid);
- if (!getenv("serial#")) {
snprintf(serial_string, sizeof(serial_string),
"%08x%08x", dieid[0], dieid[3]);
setenv("serial#", serial_string);
- }
- return 0;
}
Shouldn't this be in more generic code so everyone gets this set now? Thanks!
Well, we had a similar discussion for sunxi, and the outcome was that serial number could be obtained from other places on other devices (e.g. EEPROM) or be calculated from the dieid bits in a different way, so I prefer to keep this board-specific instead of omap3-generic for now.
This merely matches what is done on Android OMAP devices, but one could do it another way, too.
What do you think?
I think, ug, arch/arm/cpu/armv7/omap-common/utils.c::usb_set_serial_num_from_die_id() should be called set_serial_num_from_die_id() and we can use that for this board too even if it's not ideal.

Le mardi 04 août 2015 à 14:16 -0400, Tom Rini a écrit :
On Tue, Aug 04, 2015 at 08:02:40PM +0200, Paul Kocialkowski wrote:
Le lundi 03 août 2015 à 22:08 -0400, Tom Rini a écrit :
On Mon, Jul 20, 2015 at 03:17:13PM +0200, Paul Kocialkowski wrote:
The OMAP3 has some die-specific ID bits that we can use to give the device a (more or less) unique serial number. This is particularly useful for e.g. USB.
Signed-off-by: Paul Kocialkowski contact@paulk.fr
board/lge/sniper/sniper.c | 13 +++++++++++++ 1 file changed, 13 insertions(+)
diff --git a/board/lge/sniper/sniper.c b/board/lge/sniper/sniper.c index 44d422d..f26855d 100644 --- a/board/lge/sniper/sniper.c +++ b/board/lge/sniper/sniper.c @@ -70,7 +70,9 @@ int board_init(void)
int misc_init_r(void) {
char serial_string[17] = { 0 }; char reboot_mode[2] = { 0 };
u32 dieid[4] = { 0 };
/* Reboot mode */
@@ -82,6 +84,17 @@ int misc_init_r(void) omap_reboot_mode_clear(); }
- /* Serial number */
- get_dieid((u32 *)&dieid);
- if (!getenv("serial#")) {
snprintf(serial_string, sizeof(serial_string),
"%08x%08x", dieid[0], dieid[3]);
setenv("serial#", serial_string);
- }
- return 0;
}
Shouldn't this be in more generic code so everyone gets this set now? Thanks!
Well, we had a similar discussion for sunxi, and the outcome was that serial number could be obtained from other places on other devices (e.g. EEPROM) or be calculated from the dieid bits in a different way, so I prefer to keep this board-specific instead of omap3-generic for now.
This merely matches what is done on Android OMAP devices, but one could do it another way, too.
What do you think?
I think, ug, arch/arm/cpu/armv7/omap-common/utils.c::usb_set_serial_num_from_die_id() should be called set_serial_num_from_die_id() and we can use that for this board too even if it's not ideal.
Oh okay then, I don't have any problem with making this code common, especially if it's not called by every omap3 board then.
I agree with your proposal. Should I submit a v2 with a patch in that direction?

On Tue, Aug 04, 2015 at 08:22:39PM +0200, Paul Kocialkowski wrote:
Le mardi 04 août 2015 à 14:16 -0400, Tom Rini a écrit :
On Tue, Aug 04, 2015 at 08:02:40PM +0200, Paul Kocialkowski wrote:
Le lundi 03 août 2015 à 22:08 -0400, Tom Rini a écrit :
On Mon, Jul 20, 2015 at 03:17:13PM +0200, Paul Kocialkowski wrote:
The OMAP3 has some die-specific ID bits that we can use to give the device a (more or less) unique serial number. This is particularly useful for e.g. USB.
Signed-off-by: Paul Kocialkowski contact@paulk.fr
board/lge/sniper/sniper.c | 13 +++++++++++++ 1 file changed, 13 insertions(+)
diff --git a/board/lge/sniper/sniper.c b/board/lge/sniper/sniper.c index 44d422d..f26855d 100644 --- a/board/lge/sniper/sniper.c +++ b/board/lge/sniper/sniper.c @@ -70,7 +70,9 @@ int board_init(void)
int misc_init_r(void) {
char serial_string[17] = { 0 }; char reboot_mode[2] = { 0 };
u32 dieid[4] = { 0 };
/* Reboot mode */
@@ -82,6 +84,17 @@ int misc_init_r(void) omap_reboot_mode_clear(); }
- /* Serial number */
- get_dieid((u32 *)&dieid);
- if (!getenv("serial#")) {
snprintf(serial_string, sizeof(serial_string),
"%08x%08x", dieid[0], dieid[3]);
setenv("serial#", serial_string);
- }
- return 0;
}
Shouldn't this be in more generic code so everyone gets this set now? Thanks!
Well, we had a similar discussion for sunxi, and the outcome was that serial number could be obtained from other places on other devices (e.g. EEPROM) or be calculated from the dieid bits in a different way, so I prefer to keep this board-specific instead of omap3-generic for now.
This merely matches what is done on Android OMAP devices, but one could do it another way, too.
What do you think?
I think, ug, arch/arm/cpu/armv7/omap-common/utils.c::usb_set_serial_num_from_die_id() should be called set_serial_num_from_die_id() and we can use that for this board too even if it's not ideal.
Oh okay then, I don't have any problem with making this code common, especially if it's not called by every omap3 board then.
I agree with your proposal. Should I submit a v2 with a patch in that direction?
Sounds good, thanks!

Le mardi 04 août 2015 à 14:27 -0400, Tom Rini a écrit :
On Tue, Aug 04, 2015 at 08:22:39PM +0200, Paul Kocialkowski wrote:
Le mardi 04 août 2015 à 14:16 -0400, Tom Rini a écrit :
On Tue, Aug 04, 2015 at 08:02:40PM +0200, Paul Kocialkowski wrote:
Le lundi 03 août 2015 à 22:08 -0400, Tom Rini a écrit :
On Mon, Jul 20, 2015 at 03:17:13PM +0200, Paul Kocialkowski wrote:
The OMAP3 has some die-specific ID bits that we can use to give the device a (more or less) unique serial number. This is particularly useful for e.g. USB.
Signed-off-by: Paul Kocialkowski contact@paulk.fr
board/lge/sniper/sniper.c | 13 +++++++++++++ 1 file changed, 13 insertions(+)
diff --git a/board/lge/sniper/sniper.c b/board/lge/sniper/sniper.c index 44d422d..f26855d 100644 --- a/board/lge/sniper/sniper.c +++ b/board/lge/sniper/sniper.c @@ -70,7 +70,9 @@ int board_init(void)
int misc_init_r(void) {
char serial_string[17] = { 0 }; char reboot_mode[2] = { 0 };
u32 dieid[4] = { 0 };
/* Reboot mode */
@@ -82,6 +84,17 @@ int misc_init_r(void) omap_reboot_mode_clear(); }
- /* Serial number */
- get_dieid((u32 *)&dieid);
- if (!getenv("serial#")) {
snprintf(serial_string, sizeof(serial_string),
"%08x%08x", dieid[0], dieid[3]);
setenv("serial#", serial_string);
- }
- return 0;
}
Shouldn't this be in more generic code so everyone gets this set now? Thanks!
Well, we had a similar discussion for sunxi, and the outcome was that serial number could be obtained from other places on other devices (e.g. EEPROM) or be calculated from the dieid bits in a different way, so I prefer to keep this board-specific instead of omap3-generic for now.
This merely matches what is done on Android OMAP devices, but one could do it another way, too.
What do you think?
I think, ug, arch/arm/cpu/armv7/omap-common/utils.c::usb_set_serial_num_from_die_id() should be called set_serial_num_from_die_id() and we can use that for this board too even if it's not ideal.
Oh okay then, I don't have any problem with making this code common, especially if it's not called by every omap3 board then.
I agree with your proposal. Should I submit a v2 with a patch in that direction?
Sounds good, thanks!
Taking a closer look at things, it appears that various (non-omap3) boards are grabbing the Die ID bits on their own and then calling those functions (usb_fake_mac_from_die_id, usb_set_serial_num_from_die_id).
IMHO, we should have a common naming scheme for the function to get the dieid (omap_dieid), define that for each omap platform and have it called in omap-common code (with one function for the serial number and one for the fake mac), just like what I did with omap_sys_boot_device.
Then, each board would simply call those functions directly, without having to care about how to obtain the die id bits.
This seems like a series that would deserve to live on its own, so I suggest that you merge Optimus Black support as-is for now and I'll submit another series to implement that behaviour on top.
What do you think?

On Fri, Aug 07, 2015 at 11:44:46AM +0200, Paul Kocialkowski wrote:
Le mardi 04 août 2015 à 14:27 -0400, Tom Rini a écrit :
On Tue, Aug 04, 2015 at 08:22:39PM +0200, Paul Kocialkowski wrote:
Le mardi 04 août 2015 à 14:16 -0400, Tom Rini a écrit :
On Tue, Aug 04, 2015 at 08:02:40PM +0200, Paul Kocialkowski wrote:
Le lundi 03 août 2015 à 22:08 -0400, Tom Rini a écrit :
On Mon, Jul 20, 2015 at 03:17:13PM +0200, Paul Kocialkowski wrote:
> The OMAP3 has some die-specific ID bits that we can use to give the device a > (more or less) unique serial number. This is particularly useful for e.g. USB. > > Signed-off-by: Paul Kocialkowski contact@paulk.fr > --- > board/lge/sniper/sniper.c | 13 +++++++++++++ > 1 file changed, 13 insertions(+) > > diff --git a/board/lge/sniper/sniper.c b/board/lge/sniper/sniper.c > index 44d422d..f26855d 100644 > --- a/board/lge/sniper/sniper.c > +++ b/board/lge/sniper/sniper.c > @@ -70,7 +70,9 @@ int board_init(void) > > int misc_init_r(void) > { > + char serial_string[17] = { 0 }; > char reboot_mode[2] = { 0 }; > + u32 dieid[4] = { 0 }; > > /* Reboot mode */ > > @@ -82,6 +84,17 @@ int misc_init_r(void) > omap_reboot_mode_clear(); > } > > + /* Serial number */ > + > + get_dieid((u32 *)&dieid); > + > + if (!getenv("serial#")) { > + snprintf(serial_string, sizeof(serial_string), > + "%08x%08x", dieid[0], dieid[3]); > + > + setenv("serial#", serial_string); > + } > + > return 0; > }
Shouldn't this be in more generic code so everyone gets this set now? Thanks!
Well, we had a similar discussion for sunxi, and the outcome was that serial number could be obtained from other places on other devices (e.g. EEPROM) or be calculated from the dieid bits in a different way, so I prefer to keep this board-specific instead of omap3-generic for now.
This merely matches what is done on Android OMAP devices, but one could do it another way, too.
What do you think?
I think, ug, arch/arm/cpu/armv7/omap-common/utils.c::usb_set_serial_num_from_die_id() should be called set_serial_num_from_die_id() and we can use that for this board too even if it's not ideal.
Oh okay then, I don't have any problem with making this code common, especially if it's not called by every omap3 board then.
I agree with your proposal. Should I submit a v2 with a patch in that direction?
Sounds good, thanks!
Taking a closer look at things, it appears that various (non-omap3) boards are grabbing the Die ID bits on their own and then calling those functions (usb_fake_mac_from_die_id, usb_set_serial_num_from_die_id).
IMHO, we should have a common naming scheme for the function to get the dieid (omap_dieid), define that for each omap platform and have it called in omap-common code (with one function for the serial number and one for the fake mac), just like what I did with omap_sys_boot_device.
Then, each board would simply call those functions directly, without having to care about how to obtain the die id bits.
This seems like a series that would deserve to live on its own, so I suggest that you merge Optimus Black support as-is for now and I'll submit another series to implement that behaviour on top.
What do you think?
Yes, OK, follow-up series to clean-up that for everyone.

Le jeudi 13 août 2015 à 08:13 -0400, Tom Rini a écrit :
On Fri, Aug 07, 2015 at 11:44:46AM +0200, Paul Kocialkowski wrote:
Le mardi 04 août 2015 à 14:27 -0400, Tom Rini a écrit :
On Tue, Aug 04, 2015 at 08:22:39PM +0200, Paul Kocialkowski wrote:
Le mardi 04 août 2015 à 14:16 -0400, Tom Rini a écrit :
On Tue, Aug 04, 2015 at 08:02:40PM +0200, Paul Kocialkowski wrote:
Le lundi 03 août 2015 à 22:08 -0400, Tom Rini a écrit : > On Mon, Jul 20, 2015 at 03:17:13PM +0200, Paul > Kocialkowski wrote: > > > The OMAP3 has some die-specific ID bits that we can use > > to give the device a > > (more or less) unique serial number. This is > > particularly useful for e.g. USB. > > > > Signed-off-by: Paul Kocialkowski contact@paulk.fr > > --- > > board/lge/sniper/sniper.c | 13 +++++++++++++ > > 1 file changed, 13 insertions(+) > > > > diff --git a/board/lge/sniper/sniper.c > > b/board/lge/sniper/sniper.c > > index 44d422d..f26855d 100644 > > --- a/board/lge/sniper/sniper.c > > +++ b/board/lge/sniper/sniper.c > > @@ -70,7 +70,9 @@ int board_init(void) > > > > int misc_init_r(void) > > { > > + char serial_string[17] = { 0 }; > > char reboot_mode[2] = { 0 }; > > + u32 dieid[4] = { 0 }; > > > > /* Reboot mode */ > > > > @@ -82,6 +84,17 @@ int misc_init_r(void) > > omap_reboot_mode_clear(); > > } > > > > + /* Serial number */ > > + > > + get_dieid((u32 *)&dieid); > > + > > + if (!getenv("serial#")) { > > + snprintf(serial_string, > > sizeof(serial_string), > > + "%08x%08x", dieid[0], > > dieid[3]); > > + > > + setenv("serial#", serial_string); > > + } > > + > > return 0; > > } > > Shouldn't this be in more generic code so everyone gets > this set now? > Thanks!
Well, we had a similar discussion for sunxi, and the outcome was that serial number could be obtained from other places on other devices (e.g. EEPROM) or be calculated from the dieid bits in a different way, so I prefer to keep this board-specific instead of omap3-generic for now.
This merely matches what is done on Android OMAP devices, but one could do it another way, too.
What do you think?
I think, ug, arch/arm/cpu/armv7/omap -common/utils.c::usb_set_serial_num_from_die_id() should be called set_serial_num_from_die_id() and we can use that for this board too even if it's not ideal.
Oh okay then, I don't have any problem with making this code common, especially if it's not called by every omap3 board then.
I agree with your proposal. Should I submit a v2 with a patch in that direction?
Sounds good, thanks!
Taking a closer look at things, it appears that various (non-omap3) boards are grabbing the Die ID bits on their own and then calling those functions (usb_fake_mac_from_die_id, usb_set_serial_num_from_die_id).
IMHO, we should have a common naming scheme for the function to get the dieid (omap_dieid), define that for each omap platform and have it called in omap-common code (with one function for the serial number and one for the fake mac), just like what I did with omap_sys_boot_device.
Then, each board would simply call those functions directly, without having to care about how to obtain the die id bits.
This seems like a series that would deserve to live on its own, so I suggest that you merge Optimus Black support as-is for now and I'll submit another series to implement that behaviour on top.
What do you think?
Yes, OK, follow-up series to clean-up that for everyone.
Good, thanks for merging this, I'll get around producing that series sometime next week, I'm at CCCamp for now!

On Mon, Jul 20, 2015 at 03:17:13PM +0200, Paul Kocialkowski wrote:
The OMAP3 has some die-specific ID bits that we can use to give the device a (more or less) unique serial number. This is particularly useful for e.g. USB.
Signed-off-by: Paul Kocialkowski contact@paulk.fr
Applied to u-boot/master, thanks!

Now that the serial number is correctly defined, we can pass it to the kernel using the (legacy) ATAG method. It will be automatically passed via device-tree when enabled.
Signed-off-by: Paul Kocialkowski contact@paulk.fr --- board/lge/sniper/sniper.c | 18 ++++++++++++++++++ include/configs/sniper.h | 1 + 2 files changed, 19 insertions(+)
diff --git a/board/lge/sniper/sniper.c b/board/lge/sniper/sniper.c index f26855d..b211528 100644 --- a/board/lge/sniper/sniper.c +++ b/board/lge/sniper/sniper.c @@ -98,6 +98,24 @@ int misc_init_r(void) return 0; }
+void get_board_serial(struct tag_serialnr *serialnr) +{ + char *serial_string; + unsigned long long serial; + + serial_string = getenv("serial#"); + + if (serial_string) { + serial = simple_strtoull(serial_string, NULL, 16); + + serialnr->high = (unsigned int) (serial >> 32); + serialnr->low = (unsigned int) (serial & 0xffffffff); + } else { + serialnr->high = 0; + serialnr->low = 0; + } +} + void set_muxconf_regs(void) { MUX_SNIPER(); diff --git a/include/configs/sniper.h b/include/configs/sniper.h index eb1252d..159ed4c 100644 --- a/include/configs/sniper.h +++ b/include/configs/sniper.h @@ -239,6 +239,7 @@ #define CONFIG_CMDLINE_TAG #define CONFIG_INITRD_TAG #define CONFIG_REVISION_TAG +#define CONFIG_SERIAL_TAG
/* * Boot

On Mon, Jul 20, 2015 at 03:17:14PM +0200, Paul Kocialkowski wrote:
Now that the serial number is correctly defined, we can pass it to the kernel using the (legacy) ATAG method. It will be automatically passed via device-tree when enabled.
Signed-off-by: Paul Kocialkowski contact@paulk.fr
Reviewed-by: Tom Rini trini@konsulko.com

On Mon, Jul 20, 2015 at 03:17:14PM +0200, Paul Kocialkowski wrote:
Now that the serial number is correctly defined, we can pass it to the kernel using the (legacy) ATAG method. It will be automatically passed via device-tree when enabled.
Signed-off-by: Paul Kocialkowski contact@paulk.fr Reviewed-by: Tom Rini trini@konsulko.com
Applied to u-boot/master, thanks!

This adds support for the fastboot USB gadget, including flashing to the internal MMC and reboot to bootloader or not.
Signed-off-by: Paul Kocialkowski contact@paulk.fr --- board/lge/sniper/sniper.c | 30 ++++++++++++++++++++++++++++++ include/configs/sniper.h | 39 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 69 insertions(+)
diff --git a/board/lge/sniper/sniper.c b/board/lge/sniper/sniper.c index b211528..2bfc9c5 100644 --- a/board/lge/sniper/sniper.c +++ b/board/lge/sniper/sniper.c @@ -10,6 +10,8 @@ #include <common.h> #include <dm.h> #include <linux/ctype.h> +#include <linux/usb/musb.h> +#include <asm/omap_musb.h> #include <asm/arch/mmc_host_def.h> #include <asm/arch/sys_proto.h> #include <asm/arch/mem.h> @@ -37,6 +39,25 @@ U_BOOT_DEVICE(sniper_serial) = { .platdata = &serial_omap_platdata };
+static struct musb_hdrc_config musb_config = { + .multipoint = 1, + .dyn_fifo = 1, + .num_eps = 16, + .ram_bits = 12 +}; + +static struct omap_musb_board_data musb_board_data = { + .interface_type = MUSB_INTERFACE_ULPI, +}; + +static struct musb_hdrc_platform_data musb_platform_data = { + .mode = MUSB_PERIPHERAL, + .config = &musb_config, + .power = 100, + .platform_ops = &omap2430_ops, + .board_data = &musb_board_data, +}; + #ifdef CONFIG_SPL_BUILD void get_board_mem_timings(struct board_sdrc_timings *timings) { @@ -95,6 +116,10 @@ int misc_init_r(void) setenv("serial#", serial_string); }
+ /* MUSB */ + + musb_register(&musb_platform_data, &musb_board_data, (void *)MUSB_BASE); + return 0; }
@@ -116,6 +141,11 @@ void get_board_serial(struct tag_serialnr *serialnr) } }
+int fb_set_reboot_flag(void) +{ + return omap_reboot_mode_store('b'); +} + void set_muxconf_regs(void) { MUX_SNIPER(); diff --git a/include/configs/sniper.h b/include/configs/sniper.h index 159ed4c..4b330bc 100644 --- a/include/configs/sniper.h +++ b/include/configs/sniper.h @@ -216,6 +216,43 @@ 115200 }
/* + * USB gadget + */ + +#define CONFIG_MUSB_GADGET +#define CONFIG_MUSB_PIO_ONLY +#define CONFIG_USB_MUSB_OMAP2PLUS +#define CONFIG_TWL4030_USB + +#define CONFIG_USB_GADGET +#define CONFIG_USB_GADGET_DUALSPEED +#define CONFIG_USB_GADGET_VBUS_DRAW 0 + +/* + * Download + */ + +#define CONFIG_USB_GADGET_DOWNLOAD + +#define CONFIG_G_DNL_VENDOR_NUM 0x0451 +#define CONFIG_G_DNL_PRODUCT_NUM 0xd022 +#define CONFIG_G_DNL_MANUFACTURER "Texas Instruments" + +/* + * Fastboot + */ + +#define CONFIG_USB_FUNCTION_FASTBOOT + +#define CONFIG_FASTBOOT_BUF_ADDR CONFIG_SYS_LOAD_ADDR +#define CONFIG_FASTBOOT_BUF_SIZE 0x2000000 + +#define CONFIG_FASTBOOT_FLASH +#define CONFIG_FASTBOOT_FLASH_MMC_DEV 0 + +#define CONFIG_CMD_FASTBOOT + +/* * Environment */
@@ -254,6 +291,8 @@ "setenv boot_mmc_part ${kernel_mmc_part}; " \ "if test reboot-${reboot-mode} = reboot-r; then " \ "echo recovery; setenv boot_mmc_part ${recovery_mmc_part}; fi; " \ + "if test reboot-${reboot-mode} = reboot-b; then " \ + "echo fastboot; fastboot 0; fi; " \ "part start mmc ${boot_mmc_dev} ${boot_mmc_part} boot_mmc_start; " \ "part size mmc ${boot_mmc_dev} ${boot_mmc_part} boot_mmc_size; " \ "mmc dev ${boot_mmc_dev}; " \

On Mon, Jul 20, 2015 at 03:17:15PM +0200, Paul Kocialkowski wrote:
This adds support for the fastboot USB gadget, including flashing to the internal MMC and reboot to bootloader or not.
Signed-off-by: Paul Kocialkowski contact@paulk.fr
Reviewed-by: Tom Rini trini@konsulko.com

On Mon, Jul 20, 2015 at 03:17:15PM +0200, Paul Kocialkowski wrote:
This adds support for the fastboot USB gadget, including flashing to the internal MMC and reboot to bootloader or not.
Signed-off-by: Paul Kocialkowski contact@paulk.fr Reviewed-by: Tom Rini trini@konsulko.com
Applied to u-boot/master, thanks!

This adds support for resetting the device on a long press on the power button.
Signed-off-by: Paul Kocialkowski contact@paulk.fr --- board/lge/sniper/sniper.c | 4 ++++ 1 file changed, 4 insertions(+)
diff --git a/board/lge/sniper/sniper.c b/board/lge/sniper/sniper.c index 2bfc9c5..97c2ed0 100644 --- a/board/lge/sniper/sniper.c +++ b/board/lge/sniper/sniper.c @@ -95,6 +95,10 @@ int misc_init_r(void) char reboot_mode[2] = { 0 }; u32 dieid[4] = { 0 };
+ /* Power button reset init */ + + twl4030_power_reset_init(); + /* Reboot mode */
reboot_mode[0] = omap_reboot_mode();

On Mon, Jul 20, 2015 at 03:17:16PM +0200, Paul Kocialkowski wrote:
This adds support for resetting the device on a long press on the power button.
Signed-off-by: Paul Kocialkowski contact@paulk.fr
Reviewed-by: Tom Rini trini@konsulko.com

On Mon, Jul 20, 2015 at 03:17:16PM +0200, Paul Kocialkowski wrote:
This adds support for resetting the device on a long press on the power button.
Signed-off-by: Paul Kocialkowski contact@paulk.fr Reviewed-by: Tom Rini trini@konsulko.com
Applied to u-boot/master, thanks!

In most cases, userspace will attempt to power off the device with HALT instead of POWER_OFF, which triggers a reset instead of a proper power off from the TWL4030. Hence, it is up to the bootloader to actually turn the device off when there is no reason to turn it on.
A reboot identified with the OMAP reboot mode bits set is acceptable, as well as a power on reason from either the power button, USB or charger plug.
Other cases should trigger a power off. Note that for the U-Boot reset command to take effect, we have to fill-in the OMAP reboot bits.
Signed-off-by: Paul Kocialkowski contact@paulk.fr --- board/lge/sniper/sniper.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+)
diff --git a/board/lge/sniper/sniper.c b/board/lge/sniper/sniper.c index 97c2ed0..c94a3fa 100644 --- a/board/lge/sniper/sniper.c +++ b/board/lge/sniper/sniper.c @@ -94,6 +94,7 @@ int misc_init_r(void) char serial_string[17] = { 0 }; char reboot_mode[2] = { 0 }; u32 dieid[4] = { 0 }; + unsigned char data = 0;
/* Power button reset init */
@@ -107,6 +108,18 @@ int misc_init_r(void) setenv("reboot-mode", (char *)reboot_mode);
omap_reboot_mode_clear(); + } else { + /* + * When not rebooting, valid power on reasons are either the + * power button, charger plug or USB plug. + */ + + data |= twl4030_input_power_button(); + data |= twl4030_input_charger(); + data |= twl4030_input_usb(); + + if (!data) + twl4030_power_off(); }
/* Serial number */ @@ -145,6 +158,11 @@ void get_board_serial(struct tag_serialnr *serialnr) } }
+void reset_misc(void) +{ + omap_reboot_mode_store('u'); +} + int fb_set_reboot_flag(void) { return omap_reboot_mode_store('b');

On Mon, Jul 20, 2015 at 03:17:17PM +0200, Paul Kocialkowski wrote:
In most cases, userspace will attempt to power off the device with HALT instead of POWER_OFF, which triggers a reset instead of a proper power off from the TWL4030. Hence, it is up to the bootloader to actually turn the device off when there is no reason to turn it on.
A reboot identified with the OMAP reboot mode bits set is acceptable, as well as a power on reason from either the power button, USB or charger plug.
Other cases should trigger a power off. Note that for the U-Boot reset command to take effect, we have to fill-in the OMAP reboot bits.
Signed-off-by: Paul Kocialkowski contact@paulk.fr
Reviewed-by: Tom Rini trini@konsulko.com

On Mon, Jul 20, 2015 at 03:17:17PM +0200, Paul Kocialkowski wrote:
In most cases, userspace will attempt to power off the device with HALT instead of POWER_OFF, which triggers a reset instead of a proper power off from the TWL4030. Hence, it is up to the bootloader to actually turn the device off when there is no reason to turn it on.
A reboot identified with the OMAP reboot mode bits set is acceptable, as well as a power on reason from either the power button, USB or charger plug.
Other cases should trigger a power off. Note that for the U-Boot reset command to take effect, we have to fill-in the OMAP reboot bits.
Signed-off-by: Paul Kocialkowski contact@paulk.fr Reviewed-by: Tom Rini trini@konsulko.com
Applied to u-boot/master, thanks!

Using the twl4030 keypad allows booting directly into some special boot modes, such as recovery or fastboot. the VOL+ key will trigger a boot to recovery while the VOL- key will trigger a boot to fastboot.
The G (gesture) key remains unused at this point.
Signed-off-by: Paul Kocialkowski contact@paulk.fr --- board/lge/sniper/sniper.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+)
diff --git a/board/lge/sniper/sniper.c b/board/lge/sniper/sniper.c index c94a3fa..a43f640 100644 --- a/board/lge/sniper/sniper.c +++ b/board/lge/sniper/sniper.c @@ -91,18 +91,34 @@ int board_init(void)
int misc_init_r(void) { + unsigned char keypad_matrix[64] = { 0 }; char serial_string[17] = { 0 }; char reboot_mode[2] = { 0 }; u32 dieid[4] = { 0 }; + unsigned char keys[3]; unsigned char data = 0;
/* Power button reset init */
twl4030_power_reset_init();
+ /* Keypad */ + + twl4030_keypad_scan((unsigned char *)&keypad_matrix); + + keys[0] = twl4030_keypad_key((unsigned char *)&keypad_matrix, 0, 0); + keys[1] = twl4030_keypad_key((unsigned char *)&keypad_matrix, 0, 1); + keys[2] = twl4030_keypad_key((unsigned char *)&keypad_matrix, 0, 2); + /* Reboot mode */
reboot_mode[0] = omap_reboot_mode(); + + if (keys[0]) + reboot_mode[0] = 'r'; + else if (keys[1]) + reboot_mode[0] = 'b'; + if (reboot_mode[0] > 0 && isascii(reboot_mode[0])) { if (!getenv("reboot-mode")) setenv("reboot-mode", (char *)reboot_mode);

On Mon, Jul 20, 2015 at 03:17:18PM +0200, Paul Kocialkowski wrote:
Using the twl4030 keypad allows booting directly into some special boot modes, such as recovery or fastboot. the VOL+ key will trigger a boot to recovery while the VOL- key will trigger a boot to fastboot.
The G (gesture) key remains unused at this point.
Signed-off-by: Paul Kocialkowski contact@paulk.fr
Reviewed-by: Tom Rini trini@konsulko.com

On Mon, Jul 20, 2015 at 03:17:18PM +0200, Paul Kocialkowski wrote:
Using the twl4030 keypad allows booting directly into some special boot modes, such as recovery or fastboot. the VOL+ key will trigger a boot to recovery while the VOL- key will trigger a boot to fastboot.
The G (gesture) key remains unused at this point.
Signed-off-by: Paul Kocialkowski contact@paulk.fr Reviewed-by: Tom Rini trini@konsulko.com
Applied to u-boot/master, thanks!

Le lundi 20 juillet 2015 à 15:17 +0200, Paul Kocialkowski a écrit :
This patch series adds support for the LG Optimus Black (P970) codename sniper, see the commit that introduces the board and config files for a short description of the device.
Any comment on this series? I would really like to get that new device merged before the merge window ends.
Thanks!
This should be applied on top of patches that I have submitted to the list but were not merged yet, especially:
- omap-common: Common boot code OMAP3 support and cleanup
- omap3: CONFIG_REVISION_TAG ifdef check for get_board_rev
At this point, support as submitted as this point is minimalistic. It is not ready for daily use, but introduces the basic elements that are needed to have a sane base upon which the rest of the device support will be introduced.
In particular, the device is currently headless, mainly because the display backlight is not enabled. Other important features such as the MUIC are not enabled, so USB will only work in U-Boot when the device boots with an USB cable already attached. In addition, the external MMC is not supported in U-Boot either, as it requires support for a separate PMIC.
A work in progress commit introduces support for (some of) those bits in a dirty and non-mergeable way is available at: http://git.code.paulk.fr/gitweb/?p=u-boot.git;a=shortlog;h=refs/heads/sniper...
Having those bits written correctly would require writing some drivers using the power framework. In the long run, those would have to use the driver model API, which would involve converting the I2C driver to DM as well. This is too much overhead for now, but it will be done eventually.
The main problem I see with doing that work now is that I2C DM seems to heavily rely on device-tree. Other parts of the OMAP platform support were converted to DM but use platform data defined in each board. That solution looks good to me, but doesn't work with I2C. Thus, we could either modify the I2C driver to cope with the lack of device-tree or make the use of device-tree a hard requirement for driver model, implying that each omap3 boards would have to provide a device-tree file as well.
Both solutions look good to me and I'll let experts decide what to do. Either way, I need to know what the right solution to this problem is to be able to move forward.
U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
participants (4)
-
Fabio Estevam
-
Paul Kocialkowski
-
Przemyslaw Marczak
-
Tom Rini