9
0
Fork 0
Commit Graph

295 Commits

Author SHA1 Message Date
Aleksey Kuleshov 114409c73e MIPS: import optimized string functions from Linux
10x performance gain according to simple test on QEMU malta:
barebox:/ time memcpy 0xa0000000 0xa0001000 0x100000

Signed-off-by: Aleksey Kuleshov <rndfax@yandex.ru>
Acked-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-11-26 09:36:34 +01:00
Antony Pavlov 6991f6ed5f MIPS: tplink-mr3020: skip pbl lowlevel init if running from RAM
TP-Link MR3020 has 4 MiB flash boot ROM.
Usually boot ROM is mapped to 0xbfc00000.
However, as AR9331 allows to remap boot ROM to 0xbf000000
it's better to assume that boot ROM starts at 0xbf000000.

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-11-13 07:52:44 +01:00
Antony Pavlov 1059d00841 MIPS: black-swift: skip pbl lowlevel init if running from RAM
Black Swift has 16 MiB flash boot ROM. The standard board's
bootloader (U-Boot_mod) remaps boot ROM to 0xbf000000.

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Tested-by: Yegor Yefremov <yegorslists@googlemail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-11-13 07:52:44 +01:00
Oleksij Rempel 8891fcc9db MIPS: pbl: add pbl_blt macro
Barebox' PBL is able to initialize SoC's memory controller,
but it can be used only if PBL runs from ROM or on-chip SRAM.
MIPS architecture standard boot vector is 0xbfc00000
so on most MIPS SoCs all addresses higher than 0xbfc00000
belong to boot ROM or on-chip SRAM. Thus there's a
simple criterion to check if PBL runs from ROM: just
check if current PC is higher than 0xbfc00000.
Some MIPS boards have ROM start address lower than 0xbfc00000
so it's reasonable to make ROM start address checking board-dependant.

The pbl_blt macro checks if current pc is lower than
the first argument (ROM start address). If so then
next instruction executed is defined by the second argument
of the macro.

Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Tested-by: Yegor Yefremov <yegorslists@googlemail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-11-13 07:52:44 +01:00
Antony Pavlov a919cac585 MIPS: allow user to pass incorrect address to md command
This commit makes it possible to handle exception on
incorrect data access so 'md' command just show 'xxxxxxxx'
instead of crashing the system.

    barebox:/ md -l 0xa0000003+4
    a0000003: xxxxxxxx                                           ....

Without this commit we will get this

    barebox:/ md -l 0xa0000003+4
    a0000003:
    Ooops, address error on load or ifetch!

    ...

    ### ERROR ### Please RESET the board ###

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-11-11 08:38:24 +01:00
Antony Pavlov f1db81f838 MIPS: import exception registers restoring macros from linux kernel
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-11-11 08:38:24 +01:00
Antony Pavlov 643c5d87dd MIPS: avoid excessive exception
This commit clears ERL (ERror Level) flag on start.
If this flag is set then we get 'TLB miss on load or ifetch'
just after return from exception.

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-11-11 08:38:24 +01:00
Antony Pavlov b6e9c2ae14 MIPS: traps.c: separate registers print stuff to show_regs()
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-11-11 08:38:24 +01:00
Sascha Hauer 736a74ba7a Merge branch 'for-next/mips' 2015-11-06 16:10:37 +01:00
Antony Pavlov e856be5361 MIPS: tplink-mr3020_defconfig: enable pbl; make image shorter
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-11-03 08:25:56 +01:00
Antony Pavlov 0649af6f64 MIPS: tplink-mr3020: add pbl low level init
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-11-03 08:25:56 +01:00
Antony Pavlov 36b8e0d37c MIPS: ath79: add pbl_ar9331_ddr1_config macro
See also u-boot_mod/u-boot/cpu/mips/ar7240/hornet_ddr_init.S

See also this openocd commit:

    commit f59d2d9ecfee8899df531b87b7acaa468725f238
    Author: Oleksij Rempel <linux@rempel-privat.de>
    Date:   Fri Jan 30 13:05:31 2015 +0100

        tcl/target|board: add config Atheros ar9331

Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-11-03 08:25:56 +01:00
Antony Pavlov 11cea6cf71 MIPS: ath79: add black-swift_defconfig
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-11-03 08:25:56 +01:00
Antony Pavlov 770f98d3bf MIPS: ath79: add black-swift board support
Black Swift is a tiny coin-sized embedded computer based on AR9331 SoC.
See http://www.black-swift.com/ for details.

See also Black Swift kickstarter page:
  https://www.kickstarter.com/projects/1133560316/black-swift-tiny-wireless-computer

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-11-03 08:25:56 +01:00
Antony Pavlov 82bd8277f2 MIPS: ath79: add debug_ll_ar9331_init macro
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-11-03 08:25:56 +01:00
Antony Pavlov 61163945cf MIPS: ath79: add pbl_ar9331_uart_enable macro
Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-11-03 08:25:56 +01:00
Antony Pavlov 50725503b3 MIPS: ath79: add pbl_ar9331_ddr2_config macro
See also u-boot_mod/u-boot/cpu/mips/ar7240/hornet_ddr_init.S

Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-11-03 08:25:56 +01:00
Oleksij Rempel 0f8ddb4d53 MIPS: ath79: add pbl_ar9331_pll macro
Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-11-03 08:25:56 +01:00
Peter Mamonov 23492d36be mips: cpuinfo: report secondary cache configuration
Signed-off-by: Peter Mamonov <pmamonov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-11-03 08:25:56 +01:00
Peter Mamonov 9c12b4ae1c mips: c-r4k: detect secondary cache
Signed-off-by: Peter Mamonov <pmamonov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-11-03 08:25:56 +01:00
Sascha Hauer b792124a7d rework remap_range
remap_range is for remapping regions with different cache attributes.
It is implemented for ARM and PowerPC only, the other architectures only
provide stubs.
Currently the new cache attributes are passed in an architecture specific
way and the attributes have to be retrieved by calls to
mmu_get_pte_cached_flags() and mmu_get_pte_uncached_flags().
Make this simpler by providing architecture independent flags which can
be directly passed to remap_range()
Also provide a MAP_ARCH_DEFAULT flag and a arch_can_remap() function.
The MAP_ARCH_DEFAULT defaults to whatever caching type the architecture
has as default. the arch_can_remap() function returns true if the
architecture can change the cache attributes, false otherwise. This
allows the memtest code to better find out what it has to do.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-11-03 07:27:44 +01:00
Antony Pavlov 43399aa5db MIPS: tplink-mr3020_defconfig: enable gpio & leds
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-09-23 10:28:03 +02:00
Antony Pavlov f25a09ded6 MIPS: dts: tplink-mr3020.dts: enable gpio & leds
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-09-23 10:28:03 +02:00
Antony Pavlov 57ce131be9 MIPS: dts: tplink-mr3020.dts: move aliases up
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-09-23 10:28:03 +02:00
Antony Pavlov de8a86401a MIPS: dts: ar9331.dtsi: add gpio
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-09-23 10:28:03 +02:00
Antony Pavlov 15cc058c06 gpio: add ath79-gpio driver for Atheros MIPS SoCs
This driver is based on linux-4.2 driver.

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-09-23 10:28:03 +02:00
Antony Pavlov e40e6e479c MIPS: ath79: use gpiolib
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-09-23 10:28:03 +02:00
Antony Pavlov 495f0034b7 MIPS: refactor SBL start.S code
This commit removes code duplication by using
MIPS PBL macros in the SBL start.S file.

One of the side effects of this patch is that
the only <asm/pbl_macros.h> header file is depends
on the <generated/utsrelease.h> header file.

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-09-23 10:26:37 +02:00
Antony Pavlov 35a0f20255 MIPS: PBL: Add missing pieces for xz compressed PBL image
Also ignore piggy.shipped binary (CONFIG_IMAGE_COMPRESSION_NONE=y).

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-09-21 08:21:50 +02:00
Antony Pavlov 072a4af454 MIPS: mach-ath79: make ar71xx_regs.h assembler-tolerant
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-09-21 08:21:49 +02:00
Sascha Hauer 67e0a30e77 Merge branch 'for-next/restart' 2015-09-01 09:43:55 +02:00
Sascha Hauer 83b0a5ae05 restart: replace reset_cpu with registered restart handlers
This replaces the reset_cpu() function which every SoC or board must
provide with registered handlers. This makes it possible to have multiple
reset functions for boards which have multiple ways to reset the machine.
Also boards which have no way at all to reset the machine no longer
have to provide a dummy reset_cpu() function.

The problem this solves is that some machines have external PMICs or
similar to reset the system which have to be preferred over the
internal SoC reset, because the PMIC can reset not only the SoC but also
the external devices.

To pick the right way to reset a machine each handler has a priority. The
default priority is 100 and all currently existing restart handlers are
registered with this priority. of_get_restart_priority() allows to retrieve
the priority from the device tree which makes it possible for boards to
give certain restart handlers a higher priority in order to use this one
instead of the default one.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-08-27 21:37:03 +02:00
Sascha Hauer 0d14bc0ec4 gpio: Drop asm-generic/gpio.h
Since we no longer have custom gpio function prototypes we can
drop the prototypes from asm-generic/gpio.h can add them to
include/gpio.h instead. While at it add static inline dummy wrappers
for !CONFIG_GENERIC_GPIO so that code using gpios can compile without
gpio support.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-08-20 07:47:11 +02:00
Herve Codina a2136e6cbd exitcall: Add exitcall infrastructure
exitcall infrastructure is based on initcall infrastructure.
It allows to have and use exit call hooks on barebox shutdown.

Signed-off-by: Herve Codina <Herve.CODINA@celad.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-07-13 08:28:19 +02:00
Juergen Borleis c5dc0bfc2c arch/BCM47xx: remove bogus copy'n'paste comment
Signed-off-by: Juergen Borleis <jbe@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-06-26 11:56:23 +02:00
Sascha Hauer 03510ac4fa Merge branch 'for-next/posix_types' 2015-06-09 09:26:44 +02:00
Sascha Hauer 7a429bfb3b Merge branch 'for-next/misc' 2015-06-09 09:26:44 +02:00
Sascha Hauer 760e652a7a Merge branch 'for-next/mips' 2015-06-09 09:26:43 +02:00
Antony Pavlov 5b195079f0 MIPS: asm/debug_ll_ns16550.h: use plain inline instead of __inline__
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-06-04 09:05:10 +02:00
Sascha Hauer 567bdd57b2 mips: use generic posix_types.h
Use generic asm-generic/posix_types.h instead of repeating the
typedefs.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-06-03 09:53:57 +02:00
Sascha Hauer 28a9133470 drop __BITS_PER_LONG
The kernel has __BITS_PER_LONG and BITS_PER_LONG. The formaer
is needed for architectures which support 32bit userspace on a
64bit kernel. This is not relevant for barebox, so drop
__BITS_PER_LONG and use BITS_PER_LONG only.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-05-22 08:00:48 +02:00
Sascha Hauer 9e7d9a5f2a dma: Use generic place for dma_addr_t typedef
Instead of letting all architectures define their own dma_addr_t use
a common place in include/linux/types.h and use a Kconfig symbol that
architectures can select to define the width of dma_addr_t. The same
is done in the Kernel.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-05-22 08:00:48 +02:00
Masahiro Yamada 5731d3ebcc Abolish cpu_read* and cpu_write* accessors
Commit 2e6a88f210 (add cpu native ordered io accessors) introduced
these macros and then commit be57f20cdd (Fix big endian MMIO
primitives) figured out they are equivalent to __raw_{read,write}*.

They turned out unnecessary after all.  Anyway, most source files
use __raw_read* and __raw_write*.

Let's replace a few remaining references and abolish them.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-05-20 08:05:44 +02:00
Antony Pavlov 2bd7bb8972 update dlink-dir-320_defconfig
Just 'make defconfig && mv defconfig arch/mips/configs/dlink-dir-320_defconfig'.

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-05-13 08:23:59 +02:00
Antony Pavlov 4d8be8f01c MIPS: bcm47xx: use PUTC_LL() from common debug_ll_ns16550.h header
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-05-13 08:23:59 +02:00
Antony Pavlov 0f610910e4 MIPS: img-ci20_defconfig: enable network stuff
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-05-12 08:22:20 +02:00
Antony Pavlov 343bdbf2ad MIPS: img-ci20: enable dm9000 ethernet controller
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-05-12 08:22:19 +02:00
Andrey Smirnov c66574342d Makefile.lib: Make 'check_file_size' more flexible
Make 'check_file_size' more flexible by not hardcoding the file whose
size is going to be checked to '$@'. This way it is possible to use
this subroutine to check the size of files other than the target of
the rule.

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-05-07 09:49:40 +02:00
Antony Pavlov 16886bfd01 MIPS: tplink-mr3020: enable nmon
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-05-05 13:41:40 +02:00
Antony Pavlov cd855dd7c3 MIPS: mach-ath79: debug_ll.h: add assembler routines
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-05-05 13:41:40 +02:00