[U-Boot] [PATCH 1/2] MX28: Add CONFIG_MX28_DEBUG
Marek Vasut
marex at denx.de
Wed Aug 29 12:59:00 CEST 2012
Dear Stefano Babic,
> On 29/08/2012 03:14, Marek Vasut wrote:
> > This functionality allows configuring SCRATCH0 and SCRATCH1 registers
> > to special values, which make the SPL hang after the CPU was properly
> > initialized.
> >
> > This is for bootstrap purposes only and MUST BE DISABLED for normal
> > operation.
> >
> > Signed-off-by: Marek Vasut <marex at denx.de>
> > Cc: Wolfgang Denk <wd at denx.de>
> > Cc: Stefano Babic <sbabic at denx.de>
> > Cc: Fabio Estevam <fabio.estevam at freescale.com>
> > ---
>
> Hi Marek,
>
> > arch/arm/cpu/arm926ejs/mxs/Makefile | 3 ++
> > arch/arm/cpu/arm926ejs/mxs/mxs_init.h | 6 +++
> > arch/arm/cpu/arm926ejs/mxs/spl_boot.c | 2 +
> > arch/arm/cpu/arm926ejs/mxs/spl_debug.c | 63
> > ++++++++++++++++++++++++++++++++ 4 files changed, 74 insertions(+)
> > create mode 100644 arch/arm/cpu/arm926ejs/mxs/spl_debug.c
> >
> > diff --git a/arch/arm/cpu/arm926ejs/mxs/Makefile
> > b/arch/arm/cpu/arm926ejs/mxs/Makefile index eeecf89..e75eabd 100644
> > --- a/arch/arm/cpu/arm926ejs/mxs/Makefile
> > +++ b/arch/arm/cpu/arm926ejs/mxs/Makefile
> > @@ -29,6 +29,9 @@ COBJS = clock.o mxs.o iomux.o timer.o
> >
> > ifdef CONFIG_SPL_BUILD
> > COBJS += spl_boot.o spl_lradc_init.o spl_mem_init.o spl_power_init.o
> >
> > +ifdef CONFIG_MX28_DEBUG
> > +COBJS += spl_debug.o
> > +endif
> >
> > endif
> >
> > SRCS := $(START:.o=.S) $(COBJS:.o=.c)
> >
> > diff --git a/arch/arm/cpu/arm926ejs/mxs/mxs_init.h
> > b/arch/arm/cpu/arm926ejs/mxs/mxs_init.h index 2ddc5bc..e6f837c 100644
> > --- a/arch/arm/cpu/arm926ejs/mxs/mxs_init.h
> > +++ b/arch/arm/cpu/arm926ejs/mxs/mxs_init.h
> > @@ -42,4 +42,10 @@ uint32_t mxs_mem_get_size(void);
> >
> > void mxs_lradc_init(void);
> > void mxs_lradc_enable_batt_measurement(void);
> >
> > +#ifdef CONFIG_MX28_DEBUG
> > +void mx28_common_spl_debug_halt(void);
> > +#else
> > +static inline void mx28_common_spl_debug_halt(void) {}
> > +#endif
> > +
> >
> > #endif /* __M28_INIT_H__ */
> >
> > diff --git a/arch/arm/cpu/arm926ejs/mxs/spl_boot.c
> > b/arch/arm/cpu/arm926ejs/mxs/spl_boot.c index ad66c57..f4f0c09 100644
> > --- a/arch/arm/cpu/arm926ejs/mxs/spl_boot.c
> > +++ b/arch/arm/cpu/arm926ejs/mxs/spl_boot.c
> > @@ -108,6 +108,8 @@ void mxs_common_spl_init(const iomux_cfg_t
> > *iomux_setup,
> >
> > data->boot_mode_idx = bootmode;
> >
> > + mx28_common_spl_debug_halt();
> > +
> >
> > mxs_power_wait_pswitch();
> >
> > }
>
> I admit I use the same trick when the first initialization fails and I
> want to check what happens. Make the SOC hanging helps, sure.
Yea ... so either way if it's merged or not, I hope it might help someone :)
> However, this is part of the porting / development. Why should we
> introduce this code into mainline ? In the official configuration file
> CONFIG_MX28_DEBUG must be off, and then all this stuff is dead code.
Indeed, I'll shift this decision on you ;-)
>
> Regards,
> Stefano
Best regards,
Marek Vasut
More information about the U-Boot
mailing list