Patchwork [U-Boot,2/3] misc:pmic: Enable PMIC handling at u-boot startup code

login
register
mail settings
Submitter Łukasz Majewski
Date Sept. 26, 2011, 3:10 p.m.
Message ID <1317049825-25751-3-git-send-email-l.majewski@samsung.com>
Download mbox | patch
Permalink /patch/116433/
State Changes Requested
Delegated to: Stefano Babic
Headers show

Comments

Łukasz Majewski - Sept. 26, 2011, 3:10 p.m.
The pmic_init() initialization handler has been added to
board_init_r function.

Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Cc: Stefano Babic <sbabic@denx.de>
---
 arch/arm/lib/board.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
Stefano Babic - Oct. 2, 2011, 4:14 p.m.
Am 26/09/2011 17:10, schrieb Lukasz Majewski:
> The pmic_init() initialization handler has been added to
> board_init_r function.
> 
> Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
> Cc: Stefano Babic <sbabic@denx.de>
> ---
>  arch/arm/lib/board.c |    5 +++++
>  1 files changed, 5 insertions(+), 0 deletions(-)
> 
> diff --git a/arch/arm/lib/board.c b/arch/arm/lib/board.c
> index 85320bc..ea9e3d6 100644
> --- a/arch/arm/lib/board.c
> +++ b/arch/arm/lib/board.c
> @@ -48,6 +48,7 @@
>  #include <nand.h>
>  #include <onenand_uboot.h>
>  #include <mmc.h>
> +#include <pmic.h>
>  
>  #ifdef CONFIG_BITBANGMII
>  #include <miiphy.h>
> @@ -578,6 +579,10 @@ void board_init_r(gd_t *id, ulong dest_addr)
>  		copy_filename(BootFile, s, sizeof(BootFile));
>  #endif
>  
> +#if defined(CONFIG_PMIC)
> +	pmic_init();
> +#endif
> +
>  #ifdef BOARD_LATE_INIT
>  	board_late_init();
>  #endif

I do not think this is correct. Only a few boards have a PMIC, and we
put the initialization in the general code for all ARM. And we cannot
decide *when* the PMIC must be initialized. Maybe a board requires some
other parts (GPIO initialization,...) before accessing the PMIC. It is
better to let the board maintainers to decide when to call this
function. So simply drop this patch, and put the call to pmic_init() in
your s5p_goni code.

Best regards,
Stefano Babic

Patch

diff --git a/arch/arm/lib/board.c b/arch/arm/lib/board.c
index 85320bc..ea9e3d6 100644
--- a/arch/arm/lib/board.c
+++ b/arch/arm/lib/board.c
@@ -48,6 +48,7 @@ 
 #include <nand.h>
 #include <onenand_uboot.h>
 #include <mmc.h>
+#include <pmic.h>
 
 #ifdef CONFIG_BITBANGMII
 #include <miiphy.h>
@@ -578,6 +579,10 @@  void board_init_r(gd_t *id, ulong dest_addr)
 		copy_filename(BootFile, s, sizeof(BootFile));
 #endif
 
+#if defined(CONFIG_PMIC)
+	pmic_init();
+#endif
+
 #ifdef BOARD_LATE_INIT
 	board_late_init();
 #endif