[U-Boot] [PATCH 8/8] arm: socfpga: Make the pinmux table const u8
Marek Vasut
marex at denx.de
Wed Aug 19 05:38:05 CEST 2015
On Wednesday, August 19, 2015 at 05:09:23 AM, Dinh Nguyen wrote:
> On 8/10/15 6:10 PM, Marek Vasut wrote:
> > Now that we're actually converting the QTS-generated header files,
> > we can even adjust their data types. A good candidate for this is
> > the pinmux table, where each entry can have value in the range of
> > 0..3, but each element is declared as unsigned long. By changing
> > the type to u8, we can save over 600 Bytes from the SPL, so do it.
> > This patch also constifies the array.
> >
> > Signed-off-by: Marek Vasut <marex at denx.de>
> > ---
> >
> > arch/arm/mach-socfpga/include/mach/system_manager.h | 3 +--
> > arch/arm/mach-socfpga/qts-filter.sh | 2 +-
> > arch/arm/mach-socfpga/system_manager.c | 2 +-
> > arch/arm/mach-socfpga/wrap_pinmux_config.c | 3 +--
> > board/altera/arria5-socdk/qts/pinmux_config.h | 2 +-
> > board/altera/cyclone5-socdk/qts/pinmux_config.h | 2 +-
> > 6 files changed, 6 insertions(+), 8 deletions(-)
> >
> > diff --git a/arch/arm/mach-socfpga/include/mach/system_manager.h
> > b/arch/arm/mach-socfpga/include/mach/system_manager.h index
> > 46af30b..8712f8e 100644
> > --- a/arch/arm/mach-socfpga/include/mach/system_manager.h
> > +++ b/arch/arm/mach-socfpga/include/mach/system_manager.h
> > @@ -12,8 +12,7 @@
> >
> > void sysmgr_pinmux_init(void);
> > void sysmgr_config_warmrstcfgio(int enable);
> >
> > -void sysmgr_get_pinmux_table(const unsigned long **table,
> > - unsigned int *table_len);
> > +void sysmgr_get_pinmux_table(const u8 **table, unsigned int *table_len);
> >
> > #endif
> >
> > struct socfpga_system_manager {
> >
> > diff --git a/arch/arm/mach-socfpga/qts-filter.sh
> > b/arch/arm/mach-socfpga/qts-filter.sh index 16d3a2a..fc41d99 100755
> > --- a/arch/arm/mach-socfpga/qts-filter.sh
> > +++ b/arch/arm/mach-socfpga/qts-filter.sh
> > @@ -66,7 +66,7 @@ process_pinmux_config() {
> >
> > EOF
> >
> > # Retrieve the pinmux config and zap the ad-hoc length encoding
> >
> > - sed -n '/^unsigned/ !b; :next {/^unsigned/ s/\[.*\]/[]/;p;n;b next}' \
> > + sed -n '/^unsigned/ !b; :next {/^unsigned/ {s/\[.*\]/[]/s/unsigned
> > long/const u8/};p;n;b next}' \
> >
> > ${in_dir}/generated/pinmux_config_${soc}.c
>
> Should this change be in it's own patch?
Not really, I think you want to change all the places atomically.
Best regards,
Marek Vasut
More information about the U-Boot
mailing list