diff options
author | Stefano Babic <sbabic@denx.de> | 2010-04-16 17:13:54 +0200 |
---|---|---|
committer | Tom <Tom@bumblecow.com> | 2010-05-10 11:21:54 -0500 |
commit | 0f12ce637b5b969f4732179ef08d5a0779bab6e2 (patch) | |
tree | ace41f331aea1f0e5f4b2c14cea9d4a72430bbec | |
parent | f9c7affa9b66498190f309edc4643b4698e21a8c (diff) | |
download | u-boot-imx-0f12ce637b5b969f4732179ef08d5a0779bab6e2.zip u-boot-imx-0f12ce637b5b969f4732179ef08d5a0779bab6e2.tar.gz u-boot-imx-0f12ce637b5b969f4732179ef08d5a0779bab6e2.tar.bz2 |
MX31: Add support for PMIC to the QONG module
Add support for the PMIC (MC13783) controller
and enables charging of the RTC battery.
Signed-off-by: Stefano Babic <sbabic@denx.de>
-rw-r--r-- | board/davedenx/qong/qong.c | 20 | ||||
-rw-r--r-- | include/configs/qong.h | 14 |
2 files changed, 34 insertions, 0 deletions
diff --git a/board/davedenx/qong/qong.c b/board/davedenx/qong/qong.c index eb9218e..781333b 100644 --- a/board/davedenx/qong/qong.c +++ b/board/davedenx/qong/qong.c @@ -26,6 +26,7 @@ #include <asm/arch/mx31.h> #include <asm/arch/mx31-regs.h> #include <nand.h> +#include <fsl_pmic.h> #include "qong_fpga.h" DECLARE_GLOBAL_DATA_PTR; @@ -128,6 +129,13 @@ int board_init (void) mx31_gpio_mux(MUX_RTS1__UART1_RTS_B); mx31_gpio_mux(MUX_CTS1__UART1_CTS_B); + /* setup pins for SPI (pmic) */ + mx31_gpio_mux(MUX_CSPI2_SS0__CSPI2_SS0_B); + mx31_gpio_mux(MUX_CSPI2_MOSI__CSPI2_MOSI); + mx31_gpio_mux(MUX_CSPI2_MISO__CSPI2_MISO); + mx31_gpio_mux(MUX_CSPI2_SCLK__CSPI2_CLK); + mx31_gpio_mux(MUX_CSPI2_SPI_RDY__CSPI2_DATAREADY_B); + /* board id for linux */ gd->bd->bi_arch_number = MACH_TYPE_QONG; gd->bd->bi_boot_params = (0x80000100); /* adress of boot parameters */ @@ -135,6 +143,18 @@ int board_init (void) return 0; } +int board_late_init(void) +{ + u32 val; + + /* Enable RTC battery */ + val = pmic_reg_read(REG_POWER_CTL0); + pmic_reg_write(REG_POWER_CTL0, val | COINCHEN); + pmic_reg_write(REG_INT_STATUS1, RTCRSTI); + + return 0; +} + int checkboard (void) { printf("Board: DAVE/DENX Qong\n"); diff --git a/include/configs/qong.h b/include/configs/qong.h index baf8481..1a2f19f 100644 --- a/include/configs/qong.h +++ b/include/configs/qong.h @@ -54,6 +54,17 @@ #define CONFIG_MX31_GPIO +#define CONFIG_MXC_SPI +#define CONFIG_DEFAULT_SPI_BUS 1 +#define CONFIG_DEFAULT_SPI_MODE (SPI_MODE_2 | SPI_CS_HIGH) +#define CONFIG_RTC_MC13783 + +#define CONFIG_FSL_PMIC +#define CONFIG_FSL_PMIC_BUS 1 +#define CONFIG_FSL_PMIC_CS 0 +#define CONFIG_FSL_PMIC_CLK 100000 +#define CONFIG_FSL_PMIC_MODE (SPI_MODE_2 | SPI_CS_HIGH) + /* FPGA */ #define CONFIG_QONG_FPGA 1 #define CONFIG_FPGA_BASE (CS1_BASE) @@ -98,6 +109,9 @@ #define CONFIG_CMD_NET #define CONFIG_CMD_MII #define CONFIG_CMD_NAND +#define CONFIG_CMD_SPI +#define CONFIG_CMD_DATE +#define BOARD_LATE_INIT /* * You can compile in a MAC address and your custom net settings by using |