* [U-Boot] [PATCH 1/3] pmic: dialog: Avoid name conflicts
@ 2012-05-07 20:25 Fabio Estevam
2012-05-07 20:25 ` [U-Boot] [PATCH 2/4] mx53loco: Add mc34708 support and set mx53 frequency at 1GHz Fabio Estevam
` (4 more replies)
0 siblings, 5 replies; 18+ messages in thread
From: Fabio Estevam @ 2012-05-07 20:25 UTC (permalink / raw)
To: u-boot
From: Fabio Estevam <fabio.estevam@freescale.com>
As mx53loco board has two variants: one with Dialog PMIC and another with FSL MC34708 PMIC,
we need to be able to build both drivers.
Change pmic_init() and PMIC_NUM_OF_REGS names to avoid build conflicts when both drivers are present.
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
board/freescale/mx53loco/mx53loco.c | 2 +-
drivers/misc/pmic_dialog.c | 4 ++--
include/dialog_pmic.h | 2 +-
include/pmic.h | 1 +
4 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/board/freescale/mx53loco/mx53loco.c b/board/freescale/mx53loco/mx53loco.c
index 0dcec9b..7ed5c4e 100644
--- a/board/freescale/mx53loco/mx53loco.c
+++ b/board/freescale/mx53loco/mx53loco.c
@@ -322,7 +322,7 @@ static int power_init(void)
unsigned int val, ret;
struct pmic *p;
- pmic_init();
+ pmic_dialog_init();
p = get_pmic();
/* Set VDDA to 1.25V */
diff --git a/drivers/misc/pmic_dialog.c b/drivers/misc/pmic_dialog.c
index 7242073..e97af1d 100644
--- a/drivers/misc/pmic_dialog.c
+++ b/drivers/misc/pmic_dialog.c
@@ -20,13 +20,13 @@
#include <pmic.h>
#include <dialog_pmic.h>
-int pmic_init(void)
+int pmic_dialog_init(void)
{
struct pmic *p = get_pmic();
static const char name[] = "DIALOG_PMIC";
p->name = name;
- p->number_of_regs = PMIC_NUM_OF_REGS;
+ p->number_of_regs = DIALOG_NUM_OF_REGS;
p->interface = PMIC_I2C;
p->hw.i2c.addr = CONFIG_SYS_DIALOG_PMIC_I2C_ADDR;
diff --git a/include/dialog_pmic.h b/include/dialog_pmic.h
index b0925f5..8d43585 100644
--- a/include/dialog_pmic.h
+++ b/include/dialog_pmic.h
@@ -164,7 +164,7 @@ enum {
DA9053_GPID7_REG,
DA9053_GPID8_REG,
DA9053_GPID9_REG,
- PMIC_NUM_OF_REGS,
+ DIALOG_NUM_OF_REGS,
};
#define DA_BUCKCORE_VBCORE_1_250V 0x1E
diff --git a/include/pmic.h b/include/pmic.h
index 52a1526..6a05b40 100644
--- a/include/pmic.h
+++ b/include/pmic.h
@@ -55,6 +55,7 @@ struct pmic {
};
int pmic_init(void);
+int pmic_dialog_init(void);
int check_reg(u32 reg);
struct pmic *get_pmic(void);
int pmic_probe(struct pmic *p);
--
1.7.1
^ permalink raw reply related [flat|nested] 18+ messages in thread
* [U-Boot] [PATCH 2/4] mx53loco: Add mc34708 support and set mx53 frequency at 1GHz
2012-05-07 20:25 [U-Boot] [PATCH 1/3] pmic: dialog: Avoid name conflicts Fabio Estevam
@ 2012-05-07 20:25 ` Fabio Estevam
2012-05-09 8:57 ` Liu Hui-R64343
` (2 more replies)
2012-05-07 20:26 ` [U-Boot] [PATCH 3/4] mx53loco: Turn on VUSB regulator Fabio Estevam
` (3 subsequent siblings)
4 siblings, 3 replies; 18+ messages in thread
From: Fabio Estevam @ 2012-05-07 20:25 UTC (permalink / raw)
To: u-boot
From: Fabio Estevam <fabio.estevam@freescale.com>
Add mc34708 support and set mx53 core frequency at its maximum value of 1GHz.
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
board/freescale/mx53loco/mx53loco.c | 52 +++++++++++++++++++++++++---------
include/configs/mx53loco.h | 2 +
include/fsl_pmic.h | 10 +++++++
3 files changed, 50 insertions(+), 14 deletions(-)
diff --git a/board/freescale/mx53loco/mx53loco.c b/board/freescale/mx53loco/mx53loco.c
index 7ed5c4e..8c18b99 100644
--- a/board/freescale/mx53loco/mx53loco.c
+++ b/board/freescale/mx53loco/mx53loco.c
@@ -38,6 +38,7 @@
#include <asm/gpio.h>
#include <pmic.h>
#include <dialog_pmic.h>
+#include <fsl_pmic.h>
DECLARE_GLOBAL_DATA_PTR;
@@ -319,23 +320,46 @@ static void setup_iomux_i2c(void)
static int power_init(void)
{
- unsigned int val, ret;
+ unsigned int val;
+ int ret = -1;
struct pmic *p;
- pmic_dialog_init();
- p = get_pmic();
-
- /* Set VDDA to 1.25V */
- val = DA9052_BUCKCORE_BCOREEN | DA_BUCKCORE_VBCORE_1_250V;
- ret = pmic_reg_write(p, DA9053_BUCKCORE_REG, val);
-
- ret |= pmic_reg_read(p, DA9053_SUPPLY_REG, &val);
- val |= DA9052_SUPPLY_VBCOREGO;
- ret |= pmic_reg_write(p, DA9053_SUPPLY_REG, val);
+ if (!i2c_probe(CONFIG_SYS_DIALOG_PMIC_I2C_ADDR)) {
+ pmic_dialog_init();
+ p = get_pmic();
+
+ /* Set VDDA to 1.25V */
+ val = DA9052_BUCKCORE_BCOREEN | DA_BUCKCORE_VBCORE_1_250V;
+ ret = pmic_reg_write(p, DA9053_BUCKCORE_REG, val);
+
+ ret |= pmic_reg_read(p, DA9053_SUPPLY_REG, &val);
+ val |= DA9052_SUPPLY_VBCOREGO;
+ ret |= pmic_reg_write(p, DA9053_SUPPLY_REG, val);
+
+ /* Set Vcc peripheral to 1.30V */
+ ret |= pmic_reg_write(p, DA9053_BUCKPRO_REG, 0x62);
+ ret |= pmic_reg_write(p, DA9053_SUPPLY_REG, 0x62);
+ }
- /* Set Vcc peripheral to 1.35V */
- ret |= pmic_reg_write(p, DA9053_BUCKPRO_REG, 0x62);
- ret |= pmic_reg_write(p, DA9053_SUPPLY_REG, 0x62);
+ if (!i2c_probe(CONFIG_SYS_FSL_PMIC_I2C_ADDR)) {
+ pmic_init();
+ p = get_pmic();
+
+ /* Set VDDGP to 1.25V for 1GHz on SW1 */
+ pmic_reg_read(p, REG_SW_0, &val);
+ val = (val & ~SWx_VOLT_MASK_MC34708) | SWx_1_250V_MC34708;
+ ret = pmic_reg_write(p, REG_SW_0, val);
+
+ /* Set VCC as 1.30V on SW2 */
+ pmic_reg_read(p, REG_SW_1, &val);
+ val = (val & ~SWx_VOLT_MASK_MC34708) | SWx_1_300V_MC34708;
+ ret |= pmic_reg_write(p, REG_SW_1, val);
+
+ /* Set global reset timer to 4s */
+ pmic_reg_read(p, REG_POWER_CTL2, &val);
+ val = (val & ~TIMER_MASK_MC34708) | TIMER_4S_MC34708;
+ ret |= pmic_reg_write(p, REG_POWER_CTL2, val);
+ }
return ret;
}
diff --git a/include/configs/mx53loco.h b/include/configs/mx53loco.h
index 8f43eec..87f6ed1 100644
--- a/include/configs/mx53loco.h
+++ b/include/configs/mx53loco.h
@@ -97,7 +97,9 @@
#define CONFIG_PMIC
#define CONFIG_PMIC_I2C
#define CONFIG_DIALOG_PMIC
+#define CONFIG_PMIC_FSL
#define CONFIG_SYS_DIALOG_PMIC_I2C_ADDR 0x48
+#define CONFIG_SYS_FSL_PMIC_I2C_ADDR 0x8
/* allow to overwrite serial and ethaddr */
#define CONFIG_ENV_OVERWRITE
diff --git a/include/fsl_pmic.h b/include/fsl_pmic.h
index 742f2e1..3b7cd37 100644
--- a/include/fsl_pmic.h
+++ b/include/fsl_pmic.h
@@ -122,4 +122,14 @@ enum {
/* Interrupt status 1 */
#define RTCRSTI (1 << 7)
+/* MC34708 Definitions */
+#define SWx_VOLT_MASK_MC34708 0x3F
+#define SWx_1_250V_MC34708 0x30
+#define SWx_1_300V_MC34708 0x34
+#define TIMER_MASK_MC34708 0x300
+#define TIMER_4S_MC34708 0x100
+#define VUSBSEL_MC34708 (1 << 2)
+#define VUSBEN_MC34708 (1 << 3)
+#define SWBST_CTRL 31
+
#endif
--
1.7.1
^ permalink raw reply related [flat|nested] 18+ messages in thread
* [U-Boot] [PATCH 3/4] mx53loco: Turn on VUSB regulator
2012-05-07 20:25 [U-Boot] [PATCH 1/3] pmic: dialog: Avoid name conflicts Fabio Estevam
2012-05-07 20:25 ` [U-Boot] [PATCH 2/4] mx53loco: Add mc34708 support and set mx53 frequency at 1GHz Fabio Estevam
@ 2012-05-07 20:26 ` Fabio Estevam
2012-05-09 8:58 ` Liu Hui-R64343
` (2 more replies)
2012-05-07 20:26 ` [U-Boot] [PATCH 4/4] mx53loco: Add CONFIG_REVISION_TAG Fabio Estevam
` (2 subsequent siblings)
4 siblings, 3 replies; 18+ messages in thread
From: Fabio Estevam @ 2012-05-07 20:26 UTC (permalink / raw)
To: u-boot
From: Fabio Estevam <fabio.estevam@freescale.com>
On the mx53loco board with mc34708 PMIC it is necessary to turn on VUSB regulator
so that the mx53 USBH1 PHY receives the 3.3V voltage.
Tested by inserting a USB pen drive in the upper USB slot (USBH1) and then issued the
commands:
usb start
usb info
,which correctly detected and printed the USB pen drive information.
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
board/freescale/mx53loco/mx53loco.c | 9 +++++++++
include/fsl_pmic.h | 1 +
2 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/board/freescale/mx53loco/mx53loco.c b/board/freescale/mx53loco/mx53loco.c
index 8c18b99..4d3b73d 100644
--- a/board/freescale/mx53loco/mx53loco.c
+++ b/board/freescale/mx53loco/mx53loco.c
@@ -359,6 +359,15 @@ static int power_init(void)
pmic_reg_read(p, REG_POWER_CTL2, &val);
val = (val & ~TIMER_MASK_MC34708) | TIMER_4S_MC34708;
ret |= pmic_reg_write(p, REG_POWER_CTL2, val);
+
+ /* Set VUSBSEL and VUSBEN for USB PHY supply*/
+ pmic_reg_read(p, REG_MODE_0, &val);
+ val |= (VUSBSEL_MC34708 | VUSBEN_MC34708);
+ ret |= pmic_reg_write(p, REG_MODE_0, val);
+
+ /* Set SWBST to 5V in auto mode */
+ val = SWBST_AUTO;
+ ret |= pmic_reg_write(p, SWBST_CTRL, val);
}
return ret;
diff --git a/include/fsl_pmic.h b/include/fsl_pmic.h
index 3b7cd37..64c1e2e 100644
--- a/include/fsl_pmic.h
+++ b/include/fsl_pmic.h
@@ -131,5 +131,6 @@ enum {
#define VUSBSEL_MC34708 (1 << 2)
#define VUSBEN_MC34708 (1 << 3)
#define SWBST_CTRL 31
+#define SWBST_AUTO 0x8
#endif
--
1.7.1
^ permalink raw reply related [flat|nested] 18+ messages in thread
* [U-Boot] [PATCH 4/4] mx53loco: Add CONFIG_REVISION_TAG
2012-05-07 20:25 [U-Boot] [PATCH 1/3] pmic: dialog: Avoid name conflicts Fabio Estevam
2012-05-07 20:25 ` [U-Boot] [PATCH 2/4] mx53loco: Add mc34708 support and set mx53 frequency at 1GHz Fabio Estevam
2012-05-07 20:26 ` [U-Boot] [PATCH 3/4] mx53loco: Turn on VUSB regulator Fabio Estevam
@ 2012-05-07 20:26 ` Fabio Estevam
2012-05-08 13:40 ` [U-Boot] [PATCH v2 " Fabio Estevam
2012-05-09 9:15 ` [U-Boot] [PATCH " Liu Hui-R64343
2012-05-09 9:11 ` [U-Boot] [PATCH 1/3] pmic: dialog: Avoid name conflicts Stefano Babic
2012-05-09 9:18 ` Stefano Babic
4 siblings, 2 replies; 18+ messages in thread
From: Fabio Estevam @ 2012-05-07 20:26 UTC (permalink / raw)
To: u-boot
From: Fabio Estevam <fabio.estevam@freescale.com>
FSL 2.6.35 kernel assumes that the bootloader passes the CONFIG_REVISION_TAG information.
The kernel uses this data to distinguish between Dialog versus mc34708 based boards,
and also to distinguish between revA and revB of the mc34708 based boards.
Suggested-by: Yu Li <yk@magniel.com>
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
board/freescale/mx53loco/mx53loco.c | 7 +++++++
include/configs/mx53loco.h | 1 +
2 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/board/freescale/mx53loco/mx53loco.c b/board/freescale/mx53loco/mx53loco.c
index 4d3b73d..2f2c00c 100644
--- a/board/freescale/mx53loco/mx53loco.c
+++ b/board/freescale/mx53loco/mx53loco.c
@@ -62,6 +62,13 @@ void dram_init_banksize(void)
gd->bd->bi_dram[1].size = PHYS_SDRAM_2_SIZE;
}
+u32 get_board_rev(void)
+{
+ /* TODO: Convert the register to proper io accessor */
+ int rev = readl(IIM_BASE_ADDR + 0x878);
+ return (get_cpu_rev() & ~(0xF << 8)) | (rev & 0xF) << 8;
+}
+
static void setup_iomux_uart(void)
{
/* UART1 RXD */
diff --git a/include/configs/mx53loco.h b/include/configs/mx53loco.h
index 87f6ed1..eab0e27 100644
--- a/include/configs/mx53loco.h
+++ b/include/configs/mx53loco.h
@@ -43,6 +43,7 @@
#define CONFIG_BOARD_EARLY_INIT_F
#define CONFIG_BOARD_LATE_INIT
#define CONFIG_MXC_GPIO
+#define CONFIG_REVISION_TAG
#define CONFIG_MXC_UART
#define CONFIG_MXC_UART_BASE UART1_BASE
--
1.7.1
^ permalink raw reply related [flat|nested] 18+ messages in thread
* [U-Boot] [PATCH v2 4/4] mx53loco: Add CONFIG_REVISION_TAG
2012-05-07 20:26 ` [U-Boot] [PATCH 4/4] mx53loco: Add CONFIG_REVISION_TAG Fabio Estevam
@ 2012-05-08 13:40 ` Fabio Estevam
2012-05-09 9:11 ` Stefano Babic
2012-05-09 9:18 ` Stefano Babic
2012-05-09 9:15 ` [U-Boot] [PATCH " Liu Hui-R64343
1 sibling, 2 replies; 18+ messages in thread
From: Fabio Estevam @ 2012-05-08 13:40 UTC (permalink / raw)
To: u-boot
FSL 2.6.35 kernel assumes that the bootloader passes the CONFIG_REVISION_TAG information.
The kernel uses this data to distinguish between Dialog versus mc34708 based boards,
and also to distinguish between revA and revB of the mc34708 based boards.
Suggested-by: Yu Li <yk@magniel.com>
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
Changes since v1:
- Use proper io accessor for reading board revision
arch/arm/include/asm/arch-mx5/imx-regs.h | 5 +++++
board/freescale/mx53loco/mx53loco.c | 12 ++++++++++++
include/configs/mx53loco.h | 1 +
3 files changed, 18 insertions(+), 0 deletions(-)
diff --git a/arch/arm/include/asm/arch-mx5/imx-regs.h b/arch/arm/include/asm/arch-mx5/imx-regs.h
index a4245a3..cef4190 100644
--- a/arch/arm/include/asm/arch-mx5/imx-regs.h
+++ b/arch/arm/include/asm/arch-mx5/imx-regs.h
@@ -491,6 +491,11 @@ struct iim_regs {
} bank[4];
};
+struct fuse_bank0_regs {
+ u32 fuse0_23[24];
+ u32 gp[8];
+};
+
struct fuse_bank1_regs {
u32 fuse0_8[9];
u32 mac_addr[6];
diff --git a/board/freescale/mx53loco/mx53loco.c b/board/freescale/mx53loco/mx53loco.c
index 8c18b99..0dbde0c 100644
--- a/board/freescale/mx53loco/mx53loco.c
+++ b/board/freescale/mx53loco/mx53loco.c
@@ -62,6 +62,18 @@ void dram_init_banksize(void)
gd->bd->bi_dram[1].size = PHYS_SDRAM_2_SIZE;
}
+u32 get_board_rev(void)
+{
+ struct iim_regs *iim = (struct iim_regs *)IMX_IIM_BASE;
+ struct fuse_bank *bank = &iim->bank[0];
+ struct fuse_bank0_regs *fuse =
+ (struct fuse_bank0_regs *)bank->fuse_regs;
+
+ int rev = readl(&fuse->gp[6]);
+
+ return (get_cpu_rev() & ~(0xF << 8)) | (rev & 0xF) << 8;
+}
+
static void setup_iomux_uart(void)
{
/* UART1 RXD */
diff --git a/include/configs/mx53loco.h b/include/configs/mx53loco.h
index 87f6ed1..eab0e27 100644
--- a/include/configs/mx53loco.h
+++ b/include/configs/mx53loco.h
@@ -43,6 +43,7 @@
#define CONFIG_BOARD_EARLY_INIT_F
#define CONFIG_BOARD_LATE_INIT
#define CONFIG_MXC_GPIO
+#define CONFIG_REVISION_TAG
#define CONFIG_MXC_UART
#define CONFIG_MXC_UART_BASE UART1_BASE
--
1.7.1
^ permalink raw reply related [flat|nested] 18+ messages in thread
* [U-Boot] [PATCH 2/4] mx53loco: Add mc34708 support and set mx53 frequency at 1GHz
2012-05-07 20:25 ` [U-Boot] [PATCH 2/4] mx53loco: Add mc34708 support and set mx53 frequency at 1GHz Fabio Estevam
@ 2012-05-09 8:57 ` Liu Hui-R64343
2012-05-09 9:11 ` Stefano Babic
2012-05-09 9:17 ` Stefano Babic
2 siblings, 0 replies; 18+ messages in thread
From: Liu Hui-R64343 @ 2012-05-09 8:57 UTC (permalink / raw)
To: u-boot
>-----Original Message-----
>From: Fabio Estevam [mailto:festevam at gmail.com]
>Sent: Tuesday, May 08, 2012 4:26 AM
>To: u-boot at lists.denx.de
>Cc: sbabic at denx.de; Liu Hui-R64343; Estevam Fabio-R49496
>Subject: [PATCH 2/4] mx53loco: Add mc34708 support and set mx53
>frequency at 1GHz
>
>From: Fabio Estevam <fabio.estevam@freescale.com>
>
>Add mc34708 support and set mx53 core frequency at its maximum value of
>1GHz.
>
>Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Acked-by: Jason Liu <r64343@freescale.com>
>---
> board/freescale/mx53loco/mx53loco.c | 52 +++++++++++++++++++++++++---
>------
> include/configs/mx53loco.h | 2 +
> include/fsl_pmic.h | 10 +++++++
> 3 files changed, 50 insertions(+), 14 deletions(-)
>
>diff --git a/board/freescale/mx53loco/mx53loco.c
>b/board/freescale/mx53loco/mx53loco.c
>index 7ed5c4e..8c18b99 100644
>--- a/board/freescale/mx53loco/mx53loco.c
>+++ b/board/freescale/mx53loco/mx53loco.c
>@@ -38,6 +38,7 @@
> #include <asm/gpio.h>
> #include <pmic.h>
> #include <dialog_pmic.h>
>+#include <fsl_pmic.h>
>
> DECLARE_GLOBAL_DATA_PTR;
>
>@@ -319,23 +320,46 @@ static void setup_iomux_i2c(void)
>
> static int power_init(void)
> {
>- unsigned int val, ret;
>+ unsigned int val;
>+ int ret = -1;
> struct pmic *p;
>
>- pmic_dialog_init();
>- p = get_pmic();
>-
>- /* Set VDDA to 1.25V */
>- val = DA9052_BUCKCORE_BCOREEN | DA_BUCKCORE_VBCORE_1_250V;
>- ret = pmic_reg_write(p, DA9053_BUCKCORE_REG, val);
>-
>- ret |= pmic_reg_read(p, DA9053_SUPPLY_REG, &val);
>- val |= DA9052_SUPPLY_VBCOREGO;
>- ret |= pmic_reg_write(p, DA9053_SUPPLY_REG, val);
>+ if (!i2c_probe(CONFIG_SYS_DIALOG_PMIC_I2C_ADDR)) {
>+ pmic_dialog_init();
>+ p = get_pmic();
>+
>+ /* Set VDDA to 1.25V */
>+ val = DA9052_BUCKCORE_BCOREEN |
>DA_BUCKCORE_VBCORE_1_250V;
>+ ret = pmic_reg_write(p, DA9053_BUCKCORE_REG, val);
>+
>+ ret |= pmic_reg_read(p, DA9053_SUPPLY_REG, &val);
>+ val |= DA9052_SUPPLY_VBCOREGO;
>+ ret |= pmic_reg_write(p, DA9053_SUPPLY_REG, val);
>+
>+ /* Set Vcc peripheral to 1.30V */
>+ ret |= pmic_reg_write(p, DA9053_BUCKPRO_REG, 0x62);
>+ ret |= pmic_reg_write(p, DA9053_SUPPLY_REG, 0x62);
>+ }
>
>- /* Set Vcc peripheral to 1.35V */
>- ret |= pmic_reg_write(p, DA9053_BUCKPRO_REG, 0x62);
>- ret |= pmic_reg_write(p, DA9053_SUPPLY_REG, 0x62);
>+ if (!i2c_probe(CONFIG_SYS_FSL_PMIC_I2C_ADDR)) {
>+ pmic_init();
>+ p = get_pmic();
>+
>+ /* Set VDDGP to 1.25V for 1GHz on SW1 */
>+ pmic_reg_read(p, REG_SW_0, &val);
>+ val = (val & ~SWx_VOLT_MASK_MC34708) |
>SWx_1_250V_MC34708;
>+ ret = pmic_reg_write(p, REG_SW_0, val);
>+
>+ /* Set VCC as 1.30V on SW2 */
>+ pmic_reg_read(p, REG_SW_1, &val);
>+ val = (val & ~SWx_VOLT_MASK_MC34708) |
>SWx_1_300V_MC34708;
>+ ret |= pmic_reg_write(p, REG_SW_1, val);
>+
>+ /* Set global reset timer to 4s */
>+ pmic_reg_read(p, REG_POWER_CTL2, &val);
>+ val = (val & ~TIMER_MASK_MC34708) | TIMER_4S_MC34708;
>+ ret |= pmic_reg_write(p, REG_POWER_CTL2, val);
>+ }
>
> return ret;
> }
>diff --git a/include/configs/mx53loco.h b/include/configs/mx53loco.h index
>8f43eec..87f6ed1 100644
>--- a/include/configs/mx53loco.h
>+++ b/include/configs/mx53loco.h
>@@ -97,7 +97,9 @@
> #define CONFIG_PMIC
> #define CONFIG_PMIC_I2C
> #define CONFIG_DIALOG_PMIC
>+#define CONFIG_PMIC_FSL
> #define CONFIG_SYS_DIALOG_PMIC_I2C_ADDR 0x48
>+#define CONFIG_SYS_FSL_PMIC_I2C_ADDR 0x8
>
> /* allow to overwrite serial and ethaddr */ #define
>CONFIG_ENV_OVERWRITE diff --git a/include/fsl_pmic.h b/include/fsl_pmic.h
>index 742f2e1..3b7cd37 100644
>--- a/include/fsl_pmic.h
>+++ b/include/fsl_pmic.h
>@@ -122,4 +122,14 @@ enum {
> /* Interrupt status 1 */
> #define RTCRSTI (1 << 7)
>
>+/* MC34708 Definitions */
>+#define SWx_VOLT_MASK_MC34708 0x3F
>+#define SWx_1_250V_MC34708 0x30
>+#define SWx_1_300V_MC34708 0x34
>+#define TIMER_MASK_MC34708 0x300
>+#define TIMER_4S_MC34708 0x100
>+#define VUSBSEL_MC34708 (1 << 2)
>+#define VUSBEN_MC34708 (1 << 3)
>+#define SWBST_CTRL 31
>+
> #endif
>--
>1.7.1
>
^ permalink raw reply [flat|nested] 18+ messages in thread
* [U-Boot] [PATCH 3/4] mx53loco: Turn on VUSB regulator
2012-05-07 20:26 ` [U-Boot] [PATCH 3/4] mx53loco: Turn on VUSB regulator Fabio Estevam
@ 2012-05-09 8:58 ` Liu Hui-R64343
2012-05-09 9:11 ` Stefano Babic
2012-05-09 9:18 ` Stefano Babic
2 siblings, 0 replies; 18+ messages in thread
From: Liu Hui-R64343 @ 2012-05-09 8:58 UTC (permalink / raw)
To: u-boot
>-----Original Message-----
>From: Fabio Estevam [mailto:festevam at gmail.com]
>Sent: Tuesday, May 08, 2012 4:26 AM
>To: u-boot at lists.denx.de
>Cc: sbabic at denx.de; Liu Hui-R64343; Estevam Fabio-R49496
>Subject: [PATCH 3/4] mx53loco: Turn on VUSB regulator
>
>From: Fabio Estevam <fabio.estevam@freescale.com>
>
>On the mx53loco board with mc34708 PMIC it is necessary to turn on VUSB
>regulator so that the mx53 USBH1 PHY receives the 3.3V voltage.
>
>Tested by inserting a USB pen drive in the upper USB slot (USBH1) and then
>issued the
>commands:
>
>usb start
>
>usb info
>
>,which correctly detected and printed the USB pen drive information.
>
>Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Acked-by: Jason Liu <r64343@freescale.com>
>---
> board/freescale/mx53loco/mx53loco.c | 9 +++++++++
> include/fsl_pmic.h | 1 +
> 2 files changed, 10 insertions(+), 0 deletions(-)
>
>diff --git a/board/freescale/mx53loco/mx53loco.c
>b/board/freescale/mx53loco/mx53loco.c
>index 8c18b99..4d3b73d 100644
>--- a/board/freescale/mx53loco/mx53loco.c
>+++ b/board/freescale/mx53loco/mx53loco.c
>@@ -359,6 +359,15 @@ static int power_init(void)
> pmic_reg_read(p, REG_POWER_CTL2, &val);
> val = (val & ~TIMER_MASK_MC34708) | TIMER_4S_MC34708;
> ret |= pmic_reg_write(p, REG_POWER_CTL2, val);
>+
>+ /* Set VUSBSEL and VUSBEN for USB PHY supply*/
>+ pmic_reg_read(p, REG_MODE_0, &val);
>+ val |= (VUSBSEL_MC34708 | VUSBEN_MC34708);
>+ ret |= pmic_reg_write(p, REG_MODE_0, val);
>+
>+ /* Set SWBST to 5V in auto mode */
>+ val = SWBST_AUTO;
>+ ret |= pmic_reg_write(p, SWBST_CTRL, val);
> }
>
> return ret;
>diff --git a/include/fsl_pmic.h b/include/fsl_pmic.h index 3b7cd37..64c1e2e
>100644
>--- a/include/fsl_pmic.h
>+++ b/include/fsl_pmic.h
>@@ -131,5 +131,6 @@ enum {
> #define VUSBSEL_MC34708 (1 << 2)
> #define VUSBEN_MC34708 (1 << 3)
> #define SWBST_CTRL 31
>+#define SWBST_AUTO 0x8
>
> #endif
>--
>1.7.1
>
^ permalink raw reply [flat|nested] 18+ messages in thread
* [U-Boot] [PATCH v2 4/4] mx53loco: Add CONFIG_REVISION_TAG
2012-05-08 13:40 ` [U-Boot] [PATCH v2 " Fabio Estevam
@ 2012-05-09 9:11 ` Stefano Babic
2012-05-09 9:18 ` Stefano Babic
1 sibling, 0 replies; 18+ messages in thread
From: Stefano Babic @ 2012-05-09 9:11 UTC (permalink / raw)
To: u-boot
On 08/05/2012 15:40, Fabio Estevam wrote:
> FSL 2.6.35 kernel assumes that the bootloader passes the CONFIG_REVISION_TAG information.
>
> The kernel uses this data to distinguish between Dialog versus mc34708 based boards,
> and also to distinguish between revA and revB of the mc34708 based boards.
>
> Suggested-by: Yu Li <yk@magniel.com>
> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
> ---
Acked-by: Stefano Babic <sbabic@denx.de>
Best regards,
Stefano Babic
--
=====================================================================
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================
^ permalink raw reply [flat|nested] 18+ messages in thread
* [U-Boot] [PATCH 2/4] mx53loco: Add mc34708 support and set mx53 frequency at 1GHz
2012-05-07 20:25 ` [U-Boot] [PATCH 2/4] mx53loco: Add mc34708 support and set mx53 frequency at 1GHz Fabio Estevam
2012-05-09 8:57 ` Liu Hui-R64343
@ 2012-05-09 9:11 ` Stefano Babic
2012-05-09 9:17 ` Stefano Babic
2 siblings, 0 replies; 18+ messages in thread
From: Stefano Babic @ 2012-05-09 9:11 UTC (permalink / raw)
To: u-boot
On 07/05/2012 22:25, Fabio Estevam wrote:
> From: Fabio Estevam <fabio.estevam@freescale.com>
>
> Add mc34708 support and set mx53 core frequency at its maximum value of 1GHz.
>
> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
> ---
Acked-by: Stefano Babic <sbabic@denx.de>
Best regards,
Stefano Babic
--
=====================================================================
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================
^ permalink raw reply [flat|nested] 18+ messages in thread
* [U-Boot] [PATCH 3/4] mx53loco: Turn on VUSB regulator
2012-05-07 20:26 ` [U-Boot] [PATCH 3/4] mx53loco: Turn on VUSB regulator Fabio Estevam
2012-05-09 8:58 ` Liu Hui-R64343
@ 2012-05-09 9:11 ` Stefano Babic
2012-05-09 9:18 ` Stefano Babic
2 siblings, 0 replies; 18+ messages in thread
From: Stefano Babic @ 2012-05-09 9:11 UTC (permalink / raw)
To: u-boot
On 07/05/2012 22:26, Fabio Estevam wrote:
> From: Fabio Estevam <fabio.estevam@freescale.com>
>
> On the mx53loco board with mc34708 PMIC it is necessary to turn on VUSB regulator
> so that the mx53 USBH1 PHY receives the 3.3V voltage.
>
> Tested by inserting a USB pen drive in the upper USB slot (USBH1) and then issued the
> commands:
>
> usb start
>
> usb info
>
> ,which correctly detected and printed the USB pen drive information.
>
> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
> ---
Acked-by: Stefano Babic <sbabic@denx.de>
Best regards,
Stefano Babic
--
=====================================================================
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================
^ permalink raw reply [flat|nested] 18+ messages in thread
* [U-Boot] [PATCH 1/3] pmic: dialog: Avoid name conflicts
2012-05-07 20:25 [U-Boot] [PATCH 1/3] pmic: dialog: Avoid name conflicts Fabio Estevam
` (2 preceding siblings ...)
2012-05-07 20:26 ` [U-Boot] [PATCH 4/4] mx53loco: Add CONFIG_REVISION_TAG Fabio Estevam
@ 2012-05-09 9:11 ` Stefano Babic
2012-05-09 9:18 ` Stefano Babic
4 siblings, 0 replies; 18+ messages in thread
From: Stefano Babic @ 2012-05-09 9:11 UTC (permalink / raw)
To: u-boot
On 07/05/2012 22:25, Fabio Estevam wrote:
> From: Fabio Estevam <fabio.estevam@freescale.com>
>
> As mx53loco board has two variants: one with Dialog PMIC and another with FSL MC34708 PMIC,
> we need to be able to build both drivers.
>
> Change pmic_init() and PMIC_NUM_OF_REGS names to avoid build conflicts when both drivers are present.
>
> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
> ---
Acked-by: Stefano Babic <sbabic@denx.de>
Best regards,
Stefano Babic
--
=====================================================================
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================
^ permalink raw reply [flat|nested] 18+ messages in thread
* [U-Boot] [PATCH 4/4] mx53loco: Add CONFIG_REVISION_TAG
2012-05-07 20:26 ` [U-Boot] [PATCH 4/4] mx53loco: Add CONFIG_REVISION_TAG Fabio Estevam
2012-05-08 13:40 ` [U-Boot] [PATCH v2 " Fabio Estevam
@ 2012-05-09 9:15 ` Liu Hui-R64343
2012-05-09 11:20 ` Fabio Estevam
1 sibling, 1 reply; 18+ messages in thread
From: Liu Hui-R64343 @ 2012-05-09 9:15 UTC (permalink / raw)
To: u-boot
>-----Original Message-----
>From: Fabio Estevam [mailto:festevam at gmail.com]
>Sent: Tuesday, May 08, 2012 4:26 AM
>To: u-boot at lists.denx.de
>Cc: sbabic at denx.de; Liu Hui-R64343; Estevam Fabio-R49496
>Subject: [PATCH 4/4] mx53loco: Add CONFIG_REVISION_TAG
>
>From: Fabio Estevam <fabio.estevam@freescale.com>
>
>FSL 2.6.35 kernel assumes that the bootloader passes the
>CONFIG_REVISION_TAG information.
>
>The kernel uses this data to distinguish between Dialog versus mc34708
>based boards, and also to distinguish between revA and revB of the mc34708
>based boards.
>
>Suggested-by: Yu Li <yk@magniel.com>
>Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
>---
> board/freescale/mx53loco/mx53loco.c | 7 +++++++
> include/configs/mx53loco.h | 1 +
> 2 files changed, 8 insertions(+), 0 deletions(-)
>
>diff --git a/board/freescale/mx53loco/mx53loco.c
>b/board/freescale/mx53loco/mx53loco.c
>index 4d3b73d..2f2c00c 100644
>--- a/board/freescale/mx53loco/mx53loco.c
>+++ b/board/freescale/mx53loco/mx53loco.c
>@@ -62,6 +62,13 @@ void dram_init_banksize(void)
> gd->bd->bi_dram[1].size = PHYS_SDRAM_2_SIZE; }
>
>+u32 get_board_rev(void)
>+{
>+ /* TODO: Convert the register to proper io accessor */
>+ int rev = readl(IIM_BASE_ADDR + 0x878);
>+ return (get_cpu_rev() & ~(0xF << 8)) | (rev & 0xF) << 8; }
>+
As you said, could you please use accessor for it?
> static void setup_iomux_uart(void)
> {
> /* UART1 RXD */
>diff --git a/include/configs/mx53loco.h b/include/configs/mx53loco.h index
>87f6ed1..eab0e27 100644
>--- a/include/configs/mx53loco.h
>+++ b/include/configs/mx53loco.h
>@@ -43,6 +43,7 @@
> #define CONFIG_BOARD_EARLY_INIT_F
> #define CONFIG_BOARD_LATE_INIT
> #define CONFIG_MXC_GPIO
>+#define CONFIG_REVISION_TAG
>
> #define CONFIG_MXC_UART
> #define CONFIG_MXC_UART_BASE UART1_BASE
>--
>1.7.1
>
^ permalink raw reply [flat|nested] 18+ messages in thread
* [U-Boot] [PATCH 2/4] mx53loco: Add mc34708 support and set mx53 frequency at 1GHz
2012-05-07 20:25 ` [U-Boot] [PATCH 2/4] mx53loco: Add mc34708 support and set mx53 frequency at 1GHz Fabio Estevam
2012-05-09 8:57 ` Liu Hui-R64343
2012-05-09 9:11 ` Stefano Babic
@ 2012-05-09 9:17 ` Stefano Babic
2 siblings, 0 replies; 18+ messages in thread
From: Stefano Babic @ 2012-05-09 9:17 UTC (permalink / raw)
To: u-boot
On 07/05/2012 22:25, Fabio Estevam wrote:
> From: Fabio Estevam <fabio.estevam@freescale.com>
>
> Add mc34708 support and set mx53 core frequency at its maximum value of 1GHz.
>
> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
> ---
Applied to u-boot-imx, thanks
Best regards,
Stefano Babic
--
=====================================================================
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================
^ permalink raw reply [flat|nested] 18+ messages in thread
* [U-Boot] [PATCH 3/4] mx53loco: Turn on VUSB regulator
2012-05-07 20:26 ` [U-Boot] [PATCH 3/4] mx53loco: Turn on VUSB regulator Fabio Estevam
2012-05-09 8:58 ` Liu Hui-R64343
2012-05-09 9:11 ` Stefano Babic
@ 2012-05-09 9:18 ` Stefano Babic
2 siblings, 0 replies; 18+ messages in thread
From: Stefano Babic @ 2012-05-09 9:18 UTC (permalink / raw)
To: u-boot
On 07/05/2012 22:26, Fabio Estevam wrote:
> From: Fabio Estevam <fabio.estevam@freescale.com>
>
> On the mx53loco board with mc34708 PMIC it is necessary to turn on VUSB regulator
> so that the mx53 USBH1 PHY receives the 3.3V voltage.
>
> Tested by inserting a USB pen drive in the upper USB slot (USBH1) and then issued the
> commands:
>
> usb start
>
> usb info
>
> ,which correctly detected and printed the USB pen drive information.
>
> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
> ---
Applied to u-boot-imx, thanks
Best regards,
Stefano Babic
--
=====================================================================
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================
^ permalink raw reply [flat|nested] 18+ messages in thread
* [U-Boot] [PATCH v2 4/4] mx53loco: Add CONFIG_REVISION_TAG
2012-05-08 13:40 ` [U-Boot] [PATCH v2 " Fabio Estevam
2012-05-09 9:11 ` Stefano Babic
@ 2012-05-09 9:18 ` Stefano Babic
1 sibling, 0 replies; 18+ messages in thread
From: Stefano Babic @ 2012-05-09 9:18 UTC (permalink / raw)
To: u-boot
On 08/05/2012 15:40, Fabio Estevam wrote:
> FSL 2.6.35 kernel assumes that the bootloader passes the CONFIG_REVISION_TAG information.
>
> The kernel uses this data to distinguish between Dialog versus mc34708 based boards,
> and also to distinguish between revA and revB of the mc34708 based boards.
>
> Suggested-by: Yu Li <yk@magniel.com>
> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
> ---
Applied to u-boot-imx, thanks
Best regards,
Stefano Babic
--
=====================================================================
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================
^ permalink raw reply [flat|nested] 18+ messages in thread
* [U-Boot] [PATCH 1/3] pmic: dialog: Avoid name conflicts
2012-05-07 20:25 [U-Boot] [PATCH 1/3] pmic: dialog: Avoid name conflicts Fabio Estevam
` (3 preceding siblings ...)
2012-05-09 9:11 ` [U-Boot] [PATCH 1/3] pmic: dialog: Avoid name conflicts Stefano Babic
@ 2012-05-09 9:18 ` Stefano Babic
4 siblings, 0 replies; 18+ messages in thread
From: Stefano Babic @ 2012-05-09 9:18 UTC (permalink / raw)
To: u-boot
On 07/05/2012 22:25, Fabio Estevam wrote:
> From: Fabio Estevam <fabio.estevam@freescale.com>
>
> As mx53loco board has two variants: one with Dialog PMIC and another with FSL MC34708 PMIC,
> we need to be able to build both drivers.
>
> Change pmic_init() and PMIC_NUM_OF_REGS names to avoid build conflicts when both drivers are present.
>
> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
> ---
Applied to u-boot-imx, thanks
Best regards,
Stefano Babic
--
=====================================================================
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================
^ permalink raw reply [flat|nested] 18+ messages in thread
* [U-Boot] [PATCH 4/4] mx53loco: Add CONFIG_REVISION_TAG
2012-05-09 9:15 ` [U-Boot] [PATCH " Liu Hui-R64343
@ 2012-05-09 11:20 ` Fabio Estevam
[not found] ` <AD13664F485EE54694E29A7F9D5BE1AF1898C2@039-SN2MPN1-022.039d.mgd.msft.net>
0 siblings, 1 reply; 18+ messages in thread
From: Fabio Estevam @ 2012-05-09 11:20 UTC (permalink / raw)
To: u-boot
On Wed, May 9, 2012 at 6:15 AM, Liu Hui-R64343 <r64343@freescale.com> wrote:
> As you said, could you please use accessor for it?
Yes, I did it in v2:
http://git.denx.de/?p=u-boot/u-boot-imx.git;a=commitdiff;h=b9e28549a2b5c8a2d7d6d6238bd0a64e5730c7cc;hp=9b07d877120f9d1a575df14a101966e04867d0b7
^ permalink raw reply [flat|nested] 18+ messages in thread
* [U-Boot] [PATCH 4/4] mx53loco: Add CONFIG_REVISION_TAG
[not found] ` <AD13664F485EE54694E29A7F9D5BE1AF1898C2@039-SN2MPN1-022.039d.mgd.msft.net>
@ 2012-05-09 12:05 ` Stefano Babic
0 siblings, 0 replies; 18+ messages in thread
From: Stefano Babic @ 2012-05-09 12:05 UTC (permalink / raw)
To: u-boot
On 09/05/2012 13:41, Liu Hui-R64343 wrote:
>> -----Original Message-----
>> From: Fabio Estevam [mailto:festevam at gmail.com]
>> Sent: Wednesday, May 09, 2012 7:21 PM
>> To: Liu Hui-R64343
>> Cc: u-boot at lists.denx.de; sbabic at denx.de; Estevam Fabio-R49496
>> Subject: Re: [PATCH 4/4] mx53loco: Add CONFIG_REVISION_TAG
>>
>> On Wed, May 9, 2012 at 6:15 AM, Liu Hui-R64343 <r64343@freescale.com>
>> wrote:
>>
>>> As you said, could you please use accessor for it?
>>
>> Yes, I did it in v2:
>> http://git.denx.de/?p=u-boot/u-boot-
>> imx.git;a=commitdiff;h=b9e28549a2b5c8a2d7d6d6238bd0a64e5730c7cc;hp=9
>> b07d877120f9d1a575df14a101966e04867d0b7
>
> OK, Stefano, you may need pick up this v2 patch.
This is was I already did - V2 is on u-boot-imx
Best regards,
Stefano Babic
--
=====================================================================
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================
^ permalink raw reply [flat|nested] 18+ messages in thread
end of thread, other threads:[~2012-05-09 12:05 UTC | newest]
Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-07 20:25 [U-Boot] [PATCH 1/3] pmic: dialog: Avoid name conflicts Fabio Estevam
2012-05-07 20:25 ` [U-Boot] [PATCH 2/4] mx53loco: Add mc34708 support and set mx53 frequency at 1GHz Fabio Estevam
2012-05-09 8:57 ` Liu Hui-R64343
2012-05-09 9:11 ` Stefano Babic
2012-05-09 9:17 ` Stefano Babic
2012-05-07 20:26 ` [U-Boot] [PATCH 3/4] mx53loco: Turn on VUSB regulator Fabio Estevam
2012-05-09 8:58 ` Liu Hui-R64343
2012-05-09 9:11 ` Stefano Babic
2012-05-09 9:18 ` Stefano Babic
2012-05-07 20:26 ` [U-Boot] [PATCH 4/4] mx53loco: Add CONFIG_REVISION_TAG Fabio Estevam
2012-05-08 13:40 ` [U-Boot] [PATCH v2 " Fabio Estevam
2012-05-09 9:11 ` Stefano Babic
2012-05-09 9:18 ` Stefano Babic
2012-05-09 9:15 ` [U-Boot] [PATCH " Liu Hui-R64343
2012-05-09 11:20 ` Fabio Estevam
[not found] ` <AD13664F485EE54694E29A7F9D5BE1AF1898C2@039-SN2MPN1-022.039d.mgd.msft.net>
2012-05-09 12:05 ` Stefano Babic
2012-05-09 9:11 ` [U-Boot] [PATCH 1/3] pmic: dialog: Avoid name conflicts Stefano Babic
2012-05-09 9:18 ` Stefano Babic
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox