31 Mar, 2020

3 commits

  • We add memory barriers for __raw_readX / __raw_writeX accessors same
    way as it is done for readX and writeX accessors as lots of U-boot
    driver uses __raw_readX / __raw_writeX instead of proper accessor
    with barrier.

    It will save us from lot's of debugging in the future and it is OK
    as U-Boot is not that performance oriented as real run-time
    software like OS or user bare-metal app so we may afford being not
    super fast as we only being executed once.

    Signed-off-by: Eugeniy Paltsev
    Signed-off-by: Alexey Brodkin

    Eugeniy Paltsev
     
  • We must use compiler barriers in C-version read/write IO accessors
    before and after operation (read or write) so it won't be reordered
    by compiler.

    Fixes commit 07906b3dad15 ("ARC: Switch to generic accessors")

    Signed-off-by: Eugeniy Paltsev
    Signed-off-by: Alexey Brodkin

    Eugeniy Paltsev
     
  • We must use 'volatile' in C-version read/write IO accessors
    implementation to avoid merging several reads (writes) into
    one read (write), or optimizing them out by compiler.

    Fixes commit 07906b3dad15 ("ARC: Switch to generic accessors")

    Signed-off-by: Eugeniy Paltsev
    Signed-off-by: Alexey Brodkin

    Eugeniy Paltsev
     

20 Feb, 2020

1 commit


13 Feb, 2020

4 commits

  • First of all U-Boot is not that performance oriented as real run-time
    software like OS or user bare-metal app so we may afford being not super
    fast as we only being executed once. That in return allows us to be more
    universal and support wider variety of devices.

    And looking forward that will significantly reduce maintenance and simplify
    support of newer architectures.

    And while at it we add quad-word accessors like readq(), writeq() etc.

    Signed-off-by: Alexey Brodkin

    Alexey Brodkin
     
  • It's a very rare if at all existing occasion when ARC CPU template
    is used as is w/o any changes - in the end it's a beauty and competitive
    advantage of ARC cores to be tailored for a particular use-case - and
    so it doesn't make a lot of sense to offer template-based "-mcpu" selection.
    Given for each and every platform we end-up adding quite a few more flags
    it's logical to move "-mcpu" selection to platform's definition as well
    which we exactly do here.

    Signed-off-by: Eugeniy Paltsev
    Signed-off-by: Alexey Brodkin

    Eugeniy Paltsev
     
  • Given now nsim_hs38 configuration is usable on QEMU and in QEMU
    we have Virtio working perfectly fine the next logical step
    is to add support of supported & known to work net & bkl to this
    config.

    Signed-off-by: Alexey Brodkin

    Alexey Brodkin
     
  • Since v2019.06 DesingWare nSIM supports DesignWare UART simulation
    and so we may switch from pretty unusual ARC UART to much more standard
    DesignWare UART (which in case of U-Boot is just an ordinary 16650 UART).

    This among other things makes built dinaries compatible with our other
    platforms to name a few: FPGA-based HAPS boards, QEMU and even ZeBU.

    Signed-off-by: Alexey Brodkin

    Alexey Brodkin
     

18 Jan, 2020

1 commit


03 Dec, 2019

4 commits

  • Move these two functions into the irq_funcs.h header file. Also move
    interrupt_handler_t as this is used by the irq_install_handler() function.

    Signed-off-by: Simon Glass
    Reviewed-by: Tom Rini

    Simon Glass
     
  • These functions do not use driver model but are fairly widely used in
    U-Boot. But it is not clear that they will use driver model anytime soon,
    so we don't want to label them as 'legacy'.

    Move them to a new irq_func.h header file. Avoid the name 'irq.h' since it
    is widely used in U-Boot already.

    Signed-off-by: Simon Glass
    Reviewed-by: Tom Rini

    Simon Glass
     
  • These functions belong in cpu_func.h. Another option would be cache.h
    but that code uses driver model and we have not moved these cache
    functions to use driver model. Since they are CPU-related it seems
    reasonable to put them here.

    Move them over.

    Signed-off-by: Simon Glass
    Reviewed-by: Tom Rini

    Simon Glass
     
  • At present this function sits in its own file but it does not really
    justify it. There are similar string functions in vsprintf.h, so move it
    there. Also add the missing function comment.

    Use the vsprintf.h include file explicitly where needed.

    Signed-off-by: Simon Glass
    Reviewed-by: Tom Rini

    Simon Glass
     

01 Nov, 2019

1 commit


08 Oct, 2019

1 commit

  • The commit
    642b80d256e ("net: designware: drop compatible altr, socfpga-stmmac")
    breaks designware ethernet for all ARC boards. It removes
    "altr, socfpga-stmmac" compatible from "drivers/net/designware.c"
    without changing compatible in the boards which use it.

    Fix that by adding "snps,arc-dwmac-3.70a" compatible string to
    "drivers/net/designware.c" and using it in ARC boards device tree.

    Signed-off-by: Eugeniy Paltsev

    Eugeniy Paltsev
     

04 Sep, 2019

1 commit

  • As reported by Kever here [1] we were unable to compile 64-bit division
    code due to missing definition of __udivdi3().

    Import its implementation and __udivmoddi4() as its direct dependency
    from today's libgcc [2].

    [1] https://patchwork.ozlabs.org/patch/1146845/
    [2] https://github.com/gcc-mirror/gcc/commit/5d8723600bc0eed41226b5a6785bc02a053b45d5

    Signed-off-by: Alexey Brodkin
    Cc: Kever Yang

    Alexey Brodkin
     

18 May, 2019

2 commits

  • While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
    where these configuration items are conditional on SPL. This commit adds SPL
    variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
    the configurations as required.

    Acked-by: Alexey Brodkin
    Signed-off-by: Trevor Woerner
    [trini: Make the default depend on the setting for full U-Boot, update
    more zynq hardware]
    Signed-off-by: Tom Rini

    Trevor Woerner
     
  • CONFIG_SYS_[DI]CACHE_OFF had been partially converted to Kconfig
    parameters; only for the ARC architecture. This patch turns these two
    parameters into Kconfig items everywhere else they are found.

    All of the include/configs/* and defconfig changes in this patch are
    for arm machines only. The Kconfig changes for arc, nds32, riscv,
    and xtensa have been included since these symbols are found in code
    under arch/{arc,nds32,riscv,xtensa}, however, no currently-defined
    include/configs/* or defconfigs for these architectures exist which
    include these symbols.

    These results have been confirmed with tools/moveconfig.py.

    Acked-by: Alexey Brodkin
    Signed-off-by: Trevor Woerner
    [trini: Re-migrate for a few more boards]
    Signed-off-by: Tom Rini

    Trevor Woerner
     

18 Apr, 2019

2 commits


12 Apr, 2019

1 commit

  • There is no reason not to use the Linux "jedec,spi-nor" binding in U-Boot
    dts files. This compatible has been added in sf_probe, let use it.

    This patch switches to jedec,spi-nor when spi-flash is used in the DTS
    and DTSI files, and removed spi-flash when jedec,spi-nor is already
    present.

    The x86 dts are switched in a separate commit since it depends on a change
    in fdtdec.

    Signed-off-by: Neil Armstrong
    Acked-by: Stefan Roese
    Reviewed-by: Simon Goldschmidt
    Reviewed-by: Evgeniy Paltsev
    Reviewed-by: Rick Chen
    Reviewed-by: Patrick Delaunay
    Reviewed-by: Jagan Teki

    Neil Armstrong
     

25 Jan, 2019

2 commits


19 Jan, 2019

1 commit

  • The bounce buffer is used by a few drivers (most of the MMC drivers)
    to overcome limitations in their respective DMA implementation.

    This moves the configuration to Kconfig and makes it user-selectable
    (even though it will be a required feature to make those drivers
    work): the expected usage is for drivers depending on this to 'select'
    it unconditionally from their respective Kconfig (see follow-up
    patches).

    This commit includes a full migration using moveconfig.py to ensure
    that each commit compiles. To ensure bisectability we update
    dependencies of various drivers to now select BOUNCE_BUFFER when needed.

    [trini: Squash all patches to ensure bisectability]
    Signed-off-by: Tom Rini
    Signed-off-by: Philipp Tomsich
    Reviewed-by: Otavio Salvador [dw_mmc portion]
    Reviewed-by: Fabio Estevam [mxsmmc portion]
    Reviewed-by: Simon Glass [tegra portion]

    Philipp Tomsich
     

03 Dec, 2018

1 commit

  • 1. Try to guess a ARC core template that was used
    i.e. not just name a core family but something more
    menaingful like "ARC HS38", "ARC EM11D" etc.

    We do it checking availability of the key differentiation
    features like:
    - Caches (we actually only check for L1 I$ fpr simplicity)
    - XY-memory
    - DSP extensions etc.

    2. Identify ARC subsystems

    3. Print core clock frequency

    Signed-off-by: Alexey Brodkin

    Alexey Brodkin
     

02 Nov, 2018

1 commit


15 Oct, 2018

1 commit

  • By default GCC puts global non-initialized variables in COMMON section.
    And we used to ignore existence of COMMON section in our linker
    scripts though smart LD silently appended it right after .bss.

    And the problem here is variables from COMMON section even though
    require zeroing in run-time were not zeroed as they were placed
    right after __bss_end symbol.

    It was a pure luck we never faced serious problem due to this,
    but now it is fixed.

    Now as for some other architectures we'll just force GCC to put
    those global variables in normal .bss section.

    This solution is much nicer than adding COMMON section to each and
    every linker script.

    Signed-off-by: Alexey Brodkin

    Alexey Brodkin
     

12 Oct, 2018

1 commit

  • This allows board to override print_cpuinfo() because
    they might know better which ARChitect template was used.
    This way we may not only derive base architecture type and
    version but more meaningful things like "ARC EM7D" instead of
    simple "ARC EM", "ARC HS36" instead of "ARC HS".

    Signed-off-by: Alexey Brodkin

    Alexey Brodkin
     

05 Oct, 2018

4 commits

  • The DesignWare ARC IoT Development Kit is a versatile platform
    that includes the necessary hardware and software to accelerate
    software development and debugging of sensor fusion,
    voice recognition and face detection designs.

    More information is avaialble here [1] and here [2].

    The board is based on real silicon with
    ARC EM9D-based Data Fusion IP Subsystem.

    It sports a rich set of I/O including
    * DW USB OTG
    * DW MobileStorage (used for micro SD-card)
    * GPIO
    * multiple serial interface including DW APB UART
    * ADC, PWM and eFlash, SRAM and SPI Flash memory
    * Real-Time Clock (RTC)
    * Bluetooth module with worldwide regulatory compliance
    (FCC, IC, CE, ETSI, TELEC)
    * On-board 9-axis sensor (gyro, accelerometer and compass)

    Extensible with Arduino, Pmod, mikroBUS connectors and a 2x18
    extension header.

    One of the most interesting features for developers is built-in
    Digilent USB JTAG probe so only micro-USB cable is needed!

    [1] https://www.synopsys.com/dw/ipdir.php?ds=arc_iot_development_kit
    [2] https://www.synopsys.com/dw/doc.php/ds/cc/iot_dev_kit.pdf

    Signed-off-by: Alexey Brodkin

    Alexey Brodkin
     
  • Once we enable DISPLAY_CPUINFO for ARC we'll see
    ARC core family and version printed on boot.

    Signed-off-by: Alexey Brodkin

    Alexey Brodkin
     
  • 1. This way we sync with Linux kernel where we have model
    set for all ARC boards for quite some time, see [1]

    2. Once we enable DISPLAY_BOARDINFO for ARC this info will
    be printed on boot givin some extra data-point about the board

    [1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=618a9cd06dd471ac232f5b27325b24d26eba5571

    Signed-off-by: Alexey Brodkin

    Alexey Brodkin
     
  • Even though arc-linux- prefix is used in ARC prebuilt tools and
    in Buildroot there're other options like Linux distro cross-tools
    etc where prefix is different so let's not rely on this default.

    Signed-off-by: Alexey Brodkin

    Alexey Brodkin
     

11 Sep, 2018

1 commit


05 Sep, 2018

1 commit


31 Jul, 2018

3 commits

  • Even if ARC core might handle unaligned access to data this
    hardware feature by default is disabled.

    But GCC starting from 8.1.0 unconditionally uses it for ARC HS cores.
    Which leads to quite strange and fatal run-time failures like the one
    below if HW is not configured properly:
    | hsdk# sf probe
    | Misaligned data access exception @ 0xbff794d4
    | ECR: 0x000d0000
    | RET: 0xbff794d4
    | BLINK: 0xbff79644
    | STAT32: 0x00000800
    | GP: 0x1003e000 r25: 0xbfd58f08
    | BTA: 0xbff794a4 SP: 0xbfd58cd4 FP: 0xbfd58ef0
    | LPS: 0xbff90240 LPE: 0xbff90244 LPC: 0x00000000
    | r00: 0x00000000 r01: 0x00000003 r02: 0x000026bf
    | r03: 0x00000000 r04: 0x00000100 r05: 0x00000000
    | r06: 0x00000001 r07: 0x00000000 r08: 0x1dcd6500
    | r09: 0x00000000 r10: 0x00200000 r11: 0x00000000
    | r12: 0x1b3d4440 r13: 0xbff9eca4 r14: 0xbfd59d68
    | r15: 0xbfd60cd0 r16: 0x00000000 r17: 0x00000000
    | r18: 0xbff9ed14 r19: 0xbfd59c78 r20: 0xbfd58d40
    | r21: 0xbfd58d44 r22: 0x00000000 r23: 0x00000000
    | r24: 0xbfd59ba8
    | Resetting CPU ...

    Now we're checking for __ARC_UNALIGNED__ define emitted by the
    compiler if it's going to use unaligned access and then we
    force-enable it in hardware too.

    Signed-off-by: Alexey Brodkin

    Alexey Brodkin
     
  • AXS10x boards have n25q512 spi flash IC, so add corresponding
    nodes to device tree and enaple corresponding options in
    defconfig.

    Signed-off-by: Eugeniy Paltsev
    Signed-off-by: Alexey Brodkin

    Eugeniy Paltsev
     
  • CREG GPIO is a driver for weird soc-specific output ports, which are
    controlled by some fields in memory mapped register.

    Example:

    31 9 7 5 0 < bit number
    | | | | |
    [ not used | gpio-1 | gpio-0 | ] < 32 bit register
    ^ ^
    | |
    write 0x2 == set output to "1" (activate)
    write 0x3 == set output to "0" (deactivate)

    As of tooday we only support fixed (hardcoded) bit per gpio line,
    activate / deactivatei and shift values. Fix that by read them from
    device tree to be able to use this driver for other boards.

    Remove "hsdk" prefix from compatible string as this driver can be
    used with different boards like HSDK, AXS101, AXS103, etc.

    Signed-off-by: Eugeniy Paltsev
    Signed-off-by: Alexey Brodkin

    Eugeniy Paltsev
     

30 Jul, 2018

1 commit


19 Jun, 2018

1 commit


01 Jun, 2018

1 commit

  • Synopsys DesignWare ARC EM Development Kit (ARC EMDK) is
    an FPGA-based development platform from Synopsys aimed to speed-up
    development of software for ARC EM cores and entire subsystems based on
    ARC EM like Data Fusion, Secure and Sensor & Control subsystems.

    U-Boot is supposed to be used as a primary bootloader on EMDK allowing
    users to easily load and start their application from micro-SD card.

    Signed-off-by: Alexey Brodkin

    Alexey Brodkin