07 Feb, 2019

1 commit


18 Nov, 2018

1 commit

  • Introduce a new Makefile variable for passing LDFLAGS to standalone
    programs. Currently the variable CONFIG_STANDALONE_LOAD_ADDR is
    misued on some archs to pass a specific linker script.

    Signed-off-by: Daniel Schwierzeck
    Reviewed-by: Tom Rini
    Reviewed-by: Rick Chen

    Daniel Schwierzeck
     

15 Sep, 2018

9 commits


11 Sep, 2018

1 commit


07 May, 2018

1 commit

  • When U-Boot started using SPDX tags we were among the early adopters and
    there weren't a lot of other examples to borrow from. So we picked the
    area of the file that usually had a full license text and replaced it
    with an appropriate SPDX-License-Identifier: entry. Since then, the
    Linux Kernel has adopted SPDX tags and they place it as the very first
    line in a file (except where shebangs are used, then it's second line)
    and with slightly different comment styles than us.

    In part due to community overlap, in part due to better tag visibility
    and in part for other minor reasons, switch over to that style.

    This commit changes all instances where we have a single declared
    license in the tag as both the before and after are identical in tag
    contents. There's also a few places where I found we did not have a tag
    and have introduced one.

    Signed-off-by: Tom Rini

    Tom Rini
     

23 Feb, 2018

1 commit

  • With modern GCC, we get warnings such as:
    cmd/jffs2.c: In function 'mtdparts_init':
    arch/sh/include/asm/string.h:110:38:
    warning: array subscript is above array bounds [-Warray-bounds]
    : "0" (__cs), "1" (__ct), "r" (__cs+__n)
    ~~~~^~~~

    This results in a small size reduction as well.

    Cc: Nobuhiro Iwamatsu
    Signed-off-by: Tom Rini

    Tom Rini
     

22 Feb, 2018

1 commit

  • Based on reading over the GCC manual, passing both -m2a and -m2a-nofpu
    are redundant, as -m2a-nofpu will provide functional code for both. As
    -m2a-nofpu functions with more toolchains and does what is expected,
    switch.

    Cc: Nobuhiro Iwamatsu
    Signed-off-by: Tom Rini

    Tom Rini
     

03 Oct, 2017

1 commit

  • Convert the sh architecture to make use of the new asm-generic/io.h to
    provide address mapping functions. As the generic implementations are
    suitable for sh this is primarily a matter of moving code.

    Feedback from architecture maintainers is welcome.

    Signed-off-by: Paul Burton
    Cc: Nobuhiro Iwamatsu

    Paul Burton
     

27 Aug, 2017

1 commit

  • While it is true that we no longer have 'ppcenv' and similar sections,
    including env/embedded.o at all results in the text/etc sections being
    available for the rest of the link. This in turn is required for the
    setup used on ms7722se. This also, likely, needs further fine-tuning.

    Fixes: f40ad66fa066 ("arch/sh: don't bring common/env_embedded.o into the link")
    Signed-off-by: Tom Rini

    Tom Rini
     

26 Aug, 2017

2 commits

  • The linker script for SuperH brings the .ppcenv and .ppcenvr section
    of common/env_embedded.o into the .text section. However, the .ppcenv
    section is only ever filled in by env_embedded.o when
    CONFIG_SYS_USE_PPCENV is defined, but no platforms in mainline U-Boot
    use this.

    In addition, common/env_embedded.o is not always built (when you use
    CONFIG_ENV_IS_NOWHERE for example), which causes the following build
    failure:

    Fixes:

    LD u-boot
    /home/thomas/sh4aeb-linux-musl/bin/sh4aeb-linux-ld.bfd: cannot find common/env_embedded.o

    We fix this by no longer adding the .ppcenv and .ppcenvr sections from
    common/env_embedded.o into the .text section.

    Signed-off-by: Thomas Petazzoni
    Signed-off-by: Nobuhiro Iwamatsu

    Thomas Petazzoni
     
  • The SuperH architecture allows to be run in either little or big
    endian mode. Some SuperH SoCs get the little vs. big endian decision
    through mode pins sampled at reset, so if big endian has been choosen
    by HW designers, it cannot be easily changed.

    Therefore, it makes sense to allow building U-Boot for SuperH in big
    endian mode. To allow this, the only change needed is to adjust the
    OUTPUT_FORMAT() in the linker script.

    Signed-off-by: Thomas Petazzoni

    Thomas Petazzoni
     

16 Aug, 2017

2 commits

  • We are now using an env_ prefix for environment functions. Rename these
    two functions for consistency. Also add function comments in common.h.

    Quite a few places use getenv() in a condition context, provoking a
    warning from checkpatch. These are fixed up in this patch also.

    Suggested-by: Wolfgang Denk
    Signed-off-by: Simon Glass

    Simon Glass
     
  • At present we support multiple environment drivers but there is not way to
    select between them at run time. Also settings related to the position and
    size of the environment area are global (i.e. apply to all locations).

    Until these limitations are removed we cannot really support more than one
    environment location. Adjust the location to be a choice so that only one
    can be selected. By default the environment is 'nowhere', meaning that the
    environment exists only in memory and cannot be saved.

    Also expand the help for the 'nowhere' option and move it to the top since
    it is the default.

    Signed-off-by: Simon Glass
    [trini: Move all of the imply logic to default X if Y so it works again]
    Signed-off-by: Tom Rini

    Simon Glass
     

15 Aug, 2017

1 commit


12 Aug, 2017

1 commit


26 Jul, 2017

1 commit


03 Dec, 2016

16 commits

  • Finally add fpic compilation option to produce relocatable code.
    Note that this requires to define CONFIG_NEEDS_MANUAL_RELOC for all
    board files, also relocation support still has some limitations
    (e.g. a developer should care not to overwrite the executing code or
    memset() with zeroes not yet relocated data on malloc init etc.),
    which may be fixed while switching to PIE.

    Due to short investigation the architecture code is not ready for PIE
    linking, this will require some manipulations with .dyn* sections.

    Signed-off-by: Vladimir Zapolskiy

    Vladimir Zapolskiy
     
  • It is easy to note that SH2/SH3/SH4 start.S code is practically
    the same with a minor difference for SH2 where a short data header is
    present. To avoid unwanted code duplication and to automatically
    convert SH2 and SH3 platforms to generic board support move fixed SH4
    start.S into arch/sh/lib/start.S and share it among all platforms.

    Signed-off-by: Vladimir Zapolskiy
    Reviewed-by: Simon Glass

    Vladimir Zapolskiy
     
  • Like on ARM platform keep the first code relocation from a U-boot
    image storage to RAM at CONFIG_SYS_TEXT_BASE, then pass execution to a
    generic board_init_f() with empty GD flags. If CONFIG_SYS_TEXT_BASE is
    equal to a calculated by board_init_f() relocation address there will
    be no more code and data copy, however it's worth to mention that the
    first copy happens even if $pc on _start is the same as
    CONFIG_SYS_TEXT_BASE, on practice this works without a problem.

    Also note that _sh_start is renamed back to _start to correct
    gd->mon_len calculation by setup_mon_len(), the opposite rename was
    done in pre-generic board commit 2024b968ee9 ("sh: Fix build in start.S").

    Signed-off-by: Vladimir Zapolskiy
    Reviewed-by: Simon Glass

    Vladimir Zapolskiy
     
  • Commits b61e90e6fd83 ("sh: Drop the arch-specific board init") and
    f41e6088eb1a ("sh: Fix build errors for generic board") left code and
    data relocation done in start.S, however further actual U-boot
    configuration is not started anymore. Practically SH boards with the
    code relocated into the expected position by start.S still can be
    booted, so the change adds this option and provides an option how to
    relocate code for board_init_r() execution.

    Signed-off-by: Vladimir Zapolskiy
    Reviewed-by: Simon Glass

    Vladimir Zapolskiy
     
  • Generic board support assumes a different method of specifying
    DRAM size on board, also it can be shared among all boards, notably
    only sh7763rdp board has a custom legacy dram_init(), however
    the difference is only in printing some additional information,
    this feature can be removed.

    Signed-off-by: Vladimir Zapolskiy
    Reviewed-by: Simon Glass

    Vladimir Zapolskiy
     
  • At the moment in runtime all defined sections are copied into or
    created in RAM, specify this explicitly to assert potential out of RAM
    placements of the sections.

    Signed-off-by: Vladimir Zapolskiy
    Reviewed-by: Simon Glass

    Vladimir Zapolskiy
     
  • No functional change, concentrate linker script commands in one
    place for convenience. Entry point is set to CONFIG_SYS_TEXT_BASE by
    default on build, so this option can be omitted from being added to
    the linker script.

    Signed-off-by: Vladimir Zapolskiy
    Reviewed-by: Simon Glass

    Vladimir Zapolskiy
     
  • Reference lowlevel_init of all supported SH2A/SH3/SH4/SH4A boards
    from a shared linker script, the lowlevel_init function will be called
    by a relative address.

    Signed-off-by: Vladimir Zapolskiy
    Reviewed-by: Simon Glass

    Vladimir Zapolskiy
     
  • Three supported SH4/SH4A boards with the bootloader image stored on
    SPI flash have own flavour of a linker script, in turn they are equal
    among each other. The only difference is that the text from
    lowlevel_init.o is placed right after start.o, which makes sense.

    Note that .bss section is not marked as NOLOAD, because for about
    10 years this is a default option of a GNU linker, either the
    attribute is found or not the resulting image file is the same.

    Signed-off-by: Vladimir Zapolskiy
    Reviewed-by: Simon Glass

    Vladimir Zapolskiy
     
  • Defined __io is no-op for the SH architecture and it can be removed
    from board files without any functional change.

    Signed-off-by: Vladimir Zapolskiy
    Reviewed-by: Simon Glass

    Vladimir Zapolskiy
     
  • No functional change, moving cache manipulation functions into cache.c
    allows to collect all of them in a single location and as a pleasant
    side effect cache_control() function can be unexported now.

    Signed-off-by: Vladimir Zapolskiy
    Reviewed-by: Simon Glass

    Vladimir Zapolskiy
     
  • cache_wback_all() is a local function and it is called from
    cache_control() only, which is in turn jumps to P2 area.

    The change fixes an issue when cache_wback_all() returns from P2 to
    P1, however cache_control() continues to manipulate with CCR
    register, according to the User's Manual this is restricted.

    Signed-off-by: Vladimir Zapolskiy

    Vladimir Zapolskiy
     
  • Both jump_to_P2() and back_to_P1() functions are found in asm/system.h
    header file and functionally they are the same, don't redefine them.

    Signed-off-by: Vladimir Zapolskiy
    Reviewed-by: Simon Glass

    Vladimir Zapolskiy
     
  • The change is similar to commit 994b56616bae ("sh: delete an unused
    source file") for SH2, however here the removed cache.c file was
    built and included into an image as a dead code.

    If it is needed in future the contents can be reused from a similar
    arch/sh/cpu/sh4/cache.c file, which is in turn will be moved to
    a shared among all core flavours location at arch/sh/lib/cache.c.

    Signed-off-by: Vladimir Zapolskiy
    Reviewed-by: Simon Glass

    Vladimir Zapolskiy
     
  • In common usecases flush_cache() assumes both cache invalidation and
    write-back to memory, instead of doing cache invalidation only with
    the wrapped 'ocbi' instruction pin flush_cache() to cache invalidation
    with memory write-back done by 'ocbp'.

    Signed-off-by: Vladimir Zapolskiy
    Reviewed-by: Simon Glass

    Vladimir Zapolskiy
     
  • In common usecases flush_cache() assumes both cache invalidation and
    write-back to memory, thus in flush_dcache_range() implementation
    change SH4 cache write-back only instruction 'ocbwb' with cache purge
    instruction 'ocbp', according to the User's Manual there should be no
    performance penalty for that.

    Note that under circumstances only cache invalidation is expected from
    flush_cache() call, in these occasional cases the current version of
    flush_cache() works, which is a wrapper over invalidate_dcache_range()
    at the moment, this will be fixed in the following change.

    Signed-off-by: Vladimir Zapolskiy

    Vladimir Zapolskiy