From mboxrd@z Thu Jan 1 00:00:00 1970 From: Przemyslaw Marczak Date: Tue, 01 Jul 2014 16:36:47 +0200 Subject: [U-Boot] [PATCH v3 06/11] arm:reset: call the reset_misc() before the cpu reset In-Reply-To: <53AD56C8.8050007@samsung.com> References: <1402566394-23342-1-git-send-email-p.marczak@samsung.com> <1403792137-3113-1-git-send-email-p.marczak@samsung.com> <1403792137-3113-7-git-send-email-p.marczak@samsung.com> <53AD3C10.9080604@samsung.com> <53AD56C8.8050007@samsung.com> Message-ID: <53B2C77F.7020506@samsung.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hello Minkyu, On 06/27/2014 01:34 PM, Przemyslaw Marczak wrote: > On 06/27/2014 11:40 AM, Minkyu Kang wrote: >> Dear Przemyslaw Marczak, >> >> On 26/06/14 23:15, Przemyslaw Marczak wrote: >>> On an Odroid U3 board, the SOC is unable to reset the eMMC card >>> in the DWMMC mode by the cpu software reset. Manual reset of the card >>> by switching proper gpio pin - fixes this issue. >>> >>> Such solution needs to add a call to pre reset function. >>> This is done by the reset_misc() function, which is called before >>> reset_cpu(). >>> The function reset_misc() is a weak function. >>> >>> Signed-off-by: Przemyslaw Marczak >>> Cc: Minkyu Kang >>> Cc: Jean-Christophe PLAGNIOL-VILLARD >>> Cc: Albert ARIBAUD >>> Cc: Tom Rini >>> --- >>> arch/arm/lib/reset.c | 7 +++++++ >>> include/common.h | 1 + >>> 2 files changed, 8 insertions(+) >>> >>> diff --git a/arch/arm/lib/reset.c b/arch/arm/lib/reset.c >>> index 7a03580..3b39466 100644 >>> --- a/arch/arm/lib/reset.c >>> +++ b/arch/arm/lib/reset.c >>> @@ -23,6 +23,11 @@ >>> >>> #include >>> >>> +void __reset_misc(void) {} >>> + >>> +void reset_misc(void) >>> + __attribute((weak, alias("__reset_misc"))); >>> + >>> int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const >>> argv[]) >>> { >>> puts ("resetting ...\n"); >>> @@ -30,6 +35,8 @@ int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, >>> char * const argv[]) >>> udelay (50000); /* wait 50 ms */ >>> >>> disable_interrupts(); >>> + >>> + reset_misc(); >>> reset_cpu(0); >>> >>> /*NOTREACHED*/ >>> diff --git a/include/common.h b/include/common.h >>> index 232136c..04bab78 100644 >>> --- a/include/common.h >>> +++ b/include/common.h >>> @@ -629,6 +629,7 @@ int checkicache (void); >>> int checkdcache (void); >>> void upmconfig (unsigned int, unsigned int *, unsigned int); >>> ulong get_tbclk (void); >>> +void reset_misc (void); >>> void reset_cpu (ulong addr); >>> #if defined (CONFIG_OF_LIBFDT) && defined (CONFIG_OF_BOARD_SETUP) >>> void ft_cpu_setup(void *blob, bd_t *bd); >>> >> >> I'm not sure that we really need to add this function to arm common. >> We can do this in reset_cpu (arch/arm/cpu/armv7/exynos/soc.c). >> But if other SoCs also need to add such things then, it can be added >> as arm common. >> >> Thanks, >> Minkyu Kang. >> > > No one used this before, so probably better is to move it into exynos > soc.c code. > > Thank you, I'm working on a next patch set version. And the idea with calling reset_misc() from soc.c is quite bad. Function reset_cpu() is actually dedicated only for cpu software reset - as its name suggest. So I prefer leave the reset_misc call inside do_reset(). Thanks, -- Przemyslaw Marczak Samsung R&D Institute Poland Samsung Electronics p.marczak at samsung.com