From: Wolfgang Denk Date: Sun, 31 Jul 2011 12:03:49 +0200 Subject: [U-Boot] [PATCH v4 2/2] ORIGEN: Add MMC SPL support In-Reply-To: <1311914519-10531-3-git-send-email-chander.kashyap@linaro.org> References: <1311914519-10531-1-git-send-email-chander.kashyap@linaro.org> <1311914519-10531-3-git-send-email-chander.kashyap@linaro.org> Message-ID: <20110731100349.9667D12B7AE4@gemini.denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Dear Chander Kashyap, In message <1311914519-10531-3-git-send-email-chander.kashyap@linaro.org> you wrote: > Adds mmc boot support. > > Signed-off-by: Chander Kashyap > --- > mmc_spl/board/samsung/origen/Makefile | 106 ++++++++++++++++ > mmc_spl/board/samsung/origen/mmc_boot.c | 57 +++++++++ > mmc_spl/board/samsung/origen/tools/mkv310_image.c | 140 +++++++++++++++++++++ > mmc_spl/board/samsung/origen/u-boot.lds | 88 +++++++++++++ > 4 files changed, 391 insertions(+), 0 deletions(-) > create mode 100644 mmc_spl/board/samsung/origen/Makefile > create mode 100644 mmc_spl/board/samsung/origen/mmc_boot.c > create mode 100644 mmc_spl/board/samsung/origen/tools/mkv310_image.c > create mode 100644 mmc_spl/board/samsung/origen/u-boot.lds PLease adapt this code to the new SPL infrastructure that has recently been introduced. > +typedef u32(*copy_sd_mmc_to_mem) \ > + (u32 start_block, u32 block_count, u32 *dest_addr); Quote CodingStyle: Lots of people think that typedefs "help readability". Not so. > +void copy_uboot_to_ram(void) > +{ > + copy_sd_mmc_to_mem copy_bl2 = (copy_sd_mmc_to_mem)*(u32 *)(0x02020030); > + copy_bl2(BL2_START_OFFSET,\ > + BL2_SIZE_BLOC_COUNT, (u32 *)CONFIG_SYS_TEXT_BASE); > +} This code is, in addition to the magic 0x02020030 constant, basicly unreadable. The typedef is especially useless as it is used only in this single case. Please clean this up. > diff --git a/mmc_spl/board/samsung/origen/u-boot.lds b/mmc_spl/board/samsung/origen/u-boot.lds > new file mode 100644 > index 0000000..4a231d9 > --- /dev/null > +++ b/mmc_spl/board/samsung/origen/u-boot.lds What exactly is the reason for needing your own, custom linker script? Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de Defaults are wonderful, just like fire. - Larry Wall in <1996Mar6.004121.27890@netlabs.com>