summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMathieu J. Poirier <mathieu.poirier@linaro.org>2011-02-14 15:00:24 -0700
committerMathieu J. Poirier <mathieu.poirier@linaro.org>2011-02-14 15:00:24 -0700
commitf6511b73f2376a7498f1000e18acffcd3e4248c7 (patch)
tree0112aa3dea10e856411f606efb659ed6c4f740c9
parentceb7690570557ceeb36ceb16457353fac04d70fa (diff)
Cleaning up GPIO26 init and adding board conditional init.
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
-rw-r--r--board/st/u8500/u8500.c52
1 files changed, 28 insertions, 24 deletions
diff --git a/board/st/u8500/u8500.c b/board/st/u8500/u8500.c
index 6495f0eb0..3b5fdfdd9 100644
--- a/board/st/u8500/u8500.c
+++ b/board/st/u8500/u8500.c
@@ -519,6 +519,7 @@ out:
int board_late_init(void)
{
uchar byte;
+ int ret;
#ifdef CONFIG_MMC
uchar byte_array[] = {0x06, 0x06};
#endif
@@ -532,32 +533,35 @@ int board_late_init(void)
else
setenv("board_id", "1");
- /* For snowball (aka "minikit") we need to raise AB8500's GPIO26 */
- ret = ab8500_read(AB8500_MISC, AB8500_GPIO_DIR4_REG);
- if (ret < 0) {
- printf("error at %s:%i\n", __func__, __LINE__);
- goto out;
- }
- printf("dir4 = %02x\n", ret);
- ret |= 0x2;
- ret = ab8500_write(AB8500_MISC, AB8500_GPIO_DIR4_REG, ret);
- if (ret < 0) {
- printf("error at %s:%i\n", __func__, __LINE__);
- goto out;
- }
+ if (u8500_is_snowball()) {
+ /* For snowball (aka "minikit") we need to raise AB8500's GPIO26 */
+ ret = ab8500_read(AB8500_MISC, AB8500_GPIO_DIR4_REG);
+ if (ret < 0) {
+ printf("error at %s:%i\n", __func__, __LINE__);
+ goto out;
+ }
- ret = ab8500_read(AB8500_MISC, AB8500_GPIO_OUT4_REG);
- if (ret < 0) {
- printf("error at %s:%i\n", __func__, __LINE__);
- goto out;
- }
- printf("out4 = %02x\n", ret);
- ret |= 0x2;
- ret = ab8500_write(AB8500_MISC, AB8500_GPIO_OUT4_REG, ret);
- if (ret < 0) {
- printf("error at %s:%i\n", __func__, __LINE__);
- goto out;
+ ret |= 0x2;
+ ret = ab8500_write(AB8500_MISC, AB8500_GPIO_DIR4_REG, ret);
+ if (ret < 0) {
+ printf("error at %s:%i\n", __func__, __LINE__);
+ goto out;
+ }
+
+ ret = ab8500_read(AB8500_MISC, AB8500_GPIO_OUT4_REG);
+ if (ret < 0) {
+ printf("error at %s:%i\n", __func__, __LINE__);
+ goto out;
+ }
+
+ ret |= 0x2;
+ ret = ab8500_write(AB8500_MISC, AB8500_GPIO_OUT4_REG, ret);
+ if (ret < 0) {
+ printf("error at %s:%i\n", __func__, __LINE__);
+ goto out;
+ }
}
+
out:
#ifdef CONFIG_MMC
hrefplus_mmc_power_init();