9
0
Fork 0
Commit Graph

192 Commits

Author SHA1 Message Date
Antony Pavlov 0208fdb15b MIPS: mach-loongson: add loongson-ls1b board
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-01-30 10:43:55 +01:00
Antony Pavlov 0b2b371a55 MIPS: add initial Loongson-1X SoC stuff
This code is based on linux-3.6 code.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-01-30 10:43:55 +01:00
Alexander Shiyan 717b8bbcfd MIPS: mach-ar231x: Fix uninitialized variable
Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-01-29 21:38:09 +01:00
Antony Pavlov 7c0da29613 MIPS: add Loongson-1B processor constants and CPU probe
This commit is based on this linux commit:

    commit 2fa36399e63c911134f28b6878aada9b395c4209
    Author: Kelvin Cheung <keguang.zhang@gmail.com>
    Date:   Wed Jun 20 20:05:32 2012 +0100

        MIPS: Add CPU support for Loongson1B

        Loongson 1B is a 32-bit SoC designed by Institute of Computing Technology
        (ICT) and the Chinese Academy of Sciences (CAS), which implements the
        MIPS32 release 2 instruction set.

        [ralf@linux-mips.org: But which is not strictly a MIPS32 compliant device
        which also is why it identifies itself with the Legacy Vendor ID in the
        PrID register.  When applying the patch I shoveled some code around to
        keep things in alphabetical order and avoid forward declarations.]

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-01-21 07:59:37 +01:00
Antony Pavlov 2118632f5b MIPS: add Loongson-1B CPU Kbuild stuff
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-01-21 07:59:37 +01:00
Antony Pavlov a83c1ad761 MIPS: add initial Loongson-family documentation
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-01-21 07:59:37 +01:00
Antony Pavlov a3528064bc MIPS: add initial Loongson-based boards support
Loongson (simplified Chinese: 龙芯; pinyin: Lóngxīn; literally: "Dragon Core")
is a family of general-purpose MIPS CPUs developed at the Institute of Computing
Technology (ICT), Chinese Academy of Sciences (CAS) in the People's Republic of China.

See http://en.wikipedia.org/wiki/Loongson for details.

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-01-21 07:59:37 +01:00
Du Huanpeng 3173c27e4a mips asm/types.h: add #ifndef to fix compile error
without "#ifndef __ASSEMBLY__ #endif", an assembly file
including this file will break compilation.

Signed-off-by: Du Huanpeng <u74147@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-01-06 09:22:31 +01:00
Antony Pavlov 28c1421670 MIPS: import exception registers saving from linux kernel
Checking registers saving:

    $ make qemu-malta_defconfig
    $ make

    ...

    $ qemu-system-mips -nodefaults -M malta -m 256 \
       -nographic -serial stdio -bios ./barebox-flash-image

    ...

    barebox:/ md -l 0x03

    Ooops, address error on load or ifetch!

    $ 0   : 00000000 00000000 ffffffff 0000003f
    $ 4   : 00000000 ffffffff 00000004 00000004
    $ 8   : 00000003 a0404d50 00000001 00000002
    $12   : a0404d50 0000000a a0840000 00000003
    $16   : 00000100 a0404d50 00000100 00000003
    $20   : 00000000 a0406cd8 00000000 00000000
    $24   : a083b4d8 a083058c
    $28   : 00000000 a03ffca8 a0406ab0 a0830604
    Hi    : 00000000
    Lo    : 00000040
    epc   : a083056c
    ra    : a0830604
    Status: 00000006
    Cause : 00000410
    Config: 80008482

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

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-12-04 17:01:11 +01:00
Antony Pavlov ddac4f3ea2 MIPS: add asm-offsets.h generation
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-12-04 17:01:11 +01:00
Antony Pavlov 597b2a2697 MIPS: qemu-malta: doc: add gxemul documentation
GXemul is another MIPS emulator with Malta board support.
As opposed to qemu GXemul supports only fixed GT64120
YAMON-compatible PCI mapping.

As now barebox uses YAMON-style mapping  we can
use GXemul for barebox run.

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-10-28 09:01:48 +01:00
Antony Pavlov 7b29868f3e MIPS: qemu-malta: use YAMON-style GT64120 memory map
There are some reasons for using YAMON-style memory map:
* we can run Linux kernel from barebox;
* we can use GXemul for running barebox.

YAMON-style GT64120 memory map make move UART to the new position.

The files gt64120.h and mach-gt64120.h are imported from Linux.

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-10-28 09:01:48 +01:00
Antony Pavlov 0ac73f1326 MIPS: qemu-malta: update qemu-malta.dox
Only PBL-enabled barebox-flash-image can correctly
get round BoadrID address (0x1fc00010), so let's
recommend barebox-flash-image.

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-10-28 09:01:48 +01:00
Antony Pavlov 401225a04b MIPS: qemu-malta: don't use BoardID address for executable code
On MIPS Technologies boards 0x1fc00010 address
is reserved for BoardID. The hardware or emulator
intercepts accesses to this address and we can't use
this address for storing code.

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-10-28 09:01:48 +01:00
Antony Pavlov 6f81bcd822 MIPS: qemu-malta: doc: drop broken mips.com link
On 8 February 2013 MIPS Technologies was acquired
by Imagination Technologies. Now the http://www.mips.com/ site
is redirected to http://www.imgtec.com/, the Malta development
board page is unreachable.

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-10-28 09:01:48 +01:00
Sascha Hauer d32008b279 Merge branch 'for-next/mips' 2013-10-07 08:00:16 +02:00
Sascha Hauer b2755ea06d mips: bcm47xx: Fix compiler warning
Fixes:

arch/mips/mach-bcm47xx/include/mach/debug_ll.h: In function 'PUTC_LL':
arch/mips/mach-bcm47xx/include/mach/debug_ll.h:33: warning: passing argument 1 of '__raw_readb' makes pointer from integer without a cast
arch/mips/mach-bcm47xx/include/mach/debug_ll.h:34: warning: passing argument 2 of '__raw_writeb' makes pointer from integer without a cast

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-10-02 09:50:48 +02:00
Dmitry Smagin 353e6ce7d9 MIPS: rzx50_defconfig: enable devicetree
Signed-off-by: Dmitry Smagin <dmitry.s.smagin@gmail.com>
Acked-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-09-19 08:53:30 +02:00
Dmitry Smagin cb8ea6f3b3 MIPS: rxz50: add initial devicetree support
Memory initialization is moved from board.c to rzx50.dts file.

Signed-off-by: Dmitry Smagin <dmitry.s.smagin@gmail.com>
Acked-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-09-19 08:53:16 +02:00
Sascha Hauer 7f6b6d25d8 Merge branch 'for-next/omap'
Conflicts:
	arch/arm/boards/pcm051/env/config
2013-09-05 10:40:04 +02:00
Sascha Hauer 1729b1798e Merge branch 'for-next/boardinfo'
Conflicts:
	arch/mips/boards/qemu-malta/init.c
	commands/bootm.c
	drivers/of/base.c
2013-09-05 10:39:22 +02:00
Sascha Hauer 4960dc9db0 rework debug_ll
Convert to static inline functions and use lower case letters for function
names. Also, include mach/debug_ll.h when an architecture provides support
for debug_ll, not only when it's actually enabled. This allows architecures
to put some UART initialization code into mach/debug_ll.h which is compiled
out when debug_ll is disabled.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-09-05 10:15:48 +02:00
Antony Pavlov c9b62b2cb2 MIPS: qemu-malta: switch to devicetree
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-09-04 08:32:17 +02:00
Sascha Hauer 068bed22a6 Set model and hostname at boardlevel
With multiboard support the compiletime generated BOARDINFO string
gets more and more meaningless. This removes it from Kconfig and
replaces it with a variable that can be set at boardlevel.

Also many boards have a standard setting for the hostname in the
environment. This patch also moves the standard to C code by calling
barebox_set_hostname().

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-08-16 08:40:55 +02:00
Sascha Hauer a4b1ee0def Merge branch 'for-next/mips' 2013-08-05 12:49:58 +02:00
Antony Pavlov d081e75b04 pbl: add generated file piggy.lz4 to .gitignore
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-08-05 12:11:25 +02:00
Jean-Christophe PLAGNIOL-VILLARD 618d669117 pbl: add lz4 support
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-07-22 09:15:32 +02:00
Antony Pavlov 17fc4f6580 MIPS: rzx50: add nmon support
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-07-09 08:56:48 +02:00
Antony Pavlov af8a02eeb5 MIPS: qemu-malta: add nmon
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-06-25 21:36:04 +02:00
Antony Pavlov 78d13b1339 MIPS: qemu-malta: rework debug_ll.h
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-06-25 21:36:04 +02:00
Antony Pavlov 15001b1f95 MIPS: pbl: add nmon MIPS nano-monitor
nmon is a tiny monitor (<1200 bytes) program
for the MIPS processors.
It can operate with NO working RAM at all!
It uses only the processor registers and NS16550-compatible
UART port for operation, so it can be used for a memory
controller setup code debugging.

With no changes nmon should work on different MIPS
processors as it uses only common MIPS-I instructions.

nmon is inspired by mmon, MIPS VR4300 Mini-monitor.

mmon is copyrighted 1996, 2003 by Eric Smith.
Also Alexander Voropay must be noted for his work
on qemu & YAMON mmon adaptations made in 2006 and 2007.

See http://www.brouhaha.com/~eric/software/mmon/
for mmon details.

The mmon's features missed in nmon:

 * batch memory dumps;
 * byte and 16-bit half-words dumps and stores;
 * fill memory;
 * load S-records (this function make sense only
 if RAM works properly).

nmon has only 4 commands:
 q - quit to barebox
 d <addr> - read 32-bit word from <addr> address
 w <addr> <val> - write 32-bit word <val> to <addr>
 g <addr> - jump to <addr>

Addresses and data must be given in hexadecimal.
Everything (including hex digits 'a'..'f') must
be in lower case.

EXAMPLE: change value of word with address 0xa0000000

nmon> d a0000000
00000000
nmon> w a0000000 12345678
nmon> d a0000000
12345678
nmon>

There is no error checking of any kind. If you
give an invalid address you will probably get
an exception which will hang the board and you
will have to press the reset button.

You can interrupt current command (e.g. you have
made error in input <addr> value) by pressing
the <ESC> key.

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-06-25 21:36:04 +02:00
Oleksij Rempel e6acb3f4b2 netgear-wg102: pbl, add extra check for mem config
if E0 flag is not set, sdram is defenetly not configured.

Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-06-21 09:33:19 +02:00
Antony Pavlov 094177c64c MIPS: mach-ar231x: enable DEBUG_LL
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-06-21 09:33:19 +02:00
Oleksij Rempel 48318c42bd MIPS: netgear-wg102: add debug_ll
Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-06-21 09:33:19 +02:00
Oleksij Rempel b8a6290e03 MIPS: netgear-wg102: add pbl support
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-06-21 09:33:19 +02:00
Oleksij Rempel ed61198836 MIPS: mach-ar231x: add lowlevel init pbl macros
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>
2013-06-21 09:33:18 +02:00
Oleksij Rempel 24b0d2effd MIPS: pbl: add pbl_probe_mem macro
Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-06-21 09:33:18 +02:00
Oleksij Rempel 23a1960361 MIPS: pbl: add pbl_sleep macro
Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-06-21 09:33:18 +02:00
Antony Pavlov 2a2a10fce4 MIPS: pbl: add mips_barebox_10h asm macro
The mips_barebox_10h macro inserts at offset 0x10
of the barebox image the string 'barebox ' followed
by compile time version mark.

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-06-21 09:33:18 +02:00
Antony Pavlov 5ba21ffc44 MIPS: pbl: remove extra copyrights
Remove Shinya Kuribayashi's copyright on the ADR macro
in start-pbl.S as we don't define this macro in
this file or even use it where.

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-06-18 09:05:14 +02:00
Antony Pavlov d3f6aca16a MIPS: pbl: use generated label in ADR macro
The generated label usage make possible
to use the ADR macro many times.

If we don't use a generated label and we try
to use the ADR macro second time then we get

   Error: symbol `_pc' is already defined

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-06-18 09:05:14 +02:00
Antony Pavlov e1b12c4758 MIPS: pbl: remove extra LONGSIZE definition
We already have the LONGSIZE macro definition in <asm/asm.h>.

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-06-18 09:05:14 +02:00
Antony Pavlov ebefdd4e0d MIPS: rzx50_defconfig: use UART1 for low-level debug
By default CONFIG_JZ4750D_DEBUG_LL_UART0 is selected.
This can confuse the Ritmix RZX50 user as the board
has only UART1 connected.

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-06-04 07:18:42 +02:00
Antony Pavlov 1beb91a723 MIPS: rzx50: pbl: use debug_ll
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-06-04 07:18:42 +02:00
Antony Pavlov bf26aa0002 MIPS: unify ns16550 debug_ll support code
This commit moves the C debug_ll code from
the MIPS <debug_ll_ns16550.h> header file to
the MIPS <asm/debug_ll_ns16550.h> header file,
so the C code and the asm code can use the same
register address macros.

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-06-04 07:18:42 +02:00
Antony Pavlov e79e946723 MIPS: malta: prepare for new debug_ll
Set fake DEBUG_LL_UART_DIVISOR to use <asm/debug_ll_ns16550.h>.

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-06-04 07:18:42 +02:00
Antony Pavlov fcffb0d2c6 MIPS: rzx50: prepare for new debug_ll
Set DEBUG_LL_UART_DIVISOR to use <asm/debug_ll_ns16550.h>.

The JZ4755 uses 24 MHz as the main reference frequency (EXCLK).
The UART controller can work on full EXCLK or on EXCLK/2.
Just now we use EXCLK/2 legacy clock setup made by U-Boot.
So set UART controller base frequency to 12 MHz.

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-06-04 07:18:42 +02:00
Antony Pavlov 68d80258ef MIPS: pbl: add low-level debug asm macros for ns16550
This patch adds macros for ns16550 port initialisation
and single char output. The macros can be used in
MIPS asm pbl code.

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-06-02 11:24:21 +02:00
Antony Pavlov 3c90cbfa64 MIPS: XBurst: use mach-specific debug_ll setup
Ingenic JZ4755 SoC (JZ4750D family) has three UARTs.
So we can give to the user choose which one of them
to use for low level debug (debug_ll) output.

Also this commit adapts the only JZ4755 board
(Ritmix RZX50) for using the new debug_ll port
selection.

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-06-02 11:24:21 +02:00
Oleksij Rempel b993cc4a22 MIPS: ar231x: add netgear-wg102
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-05-31 08:56:33 +02:00
Oleksij Rempel 59fe549733 MIPS: add Atheros ar531x family support
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>
2013-05-31 08:56:33 +02:00
Antony Pavlov df308bd4bf MIPS: asm/mipsregs.h: remove unused stuff
In barebox we have no CONFIG_MIPS_MT_SMTC Kconfig option.
So remove the code under this macro.

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-05-31 08:35:25 +02:00
Antony Pavlov 77bcb1fa00 MIPS: rzx50: enable pbl in defconfig
Also enable the iomem and poweroff commands.

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-05-28 08:06:07 +02:00
Antony Pavlov 41448848fc MIPS: XBurst: enable pbl support
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-05-28 08:06:07 +02:00
Antony Pavlov de9afb4d6e MIPS: rzx50: add trivial board_pbl_start
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-05-28 08:06:07 +02:00
Antony Pavlov e99906d846 MIPS: qemu-malta_defconfig: enable OF support
Also enable iomem.

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-05-13 21:17:10 +02:00
Antony Pavlov 6cdc8f4b02 MIPS: qemu-malta: add device tree support
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-05-13 21:17:10 +02:00
Antony Pavlov 6fe6d9fdc2 MIPS: add initial device tree support
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-05-13 21:17:10 +02:00
Antony Pavlov 8b35646356 MIPS: rzx50: switch to common mach-xburst serial code
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-05-08 09:37:20 +02:00
Antony Pavlov 2d4cf6d95d MIPS: xburst: use common serial code
The Ingenic JZ4740, JZ4755 and JZ4770 SoCs use
the same IP core for UART interface. This IP core
is NS16550-compatible, but it needs small workaround.

This commit moves the UART code for Ingenic SoCs
from board level to machine level. So the code
can be reused for different boards or even
different SoCs.

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-05-08 09:37:20 +02:00
Alexander Shiyan 90c94f4483 Remove unused config.h
Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-04-09 08:42:52 +02:00
Sascha Hauer e91c960a5e mips: initialize malloc pool before start_barebox()
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-03-14 08:41:15 +01:00
Antony Pavlov e43e1498f6 MIPS: pbl: fix none compression support
Here's the error message:

  AS      arch/mips/pbl/piggy.shipped.o
  arch/mips/pbl/piggy.shipped.S: Assembler messages:
  arch/mips/pbl/piggy.shipped.S:1: Error: unrecognized opcode `globl input_data'
  make[1]: *** [arch/mips/pbl/piggy.shipped.o] Error 1
  make: *** [zbarebox.bin] Error 2

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-02-05 09:43:17 +01:00
Sascha Hauer 56325edd79 Merge branch 'for-next/pbl' 2013-02-04 15:49:07 +01:00
Sascha Hauer da5fe0ba47 Merge branch 'for-next/misc' 2013-02-04 15:49:00 +01:00
Jean-Christophe PLAGNIOL-VILLARD 08147d427f pbl: add none compression support
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-01-30 22:32:13 +01:00
Jean-Christophe PLAGNIOL-VILLARD f73a37aa78 pbl: factorise decompressor
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-01-30 22:32:13 +01:00
Antony Pavlov ba979549d6 MIPS: dlink-dir-320: use mips_add_ram0()
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-01-27 22:41:27 +01:00
Antony Pavlov 73d54d0dc6 MIPS: rzx50: use mips_add_ram0()
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-01-27 22:41:27 +01:00
Antony Pavlov 7eb6159f18 MIPS: qemu-malta: use mips_add_ram0()
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-01-27 22:41:27 +01:00
Antony Pavlov ee3e2a8392 MIPS: introduce ram0 regions register function
On MIPS there are two segments in CPU address space that
can be used for untranslated memory access: KSEG0 and KSEG1.
KSEG0 is used for cached access and KSEG1 is used for
uncached one.

The instroduced mips_add_ram0() function registers two
address regions for memory access: one in KSEG0 and
the other one in KSEG1.

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-01-27 22:41:27 +01:00
Alexander Aring 43afe67390 barebox-data: add barebox-data sections
Add barebox-data section in arm branch to get complete
barebox regions in sdram regions tree.

Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-01-18 11:56:50 +01:00
Alexander Aring 47326f80a9 remap_range: make function 'remap_range' global
Change function remap_range in arm architecture to make it
global accessable. For example command 'memtest' can change
pte flags to enable or disable cache.

Add dummy function for others architectures that doesn't
have mmu or pte support.

Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-01-18 08:28:20 +01:00
Antony Pavlov fbf112a3bc MIPS: qemu-malta_defconfig: use pbl
USAGE

 $ make qemu-malta_defconfig
   ...
 $ make
   ...
 $ qemu-system-mips -nodefaults -M malta -m 256 \
           -nographic -serial stdio -bios ./barebox-flash-image

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-12-14 08:34:33 +01:00
Antony Pavlov eaa76cc34d MIPS: qemu-malta: add trivial pbl support
Trivial pbl support has no cpu specific setup.
We will add cache setup routines in the future.

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-12-14 08:34:33 +01:00
Antony Pavlov f369f64ed1 MIPS: add pre-bootloader (pbl) image support
This patch is based on ARM pbl support and allows
creating a pre-bootloader binary for compressed image.

For different MIPS SoCs (or even for different boards based
 on the same SoC) the operations carried on in start-pbl.S
can be very different. The additional constraints can be imposed
on the size of the boot code or the special magic labels in
the beginning of the boot code; In some cases it could be
necessary to show CPU is alive as early as possible
(transmit a char via UART or blink a LED).
So the demands for pbl start operation can be very different.

E.g. malta board store boot code at the NOR flash mapped
to the MIPS power-on address (0xbfc00000); it is the most
simple case: we need just copy pbl image from direct-mapped
flash to RAM and jump there.

The XBurst-powered boards store boot code in the beginning
of a NAND flash or in the beginning of SD/MMC card.
In this case we must use simple and short NAND or SD/MMC access
routines to copy pbl image to RAM.

To meet so different demands a simple technique is selected:

* MIPS pbl entry point located in file arch/mips/boot/start-pbl.S.

* MIPS pbl code (see start-pbl.S) assumes that every pbl-enabled
board has a arch/mips/boards/<BOARD>/include/board/board_pbl_start.h
header file. This file must contain definition of
the board_pbl_start macro. This macro is used as start of pbl image;

* the most popular asm routines (stack setup, relocation to link
address, NS16550 initialization (WIP) and so on) are containt
in the arch/mips/include/asm/pbl_macros.h header file.
So board pbl macro can use it if necessary.
It is possible to create similar headers with macros for each
specific SoC; so even if we have many different boards based
on the same SoC the board_pbl_start macro for every board
can be short and clear.

* after board-specific initialization the stack pointer
is initialized and pbl C code is started.

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-12-14 08:34:33 +01:00
Sascha Hauer 8030ab24fa Merge branch 'kconfig' 2012-12-08 12:22:21 +01:00
Alexander Shiyan 4c20f9af97 Cleanup Kconfig files
This patch provides a global cleanup barebox Kconfig files. This includes
replacing spaces to tabs, formatting in accordance format, removing
extraneous lines and spaces. No functional changes.

Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-12-08 12:22:12 +01:00
Sascha Hauer 9fe8679d3b debug_ll: Let architectures define PUTC_LL directly
putc already is a regular barebox function. To avoid conflicts and
confusions just let architectures define PUTC_LL directly instead
of going through this addiotional redirection.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-12-05 19:48:50 +01:00
Antony Pavlov a620f2b259 MIPS: fix out-of-tree build
The commit

  commit d25d94bea6
  Author: Antony Pavlov <antonynpavlov@gmail.com>
  Date:   Fri Jun 1 13:23:20 2012 +0400

      MIPS: make possible board-specific header files

      This patch makes possible to put a board-specific
      header file (e. g. foobar.h) to arch/mips/boards/*/include/board/.

breaks the out-of-tree build for the boards that use it (rzx50).

Reported-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Cc: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-12-03 09:38:26 +01:00
Antony Pavlov e26d312039 MIPS: main_entry.c: fix typo
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-11-19 10:16:50 +01:00
Sascha Hauer 141d32f00f mips: remove unused variable
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-10-17 22:17:44 +02:00
Sascha Hauer edf068e9cf Merge branch 'for-next/tftp' 2012-10-03 21:17:39 +02:00
Sascha Hauer b51a11be84 defconfig: Switch all defconfig to new tftp command
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-09-28 16:23:55 +02:00
Sascha Hauer 77322aa896 Treewide: remove address of the Free Software Foundation
The FSF address has changed in the past. Instead of updating it
each time the address changes, just drop it completely treewide.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-09-17 10:57:41 +02:00
Sascha Hauer edd582ee63 mips: remove undefined local_irq_save/local_irq_restore
mips currently uses local_irq_save and local_irq_restore
which are not defined. Drop them.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Cc: Antony Pavlov <antonynpavlov@gmail.com>
2012-09-16 09:47:46 +02:00
Sascha Hauer bed1a6ffab Merge branch 'for-next/pbl' 2012-09-05 12:59:29 +02:00
Sascha Hauer b615445564 Makefile: generate a barebox-flash-image link
Depending on the SoC a barebox.bin, barebox.netx, barebox.s5p, MLO image
is generated. With pbl support there now is an additional
arch/arm/pbl/zbarebox.bin image.

To help the user to determine which image should be flashed to his device,
generate a barebox-flash-image link.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Acked-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2012-08-12 16:16:44 +02:00
Jean-Christophe PLAGNIOL-VILLARD a231dcdf78 devices: fix missing conversion to DEVICE_ID_DYNAMIC
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-08-12 14:48:28 +02:00
Antony Pavlov bd6cc52de5 MIPS: add initial exceptions handling
Checking exception handling:

    $ make qemu-malta_defconfig
    $ make

    ...

    $ qemu-system-mips -nodefaults -M malta -m 256 \
       -nographic -serial stdio -bios ./barebox.bin

    ...

    barebox:/ md -l 0x03

    Ooops, address error on load or ifetch!
    EPC = 0xa082783c
    CP0_STATUS = 0x00000006
    CP0_CAUSE = 0x00000410
    CP0_CONFIG = 0x80008482

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

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-07-27 09:54:13 +02:00
Antony Pavlov bdf8405e34 MIPS: remove unused processor-specific constants and macros
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-07-09 09:23:35 +02:00
Antony Pavlov b35fb39d32 MIPS: malta: register memory bank
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-07-09 09:23:35 +02:00
Sascha Hauer 4f5862d884 Merge branch 'for-next/poweroff' 2012-07-02 11:04:44 +02:00
Sascha Hauer 93d4ea2ac8 Merge branch 'for-next/mips-clocksource' 2012-07-02 11:04:38 +02:00
Sascha Hauer dd3c898d06 Merge branch 'for-next/dma-cache-align' 2012-07-02 10:59:22 +02:00
Antony Pavlov 41b05dc0da rzx50: add poweroff support
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-06-30 12:47:25 +02:00
Marc Kleine-Budde ed2180d658 blackfin, mips, openrisc, ppc, sandbox, x86: add generic dma_alloc, dma_free inlines
Some drivers call dma_inv_range() on buffers, on arm these buffers must
be cache line aligned. This patch introduces a generic dma_alloc,
dma_free. Archs can implement in their own functions in "asm/dma.h" and add a:

	#define dma_alloc dma_alloc
	#define dma_free dma_free

On all other archs the generic versions, which translate into xmalloc
and free are used.

Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-06-30 12:46:25 +02:00
Antony Pavlov c325d97cfd MIPS: XBurst: use clocks_calc_mult_shift() for JZ4755's clocksource
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-06-29 10:20:00 +02:00
Antony Pavlov dbf8340727 MIPS: XBurst: fix the JZ4755's clocksource input frequency value
The 40 KHz frequency value was used to parry
__lshrdi3() error on little-endian MIPS because
the __lshrdi3() function is used in clocksource code.

The true value of the JZ4755's external clock frequency is 24 MHz.

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-06-29 10:20:00 +02:00
Sascha Hauer 21895e19f8 mips: Add missing ffs and fls include
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-06-28 13:49:16 +02:00