MIPS: initial commit: add empty but required header files
Subsystems (5)
PATCH v8 1/12 MIPS: initial commit: add empty but required header files
--- arch/mips/include/asm/barebox.h | 24 ++++++++++++++++++++++++ arch/mips/include/asm/bitops.h | 32 ++++++++++++++++++++++++++++++++ arch/mips/include/asm/common.h | 29 +++++++++++++++++++++++++++++ arch/mips/include/asm/module.h | 24 ++++++++++++++++++++++++ arch/mips/include/asm/string.h | 31 +++++++++++++++++++++++++++++++ 5 files changed, 140 insertions(+), 0 deletions(-) create mode 100644 arch/mips/include/asm/barebox.h create mode 100644 arch/mips/include/asm/bitops.h create mode 100644 arch/mips/include/asm/common.h create mode 100644 arch/mips/include/asm/module.h create mode 100644 arch/mips/include/asm/string.h
arch/mips/include/asm/barebox.h new file +24 -0
@@ -0,0 +1,24 @@ +/* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License as +* published by the Free Software Foundation; either version 2 of +* the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 59 Temple Place, Suite 330, Boston, +* MA 02111-1307 USA +* +*/ + +#ifndef _ASM_MIPS_BAREBOX_H_ +#define _ASM_MIPS_BAREBOX_H_ + +/* nothing special yet */ + +#endif /* _ASM_MIPS_BAREBOX_H_ */
arch/mips/include/asm/bitops.h new file +32 -0
@@ -0,0 +1,32 @@ +/* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License as +* published by the Free Software Foundation; either version 2 of +* the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 59 Temple Place, Suite 330, Boston, +* MA 02111-1307 USA +* +*/ + +/** +* @file +* @brief mips bit operations +* +* This file is required only to make all sources happy including +* 'linux/bitops.h' +*/ + +#ifndef _ASM_MIPS_BITOPS_H_ +#define _ASM_MIPS_BITOPS_H_ + +/* nothing special yet */ + +#endif /* _ASM_MIPS_BITOPS_H_ */
arch/mips/include/asm/common.h new file +29 -0
@@ -0,0 +1,29 @@ +/* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License as +* published by the Free Software Foundation; either version 2 of +* the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 59 Temple Place, Suite 330, Boston, +* MA 02111-1307 USA +* +*/ + +/** +* @file +* @brief mips common declarations +*/ + +#ifndef _ASM_MIPS_COMMON_H_ +#define _ASM_MIPS_COMMON_H_ + +/* nothing special yet */ + +#endif /* _ASM_MIPS_COMMON_H_ */
arch/mips/include/asm/module.h new file +24 -0
@@ -0,0 +1,24 @@ +/* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License as +* published by the Free Software Foundation; either version 2 of +* the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 59 Temple Place, Suite 330, Boston, +* MA 02111-1307 USA +* +*/ + +#ifndef _ASM_MIPS_MODULE_H_ +#define _ASM_MIPS_MODULE_H_ + +/* nothing special yet */ + +#endif /* _ASM_MIPS_MODULE_H_ */
arch/mips/include/asm/string.h new file +31 -0
@@ -0,0 +1,31 @@ +/* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License as +* published by the Free Software Foundation; either version 2 of +* the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 59 Temple Place, Suite 330, Boston, +* MA 02111-1307 USA +* +*/ + +/** +* @file +* @brief mips specific string optimizations +* +* Thanks to the Linux kernel here we can add many micro optimized string +* functions. But currently it makes no sense, to do so. +*/ +#ifndef __ASM_MIPS_STRING_H +#define __ASM_MIPS_STRING_H + +/* nothing special yet */ + +#endif
Signature · 7 lines
1.7.5.4 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
PATCH v8 4/12 MIPS: add start.S, CP0 clocksource, linker script and memory layout function
Also add support macro for serial_ns16550.
--- arch/mips/Kconfig | 184 ++++++++++++++++++++++++++++++++++++++++ arch/mips/Makefile | 73 ++++++++++++++++ arch/mips/boot/Makefile | 1 + arch/mips/boot/start.S | 143 +++++++++++++++++++++++++++++++ arch/mips/include/asm/common.h | 13 +++- arch/mips/lib/.gitignore | 1 + arch/mips/lib/Makefile | 6 ++ arch/mips/lib/barebox.lds.S | 76 ++++++++++++++++ arch/mips/lib/csrc-r4k.c | 48 +++++++++++ arch/mips/lib/memory.c | 32 +++++++ 10 files changed, 576 insertions(+), 1 deletions(-) create mode 100644 arch/mips/Kconfig create mode 100644 arch/mips/Makefile create mode 100644 arch/mips/boot/Makefile create mode 100644 arch/mips/boot/start.S create mode 100644 arch/mips/lib/.gitignore create mode 100644 arch/mips/lib/Makefile create mode 100644 arch/mips/lib/barebox.lds.S create mode 100644 arch/mips/lib/csrc-r4k.c create mode 100644 arch/mips/lib/memory.c
arch/mips/Kconfig new file +184 -0
@@ -0,0 +1,184 @@ +# +# +# +config MIPS + bool + select HAS_KALLSYMS + select HAVE_CONFIGURABLE_MEMORY_LAYOUT + select HAVE_CONFIGURABLE_TEXT_BASE + default y + +config SYS_SUPPORTS_BIG_ENDIAN + bool + +config SYS_SUPPORTS_LITTLE_ENDIAN + bool + +config CSRC_R4K_LIB + bool + +config GENERIC_LINKER_SCRIPT + bool + default y + +# +# Endianess selection. Sufficiently obscure so many users don't know what to +# answer,so we try hard to limit the available choices. Also the use of a +# choice statement should be more obvious to the user. +# +choice + prompt "Endianess selection" + help + Some MIPS machines can be configured for either little or big endian + byte order. These modes require different barebox images. + In general there is one preferred byteorder for a + particular system but some systems are just as commonly used in the + one or the other endianness. + +config CPU_BIG_ENDIAN + bool "Big endian" + depends on SYS_SUPPORTS_BIG_ENDIAN + +config CPU_LITTLE_ENDIAN + bool "Little endian" + depends on SYS_SUPPORTS_LITTLE_ENDIAN + help + +endchoice + +menu "CPU selection" + +choice + prompt "CPU type" + default CPU_MIPS32_R2 + +config CPU_MIPS32_R1 + bool "MIPS32 Release 1" + depends on SYS_HAS_CPU_MIPS32_R1 + select CPU_SUPPORTS_32BIT_KERNEL + help + Choose this option to build a barebox for release 1 or later of the + MIPS32 architecture. Most modern embedded systems with a 32-bit + MIPS processor are based on a MIPS32 processor. If you know the + specific type of processor in your system, choose those that one + otherwise CPU_MIPS32_R1 is a safe bet for any MIPS32 system. + Release 2 of the MIPS32 architecture is available since several + years so chances are you even have a MIPS32 Release 2 processor + in which case you should choose CPU_MIPS32_R2 instead for better + performance. + +config CPU_MIPS32_R2 + bool "MIPS32 Release 2" + depends on SYS_HAS_CPU_MIPS32_R2 + select CPU_SUPPORTS_32BIT_KERNEL + help + Choose this option to build a barebox for release 2 or later of the + MIPS32 architecture. Most modern embedded systems with a 32-bit + MIPS processor are based on a MIPS32 processor. If you know the + specific type of processor in your system, choose those that one + otherwise CPU_MIPS32_R1 is a safe bet for any MIPS32 system. + +config CPU_MIPS64_R1 + bool "MIPS64 Release 1" + depends on SYS_HAS_CPU_MIPS64_R1 + select CPU_SUPPORTS_32BIT_KERNEL + select CPU_SUPPORTS_64BIT_KERNEL + help + Choose this option to build a barebox for release 1 or later of the + MIPS64 architecture. Many modern embedded systems with a 64-bit + MIPS processor are based on a MIPS64 processor. If you know the + specific type of processor in your system, choose those that one + otherwise CPU_MIPS64_R1 is a safe bet for any MIPS64 system. + Release 2 of the MIPS64 architecture is available since several + years so chances are you even have a MIPS64 Release 2 processor + in which case you should choose CPU_MIPS64_R2 instead for better + performance. + +config CPU_MIPS64_R2 + bool "MIPS64 Release 2" + depends on SYS_HAS_CPU_MIPS64_R2 + select CPU_SUPPORTS_32BIT_KERNEL + select CPU_SUPPORTS_64BIT_KERNEL + help + Choose this option to build a barebox for release 2 or later of the + MIPS64 architecture. Many modern embedded systems with a 64-bit + MIPS processor are based on a MIPS64 processor. If you know the + specific type of processor in your system, choose those that one + otherwise CPU_MIPS64_R1 is a safe bet for any MIPS64 system. + +endchoice + + +config SYS_HAS_CPU_MIPS32_R1 + bool + +config SYS_HAS_CPU_MIPS32_R2 + bool + +config SYS_HAS_CPU_MIPS64_R1 + bool + +config SYS_HAS_CPU_MIPS64_R2 + bool + +# +# These two indicate any level of the MIPS32 and MIPS64 architecture +# +config CPU_MIPS32 + bool + default y if CPU_MIPS32_R1 || CPU_MIPS32_R2 + +config CPU_MIPS64 + bool + default y if CPU_MIPS64_R1 || CPU_MIPS64_R2 + +# +# These two indicate the revision of the architecture, either Release 1 or Release 2 +# +config CPU_MIPSR1 + bool + default y if CPU_MIPS32_R1 || CPU_MIPS64_R1 + +config CPU_MIPSR2 + bool + default y if CPU_MIPS32_R2 || CPU_MIPS64_R2 + +config SYS_SUPPORTS_32BIT_KERNEL + bool +config SYS_SUPPORTS_64BIT_KERNEL + bool +config CPU_SUPPORTS_32BIT_KERNEL + bool +config CPU_SUPPORTS_64BIT_KERNEL + bool + +endmenu + +choice + prompt "Barebox code model" + help + You should only select this option if you have a workload that + actually benefits from 64-bit processing or if your machine has + large memory. You will only be presented a single option in this + menu if your system does not support both 32-bit and 64-bit modes. + +config 32BIT + bool "32-bit barebox" + depends on CPU_SUPPORTS_32BIT_KERNEL && SYS_SUPPORTS_32BIT_KERNEL + help + Select this option if you want to build a 32-bit barebox. + +config 64BIT + bool "64-bit barebox" + depends on CPU_SUPPORTS_64BIT_KERNEL && SYS_SUPPORTS_64BIT_KERNEL + help + Select this option if you want to build a 64-bit barebox. + +endchoice + +source common/Kconfig +source commands/Kconfig +source net/Kconfig +source drivers/Kconfig +source fs/Kconfig +source lib/Kconfig
arch/mips/Makefile new file +73 -0
73 lines not on this page · raw message
arch/mips/boot/Makefile new file +1 -0
@@ -0,0 +1 @@ +obj-y += start.o
arch/mips/boot/start.S new file +143 -0
143 lines not on this page · raw message
arch/mips/include/asm/common.h +12 -1
@@ -24,6 +24,17 @@#ifndef _ASM_MIPS_COMMON_H_#define _ASM_MIPS_COMMON_H_ -/* nothing special yet */ +#define NS16550_READ_WRITE_UART_FUNC (pfx, shift, offset) \ +static unsigned int pfx ##_uart_read(unsigned long base, \ + unsigned char reg_idx) \ +{ \ + return __raw_readb((char *)base + (reg_idx << shift) + offset); \ +} \ + \ +static void pfx ##_uart_write(unsigned int val, unsigned long base, \ + unsigned char reg_idx) \ +{ \ + __raw_writeb(val, (char *)base + (reg_idx << shift) + offset); \ +} \#endif /* _ASM_MIPS_COMMON_H_ */
arch/mips/lib/.gitignore new file +1 -0
@@ -0,0 +1 @@ +barebox.lds
arch/mips/lib/Makefile new file +6 -0
@@ -0,0 +1,6 @@ +extra-$(CONFIG_GENERIC_LINKER_SCRIPT) += barebox.lds +obj-$(CONFIG_CSRC_R4K_LIB) += csrc-r4k.o +obj-y += lshrdi3.o +obj-y += ashldi3.o +obj-y += ashrdi3.o +obj-y += memory.o
arch/mips/lib/barebox.lds.S new file +76 -0
76 lines not on this page · raw message
arch/mips/lib/csrc-r4k.c new file +48 -0
48 lines not on this page · raw message
arch/mips/lib/memory.c new file +32 -0
@@ -0,0 +1,32 @@ +/* +* Copyright (C) 2011 Antony Pavlov <[email protected]> +* +* This file is part of barebox. +* See file CREDITS for list of people who contributed to this project. +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License version 2 +* as published by the Free Software Foundation. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include <common.h> +#include <init.h> +#include <mem_malloc.h> +#include <asm-generic/memory_layout.h> + +static int mips_mem_malloc_init (void ) +{ +mem_malloc_init ((void *)MALLOC_BASE , + (void *)(MALLOC_BASE +MALLOC_SIZE )); +return 0 ; +} +core_initcall (mips_mem_malloc_init);
Signature · 7 lines
1.7.5.4 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
PATCH v8 2/12 MIPS: import libgcc-related files from linux-2.6.39
In reply to Antony Pavlov--- arch/mips/lib/ashldi3.c | 28 ++++++++++++++++++++++++++++ arch/mips/lib/ashrdi3.c | 30 ++++++++++++++++++++++++++++++ arch/mips/lib/libgcc.h | 25 +++++++++++++++++++++++++ arch/mips/lib/lshrdi3.c | 28 ++++++++++++++++++++++++++++ 4 files changed, 111 insertions(+), 0 deletions(-) create mode 100644 arch/mips/lib/ashldi3.c create mode 100644 arch/mips/lib/ashrdi3.c create mode 100644 arch/mips/lib/libgcc.h create mode 100644 arch/mips/lib/lshrdi3.c
arch/mips/lib/ashldi3.c new file +28 -0
@@ -0,0 +1,28 @@ +#include <module.h> + +#include "libgcc.h" + +long long __ashldi3 (long long u,word_type b) +{ +DWunion uu, w; +word_type bm; + +if (b ==0 ) +return u; + + uu.ll = u; + bm =32 - b; + +if (bm <=0 ) { + w.s.low =0 ; + w.s.high = (unsigned int ) uu.s.low << -bm; + }else { +const unsigned int carries = (unsigned int ) uu.s.low >> bm; + + w.s.low = (unsigned int ) uu.s.low << b; + w.s.high = ((unsigned int ) uu.s.high << b) | carries; + } + +return w.ll; +} +EXPORT_SYMBOL (__ashldi3);
arch/mips/lib/ashrdi3.c new file +30 -0
@@ -0,0 +1,30 @@ +#include <module.h> + +#include "libgcc.h" + +long long __ashrdi3 (long long u,word_type b) +{ +DWunion uu, w; +word_type bm; + +if (b ==0 ) +return u; + + uu.ll = u; + bm =32 - b; + +if (bm <=0 ) { +/* w.s.high = 1..1 or 0..0 */ + w.s.high = + uu.s.high >>31 ; + w.s.low = uu.s.high >> -bm; + }else { +const unsigned int carries = (unsigned int ) uu.s.high << bm; + + w.s.high = uu.s.high >> b; + w.s.low = ((unsigned int ) uu.s.low >> b) | carries; + } + +return w.ll; +} +EXPORT_SYMBOL (__ashrdi3);
arch/mips/lib/libgcc.h new file +25 -0
@@ -0,0 +1,25 @@ +#ifndef __ASM_LIBGCC_H +#define __ASM_LIBGCC_H + +#include <asm/byteorder.h> + +typedef int word_type __attribute__ ((mode (__word__))); + +#ifdef __BIG_ENDIAN +struct DWstruct { +int high, low; +}; +#elif defined(__LITTLE_ENDIAN) +struct DWstruct { +int low, high; +}; +#else +#error I feel sick. +#endif + +typedef union { +struct DWstruct s; +long long ll; +}DWunion ; + +#endif /* __ASM_LIBGCC_H */
arch/mips/lib/lshrdi3.c new file +28 -0
@@ -0,0 +1,28 @@ +#include <module.h> + +#include "libgcc.h" + +long long __lshrdi3 (long long u,word_type b) +{ +DWunion uu, w; +word_type bm; + +if (b ==0 ) +return u; + + uu.ll = u; + bm =32 - b; + +if (bm <=0 ) { + w.s.high =0 ; + w.s.low = (unsigned int ) uu.s.high >> -bm; + }else { +const unsigned int carries = (unsigned int ) uu.s.high << bm; + + w.s.high = (unsigned int ) uu.s.high >> b; + w.s.low = ((unsigned int ) uu.s.low >> b) | carries; + } + +return w.ll; +} +EXPORT_SYMBOL (__lshrdi3);
Signature · 7 lines
1.7.5.4 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
PATCH v8 5/12 MIPS: add documentation
In reply to Antony Pavlov--- arch/architecture.dox | 1 + arch/mips/mach-mips.dox | 54 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 55 insertions(+), 0 deletions(-) create mode 100644 arch/mips/mach-mips.dox
arch/architecture.dox +1 -0
@@ -86,6 +86,7 @@ TODO @li @subpage dev_arm_mach @li @subpage dev_bf_mach +@li @subpage dev_mips_mach @li @subpage dev_ppc_mach @li @subpage dev_x86_mach
arch/mips/mach-mips.dox new file +54 -0
54 lines not on this page · raw message
Signature · 7 lines
1.7.5.4 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
PATCH v8 7/12 MIPS: add qemu malta board support to barebox
In reply to Antony PavlovThe only supported peripheral is ns16550 serial port.
--- arch/mips/Makefile | 1 + arch/mips/boards/qemu-malta/Kconfig | 6 +++ arch/mips/boards/qemu-malta/Makefile | 1 + arch/mips/boards/qemu-malta/config.h | 19 ++++++++++ arch/mips/boards/qemu-malta/serial.c | 61 ++++++++++++++++++++++++++++++++ arch/mips/configs/qemu-malta_defconfig | 45 +++++++++++++++++++++++ arch/mips/mach-malta/Kconfig | 5 +++ 7 files changed, 138 insertions(+), 0 deletions(-) create mode 100644 arch/mips/boards/qemu-malta/Kconfig create mode 100644 arch/mips/boards/qemu-malta/Makefile create mode 100644 arch/mips/boards/qemu-malta/config.h create mode 100644 arch/mips/boards/qemu-malta/serial.c create mode 100644 arch/mips/configs/qemu-malta_defconfig
arch/mips/Makefile +1 -0
@@ -35,6 +35,7 @@ endif LDFLAGS_barebox += -nostdlib machine-$(CONFIG_MACH_MIPS_MALTA) := malta +board-$(CONFIG_BOARD_QEMU_MALTA) := qemu-malta machdirs := $(patsubst %,arch/mips/mach-%/,$(machine-y))
arch/mips/boards/qemu-malta/Kconfig new file +6 -0
@@ -0,0 +1,6 @@ +if BOARD_QEMU_MALTA + +config BOARDINFO + default "qemu malta" + +endif
arch/mips/boards/qemu-malta/Makefile new file +1 -0
@@ -0,0 +1 @@ +obj-$(CONFIG_DRIVER_SERIAL_NS16550) += serial.o
arch/mips/boards/qemu-malta/config.h new file +19 -0
@@ -0,0 +1,19 @@ +/* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License as +* published by the Free Software Foundation; either version 2 of +* the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 59 Temple Place, Suite 330, Boston, +* MA 02111-1307 USA +* +*/ + +/* nothing special yet */
arch/mips/boards/qemu-malta/serial.c new file +61 -0
61 lines not on this page · raw message
arch/mips/configs/qemu-malta_defconfig new file +45 -0
45 lines not on this page · raw message
arch/mips/mach-malta/Kconfig +5 -0
@@ -7,6 +7,11 @@ config ARCH_TEXT_BASE choice prompt "Board type" +config BOARD_QEMU_MALTA + bool "qemu malta" + endchoice +source arch/mips/boards/qemu-malta/Kconfig + endif
Signature · 7 lines
1.7.5.4 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
PATCH v8 6/12 MIPS: add Malta machine support to barebox
In reply to Antony PavlovThe machine uses only big-endian mode.
Only supported peripheral is serial port.
The machine supports only MIPS32 CPUs.
--- arch/mips/Kconfig | 22 ++++++++++++++ arch/mips/Makefile | 2 + arch/mips/mach-malta/Kconfig | 12 ++++++++ arch/mips/mach-malta/Makefile | 1 + arch/mips/mach-malta/include/mach/debug_ll.h | 40 ++++++++++++++++++++++++++ arch/mips/mach-malta/include/mach/hardware.h | 32 ++++++++++++++++++++ arch/mips/mach-malta/reset.c | 36 +++++++++++++++++++++++ 7 files changed, 145 insertions(+), 0 deletions(-) create mode 100644 arch/mips/mach-malta/Kconfig create mode 100644 arch/mips/mach-malta/Makefile create mode 100644 arch/mips/mach-malta/include/mach/debug_ll.h create mode 100644 arch/mips/mach-malta/include/mach/hardware.h create mode 100644 arch/mips/mach-malta/reset.c
arch/mips/Kconfig +22 -0
@@ -21,6 +21,28 @@ config GENERIC_LINKER_SCRIPT bool default y +menu "Machine selection" + +choice + prompt "System type" + default MACH_MIPS_MALTA + +config MACH_MIPS_MALTA + bool "MIPS Malta" + select CSRC_R4K_LIB + select DRIVER_SERIAL_NS16550 + select SYS_HAS_CPU_MIPS32_R1 + select SYS_HAS_CPU_MIPS32_R2 + select SYS_SUPPORTS_32BIT_KERNEL + select SYS_SUPPORTS_BIG_ENDIAN + select HAS_DEBUG_LL + +endchoice + +source arch/mips/mach-malta/Kconfig + +endmenu + # # Endianess selection. Sufficiently obscure so many users don't know what to # answer,so we try hard to limit the available choices. Also the use of a
arch/mips/Makefile +2 -0
@@ -34,6 +34,8 @@ endif LDFLAGS_barebox += -nostdlib +machine-$(CONFIG_MACH_MIPS_MALTA) := malta + machdirs := $(patsubst %,arch/mips/mach-%/,$(machine-y)) ifeq ($(KBUILD_SRC),)
arch/mips/mach-malta/Kconfig new file +12 -0
@@ -0,0 +1,12 @@ +if MACH_MIPS_MALTA + +config ARCH_TEXT_BASE + hex + default 0xa0800000 + +choice + prompt "Board type" + +endchoice + +endif
arch/mips/mach-malta/Makefile new file +1 -0
@@ -0,0 +1 @@ +obj-y += reset.o
arch/mips/mach-malta/include/mach/debug_ll.h new file +40 -0
@@ -0,0 +1,40 @@ +/* +* Copyright (C) 2011 Antony Pavlov <[email protected]> +* +* This file is part of barebox. +* See file CREDITS for list of people who contributed to this project. +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License version 2 +* as published by the Free Software Foundation. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +/** @file +* This File contains declaration for early output support +*/ +#ifndef __INCLUDE_ARCH_DEBUG_LL_H__ +#define __INCLUDE_ARCH_DEBUG_LL_H__ + +#include <asm/io.h> +#include <mach/hardware.h> + +#define rbr 0 +#define lsr 5 +#define LSR_THRE 0x20/* Xmit holding register empty */ + +static __inline__void putc (char ch) +{ +while (!(__raw_readb (DEBUG_LL_UART_ADDR + lsr) &LSR_THRE )); +__raw_writeb (ch,DEBUG_LL_UART_ADDR + rbr); +} + +#endif /* __INCLUDE_ARCH_DEBUG_LL_H__ */
arch/mips/mach-malta/include/mach/hardware.h new file +32 -0
@@ -0,0 +1,32 @@ +/* +* Copyright (C) 2011 Antony Pavlov <[email protected]> +* +* This file is part of barebox. +* See file CREDITS for list of people who contributed to this project. +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License version 2 +* as published by the Free Software Foundation. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#ifndef __INCLUDE_ARCH_HARDWARE_H__ +#define __INCLUDE_ARCH_HARDWARE_H__ + +#define DEBUG_LL_UART_ADDR 0xb00003f8 + +/* +* Reset register. +*/ +#define SOFTRES_REG 0xbf000500 +#define GORESET 0x42 + +#endif /* __INCLUDE_ARCH_HARDWARE_H__ */
arch/mips/mach-malta/reset.c new file +36 -0
@@ -0,0 +1,36 @@ +/* +* Copyright (C) 2011 Antony Pavlov <[email protected]> +* +* This file is part of barebox. +* See file CREDITS for list of people who contributed to this project. +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License version 2 +* as published by the Free Software Foundation. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +/** +* @file +* @brief Resetting an malta board +*/ + +#include <common.h> +#include <asm/io.h> +#include <mach/hardware.h> + +void __noreturn reset_cpu (ulong addr) +{ +__raw_writel (GORESET , (char *)SOFTRES_REG ); +while (1 ); +/*NOTREACHED*/ +} +EXPORT_SYMBOL (reset_cpu);
Signature · 7 lines
1.7.5.4 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
PATCH v8 8/12 MIPS: add qemu-malta documentation
In reply to Antony Pavlov--- Documentation/boards.dox | 5 +++++ arch/mips/boards/qemu-malta/qemu-malta.dox | 15 +++++++++++++++ arch/mips/mach-malta/mach-malta.dox | 7 +++++++ arch/mips/mach-mips.dox | 3 +++ 4 files changed, 30 insertions(+), 0 deletions(-) create mode 100644 arch/mips/boards/qemu-malta/qemu-malta.dox create mode 100644 arch/mips/mach-malta/mach-malta.dox
Documentation/boards.dox +5 -0
@@ -44,6 +44,11 @@ x86 type: @li @subpage generic_pc + +MIPS type: + +@li @subpage qemu_malta + */ /* TODO
arch/mips/boards/qemu-malta/qemu-malta.dox new file +15 -0
@@ -0,0 +1,15 @@ +/** @page qemu_malta QEmu malta emulated board + +Specific to this emulated board is, it does not require any setup code to bring the SDRAM and RS232 up. + +Emulator run string: +@verbatim +qemu-system-mips -nodefaults -M malta -m 256 -nographic -serial stdio -monitor null -bios barebox.bin +@endverbatim + +Links: +@li http://www.mips.com/products/development-kits/malta/ +@li http://www.linux-mips.org/wiki/Mips_Malta +@li http://www.qemu.org/ + +*/
arch/mips/mach-malta/mach-malta.dox new file +7 -0
@@ -0,0 +1,7 @@ +/** @page dev_malta_mach MIPS Malta in barebox + +@section malta_boards MIPS Malta boards + +@li @subpage qemu_malta + +*/
arch/mips/mach-mips.dox +3 -0
@@ -51,4 +51,7 @@ Further reading: * Dominic Sweetman, See MIPS Run, Morgan Kaufmann, 2nd edition, 2006 ISBN-13: 978-0120884216 +@subsection mach_mips_malta_info Malta boards + +@li @subpage dev_malta_mach */
Signature · 7 lines
1.7.5.4 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
PATCH v8 9/12 MIPS: add initial BCM47xx-based boards support
In reply to Antony Pavlov--- arch/mips/Kconfig | 10 ++++++ arch/mips/Makefile | 2 + arch/mips/mach-bcm47xx/Kconfig | 12 +++++++ arch/mips/mach-bcm47xx/Makefile | 1 + arch/mips/mach-bcm47xx/include/mach/debug_ll.h | 40 ++++++++++++++++++++++++ arch/mips/mach-bcm47xx/include/mach/hardware.h | 32 +++++++++++++++++++ arch/mips/mach-bcm47xx/reset.c | 36 +++++++++++++++++++++ 7 files changed, 133 insertions(+), 0 deletions(-) create mode 100644 arch/mips/mach-bcm47xx/Kconfig create mode 100644 arch/mips/mach-bcm47xx/Makefile create mode 100644 arch/mips/mach-bcm47xx/include/mach/debug_ll.h create mode 100644 arch/mips/mach-bcm47xx/include/mach/hardware.h create mode 100644 arch/mips/mach-bcm47xx/reset.c
arch/mips/Kconfig +10 -0
@@ -37,9 +37,19 @@ config MACH_MIPS_MALTA select SYS_SUPPORTS_BIG_ENDIAN select HAS_DEBUG_LL +config MACH_MIPS_BCM47XX + bool "Broadcom BCM47xx-based boards" + select CSRC_R4K_LIB + select DRIVER_SERIAL_NS16550 + select SYS_HAS_CPU_MIPS32_R1 + select SYS_SUPPORTS_32BIT_KERNEL + select SYS_SUPPORTS_LITTLE_ENDIAN + select HAS_DEBUG_LL + endchoice source arch/mips/mach-malta/Kconfig +source arch/mips/mach-bcm47xx/Kconfig endmenu
arch/mips/Makefile +2 -0
@@ -37,6 +37,8 @@ LDFLAGS_barebox += -nostdlib machine-$(CONFIG_MACH_MIPS_MALTA) := malta board-$(CONFIG_BOARD_QEMU_MALTA) := qemu-malta +machine-$(CONFIG_MACH_MIPS_BCM47XX) := bcm47xx + machdirs := $(patsubst %,arch/mips/mach-%/,$(machine-y)) ifeq ($(KBUILD_SRC),)
arch/mips/mach-bcm47xx/Kconfig new file +12 -0
@@ -0,0 +1,12 @@ +if MACH_MIPS_BCM47XX + +config ARCH_TEXT_BASE + hex + default 0xa0800000 + +choice + prompt "Board type" + +endchoice + +endif
arch/mips/mach-bcm47xx/Makefile new file +1 -0
@@ -0,0 +1 @@ +obj-y += reset.o
arch/mips/mach-bcm47xx/include/mach/debug_ll.h new file +40 -0
@@ -0,0 +1,40 @@ +/* +* Copyright (C) 2011 Antony Pavlov <[email protected]> +* +* This file is part of barebox. +* See file CREDITS for list of people who contributed to this project. +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License version 2 +* as published by the Free Software Foundation. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +/** @file +* This File contains declaration for early output support +*/ +#ifndef __INCLUDE_ARCH_DEBUG_LL_H__ +#define __INCLUDE_ARCH_DEBUG_LL_H__ + +#include <asm/io.h> +#include <mach/hardware.h> + +#define rbr 0 +#define lsr 5 +#define LSR_THRE 0x20/* Xmit holding register empty */ + +static __inline__void putc (char ch) +{ +while (!(__raw_readb (DEBUG_LL_UART_ADDR + lsr) &LSR_THRE )); +__raw_writeb (ch,DEBUG_LL_UART_ADDR + rbr); +} + +#endif /* __INCLUDE_ARCH_DEBUG_LL_H__ */
arch/mips/mach-bcm47xx/include/mach/hardware.h new file +32 -0
@@ -0,0 +1,32 @@ +/* +* Copyright (C) 2011 Antony Pavlov <[email protected]> +* +* This file is part of barebox. +* See file CREDITS for list of people who contributed to this project. +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License version 2 +* as published by the Free Software Foundation. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#ifndef __INCLUDE_ARCH_HARDWARE_H__ +#define __INCLUDE_ARCH_HARDWARE_H__ + +#define DEBUG_LL_UART_ADDR 0xb8000300 + +/* +* Reset register. +*/ +#define SOFTRES_REG 0xbf000500 +#define GORESET 0x42 + +#endif /* __INCLUDE_ARCH_HARDWARE_H__ */
arch/mips/mach-bcm47xx/reset.c new file +36 -0
@@ -0,0 +1,36 @@ +/* +* Copyright (C) 2011 Antony Pavlov <[email protected]> +* +* This file is part of barebox. +* See file CREDITS for list of people who contributed to this project. +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License version 2 +* as published by the Free Software Foundation. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +/** +* @file +* @brief Resetting an malta board +*/ + +#include <common.h> +#include <asm/io.h> +#include <mach/hardware.h> + +void __noreturn reset_cpu (ulong addr) +{ +__raw_writel (GORESET , (char *)SOFTRES_REG ); +while (1 ); +/*NOTREACHED*/ +} +EXPORT_SYMBOL (reset_cpu);
Signature · 7 lines
1.7.5.4 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
PATCH v8 12/12 MIPS: add draft cpuinfo command
In reply to Antony Pavlov--- arch/mips/Kconfig | 11 +++++++++++ arch/mips/lib/Makefile | 2 ++ arch/mips/lib/cpuinfo.c | 38 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 51 insertions(+), 0 deletions(-) create mode 100644 arch/mips/lib/cpuinfo.c
arch/mips/Kconfig +11 -0
@@ -208,6 +208,17 @@ config 64BIT endchoice +menu "MIPS specific settings " + +config CMD_MIPS_CPUINFO + bool "cpuinfo command" + default y + help + Say yes here to get a cpuinfo command to show some + information about the cpu model. + +endmenu + source common/Kconfig source commands/Kconfig source net/Kconfig
arch/mips/lib/Makefile +2 -0
@@ -4,3 +4,5 @@ obj-y += lshrdi3.o obj-y += ashldi3.o obj-y += ashrdi3.o obj-y += memory.o + +obj-$(CONFIG_CMD_MIPS_CPUINFO) += cpuinfo.o
arch/mips/lib/cpuinfo.c new file +38 -0
@@ -0,0 +1,38 @@ +/* +* cpuinfo - show information about MIPS CPU +* +* Copyright (C) 2011 Antony Pavlov <[email protected]> +* +* This file is part of barebox. +* See file CREDITS for list of people who contributed to this project. +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License version 2 +* as published by the Free Software Foundation. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include <common.h> +#include <command.h> +#include <asm/mipsregs.h> + +static int do_cpuinfo (struct command *cmdtp,int argc,char *argv[]) +{ +printf ("CP0_PRID = 0x%08x\n" ,read_c0_prid ()); +printf ("CP0_CONFIG = 0x%08x\n" ,read_c0_config ()); + +return 0 ; +} + +BAREBOX_CMD_START (cpuinfo) + .cmd = do_cpuinfo, + .usage ="Show info about CPU" , +BAREBOX_CMD_END
Signature · 7 lines
1.7.5.4 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
PATCH v8 11/12 MIPS: add D-Link DIR-320 documentation
In reply to Antony Pavlov--- Documentation/boards.dox | 1 + arch/mips/boards/dlink-dir-320/dlink-dir-320.dox | 38 ++++++++++++++++++++++ arch/mips/mach-bcm47xx/mach-bcm47xx.dox | 7 ++++ arch/mips/mach-mips.dox | 4 ++ 4 files changed, 50 insertions(+), 0 deletions(-) create mode 100644 arch/mips/boards/dlink-dir-320/dlink-dir-320.dox create mode 100644 arch/mips/mach-bcm47xx/mach-bcm47xx.dox
Documentation/boards.dox +1 -0
@@ -47,6 +47,7 @@ x86 type: MIPS type: +@li @subpage dlink_dir_320 @li @subpage qemu_malta */
arch/mips/boards/dlink-dir-320/dlink-dir-320.dox new file +38 -0
@@ -0,0 +1,38 @@ +/** @page dlink_dir_320 D-Link DIR-320 wireless router + +The router has +@li BCM5354 SoC; +@li 32 MiB SDRAM; +@li 4 MiB NOR type Flash Memory; +@li RS232 serial interface (LV-TTL levels on board!); +@li 1xUSB interface; +@li 4 + 1 ethernet interfaces; +@li 802.11b/g (WiFi) interface; +@li JTAG interface; +@li 5 LEDs; +@li 2 buttons. + +The router uses CFE as firmware. + +Barebox can be started from CFE using tftp. +You must setup tftp-server on host 192.168.0.1. +Put your barebox.bin to tftp-server directory +(usual /tftpboot or /srv/tftp). +Connect your DIR-320 to your tftp-server network via +one of four <LAN> sockets. + +Next, setup network on DIR-320 and run barebox.bin, e.g.: +@verbatim +CFE> ifconfig eth0 -addr=192.168.0.99 +CFE> boot -tftp -addr=a0800000 -raw 192.168.0.1:barebox.bin +@endverbatim + +DIR-320 links: +@li http://www.dlink.com.au/products/?pid=768 +@li http://wiki.openwrt.org/toh/d-link/dir-320 + +CFE links: +@li http://www.broadcom.com/support/communications_processors/downloads.php#cfe +@li http://www.linux-mips.org/wiki/CFE + +*/
arch/mips/mach-bcm47xx/mach-bcm47xx.dox new file +7 -0
@@ -0,0 +1,7 @@ +/** @page dev_bcm47xx_mach BCM47xx in barebox + +@section bcm47xx_boards BCM47xx-based boards + +@li @subpage dlink_dir_320 + +*/
arch/mips/mach-mips.dox +4 -0
@@ -54,4 +54,8 @@ ISBN-13: 978-0120884216 @subsection mach_mips_malta_info Malta boards @li @subpage dev_malta_mach + +@subsection mach_bcm47xx_info BCM47xx-based boards + +@li @subpage dev_bcm47xx_mach */
Signature · 7 lines
1.7.5.4 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
PATCH v8 10/12 MIPS: add initial D-Link DIR-320 wireless router support
In reply to Antony PavlovCan be started from CFE using tftp, e.g.:
CFE> ifconfig eth0 -addr=192.168.0.99
CFE> boot -tftp -addr=a0800000 -raw 192.168.0.1:barebox.bin
--- arch/mips/Makefile | 1 + arch/mips/boards/dlink-dir-320/Kconfig | 6 +++ arch/mips/boards/dlink-dir-320/Makefile | 1 + arch/mips/boards/dlink-dir-320/config.h | 19 +++++++++ arch/mips/boards/dlink-dir-320/serial.c | 61 +++++++++++++++++++++++++++++ arch/mips/configs/dlink-dir-320_defconfig | 46 ++++++++++++++++++++++ arch/mips/mach-bcm47xx/Kconfig | 5 ++ 7 files changed, 139 insertions(+), 0 deletions(-) create mode 100644 arch/mips/boards/dlink-dir-320/Kconfig create mode 100644 arch/mips/boards/dlink-dir-320/Makefile create mode 100644 arch/mips/boards/dlink-dir-320/config.h create mode 100644 arch/mips/boards/dlink-dir-320/serial.c create mode 100644 arch/mips/configs/dlink-dir-320_defconfig
arch/mips/Makefile +1 -0
@@ -38,6 +38,7 @@ machine-$(CONFIG_MACH_MIPS_MALTA) := malta board-$(CONFIG_BOARD_QEMU_MALTA) := qemu-malta machine-$(CONFIG_MACH_MIPS_BCM47XX) := bcm47xx +board-$(CONFIG_BOARD_DLINK_DIR320) := dlink-dir-320 machdirs := $(patsubst %,arch/mips/mach-%/,$(machine-y))
arch/mips/boards/dlink-dir-320/Kconfig new file +6 -0
@@ -0,0 +1,6 @@ +if BOARD_DLINK_DIR320 + +config BOARDINFO + default "D-Link DIR-320" + +endif
arch/mips/boards/dlink-dir-320/Makefile new file +1 -0
@@ -0,0 +1 @@ +obj-$(CONFIG_DRIVER_SERIAL_NS16550) += serial.o
arch/mips/boards/dlink-dir-320/config.h new file +19 -0
@@ -0,0 +1,19 @@ +/* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License as +* published by the Free Software Foundation; either version 2 of +* the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 59 Temple Place, Suite 330, Boston, +* MA 02111-1307 USA +* +*/ + +/* nothing special yet */
arch/mips/boards/dlink-dir-320/serial.c new file +61 -0
61 lines not on this page · raw message
arch/mips/configs/dlink-dir-320_defconfig new file +46 -0
46 lines not on this page · raw message
arch/mips/mach-bcm47xx/Kconfig +5 -0
@@ -7,6 +7,11 @@ config ARCH_TEXT_BASE choice prompt "Board type" +config BOARD_DLINK_DIR320 + bool "D-Link DIR-320" + endchoice +source arch/mips/boards/dlink-dir-320/Kconfig + endif
Signature · 7 lines
1.7.5.4 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
PATCH v8 3/12 MIPS: import header files
In reply to Antony Pavlovfrom linux-2.6.39:
* arch/mips/include/asm/*
* include/asm-generic/int-ll64.h
from barebox-2011.07.0 arch/x86:
* arch/mips/include/asm/sections.h
--- arch/mips/include/asm/asm.h | 409 +++++++++++++++ arch/mips/include/asm/bitsperlong.h | 8 + arch/mips/include/asm/byteorder.h | 19 + arch/mips/include/asm/elf.h | 52 ++ arch/mips/include/asm/io.h | 65 +++ arch/mips/include/asm/mipsregs.h | 948 +++++++++++++++++++++++++++++++++++ arch/mips/include/asm/posix_types.h | 144 ++++++ arch/mips/include/asm/regdef.h | 100 ++++ arch/mips/include/asm/sections.h | 1 + arch/mips/include/asm/sgidefs.h | 44 ++ arch/mips/include/asm/swab.h | 59 +++ arch/mips/include/asm/types.h | 49 ++ include/asm-generic/int-ll64.h | 78 +++ 13 files changed, 1976 insertions(+), 0 deletions(-) create mode 100644 arch/mips/include/asm/asm.h create mode 100644 arch/mips/include/asm/bitsperlong.h create mode 100644 arch/mips/include/asm/byteorder.h create mode 100644 arch/mips/include/asm/elf.h create mode 100644 arch/mips/include/asm/io.h create mode 100644 arch/mips/include/asm/mipsregs.h create mode 100644 arch/mips/include/asm/posix_types.h create mode 100644 arch/mips/include/asm/regdef.h create mode 100644 arch/mips/include/asm/sections.h create mode 100644 arch/mips/include/asm/sgidefs.h create mode 100644 arch/mips/include/asm/swab.h create mode 100644 arch/mips/include/asm/types.h create mode 100644 include/asm-generic/int-ll64.h
arch/mips/include/asm/asm.h new file +409 -0
@@ -0,0 +1,409 @@ +/* +* This file is subject to the terms and conditions of the GNU General Public +* License. See the file "COPYING" in the main directory of this archive +* for more details. +* +* Copyright (C) 1995, 1996, 1997, 1999, 2001 by Ralf Baechle +* Copyright (C) 1999 by Silicon Graphics, Inc. +* Copyright (C) 2001 MIPS Technologies, Inc. +* Copyright (C) 2002 Maciej W. Rozycki +* +* Some useful macros for MIPS assembler code +* +* Some of the routines below contain useless nops that will be optimized +* away by gas in -O mode. These nops are however required to fill delay +* slots in noreorder mode. +*/ +#ifndef __ASM_ASM_H +#define __ASM_ASM_H + +#include <asm/sgidefs.h> + +#ifndef CAT +#ifdef __STDC__ +#define __CAT (str1, str2) str1##str2 +#else +#define __CAT(str1, str2) str1/**/str2 +#endif +#define CAT (str1, str2) __CAT(str1, str2) +#endif + +/* +* PIC specific declarations +* Not used for the kernel but here seems to be the right place. +*/ +#ifdef __PIC__ +#define CPRESTORE (register) \ + .cprestore register +#define CPADD (register) \ + .cpadd register +#define CPLOAD (register) \ + .cpload register +#else +#define CPRESTORE (register) +#define CPADD (register) +#define CPLOAD (register) +#endif + +/* +* LEAF - declare leaf routine +*/ +#define LEAF (symbol) \ + .globl symbol; \ + .align 2; \ + .type symbol, @function; \ + .ent symbol, 0; \ +symbol: .frame sp, 0, ra + +/* +* NESTED - declare nested routine entry point +*/ +#define NESTED (symbol, framesize, rpc) \ + .globl symbol; \ + .align 2; \ + .type symbol, @function; \ + .ent symbol, 0; \ +symbol: .frame sp, framesize, rpc + +/* +* END - mark end of function +*/ +#define END (function) \ + .end function; \ + .size function, .-function + +/* +* EXPORT - export definition of symbol +*/ +#define EXPORT (symbol) \ + .globl symbol; \ +symbol: + +/* +* FEXPORT - export definition of a function symbol +*/ +#define FEXPORT (symbol) \ + .globl symbol; \ + .type symbol, @function; \ +symbol: + +/* +* ABS - export absolute symbol +*/ +#define ABS (symbol,value) \ + .globl symbol; \ +symbol = value + +#define PANIC (msg) \ + .set push; \ + .set reorder; \ + PTR_LA a0, 8f; \ + jal panic; \ +9: b 9b; \ + .set pop; \ + TEXT(msg) + +/* +* Print formatted string +*/ +#ifdef CONFIG_PRINTK +#define #else +#define #endif + +#define TEXT (msg) \ + .pushsection .data; \ +8: .asciiz msg; \ + .popsection; + +/* +* Build text tables +*/ +#define TTABLE (string) \ + .pushsection .text; \ + .word 1f; \ + .popsection \ + .pushsection .data; \ +1: .asciiz string; \ + .popsection + +/* +* MIPS IV pref instruction. +* Use with .set noreorder only! +* +* MIPS IV implementations are free to treat this as a nop. The R5000 +* is one of them. So we should have an option not to use this instruction. +*/ +#ifdef CONFIG_CPU_HAS_PREFETCH + +#define PREF (hint,addr) \ + .set push; \ + .set mips4; \ + pref hint, addr; \ + .set pop + +#define PREFX (hint,addr) \ + .set push; \ + .set mips4; \ + prefx hint, addr; \ + .set pop + +#else /* !CONFIG_CPU_HAS_PREFETCH */ + +#define PREF (hint, addr) +#define PREFX (hint, addr) + +#endif /* !CONFIG_CPU_HAS_PREFETCH */ + +/* +* MIPS ISA IV/V movn/movz instructions and equivalents for older CPUs. +*/ +#if (_MIPS_ISA == _MIPS_ISA_MIPS1) +#define MOVN (rd, rs, rt) \ + .set push; \ + .set reorder; \ + beqz rt, 9f; \ + move rd, rs; \ + .set pop; \ +9: +#define MOVZ (rd, rs, rt) \ + .set push; \ + .set reorder; \ + bnez rt, 9f; \ + move rd, rs; \ + .set pop; \ +9: +#endif /* _MIPS_ISA == _MIPS_ISA_MIPS1 */ +#if (_MIPS_ISA == _MIPS_ISA_MIPS2) || (_MIPS_ISA == _MIPS_ISA_MIPS3) +#define MOVN (rd, rs, rt) \ + .set push; \ + .set noreorder; \ + bnezl rt, 9f; \ + move rd, rs; \ + .set pop; \ +9: +#define MOVZ (rd, rs, rt) \ + .set push; \ + .set noreorder; \ + beqzl rt, 9f; \ + move rd, rs; \ + .set pop; \ +9: +#endif /* (_MIPS_ISA == _MIPS_ISA_MIPS2) || (_MIPS_ISA == _MIPS_ISA_MIPS3) */ +#if (_MIPS_ISA == _MIPS_ISA_MIPS4 ) || (_MIPS_ISA == _MIPS_ISA_MIPS5) || \ + (_MIPS_ISA == _MIPS_ISA_MIPS32) || (_MIPS_ISA == _MIPS_ISA_MIPS64) +#define MOVN (rd, rs, rt) \ + movn rd, rs, rt +#define MOVZ (rd, rs, rt) \ + movz rd, rs, rt +#endif /* MIPS IV, MIPS V, MIPS32 or MIPS64 */ + +/* +* Stack alignment +*/ +#if (_MIPS_SIM == _MIPS_SIM_ABI32) +#define ALSZ 7 +#define ALMASK ~7 +#endif +#if (_MIPS_SIM == _MIPS_SIM_NABI32) || (_MIPS_SIM == _MIPS_SIM_ABI64) +#define ALSZ 15 +#define ALMASK ~15 +#endif + +/* +* Macros to handle different pointer/register sizes for 32/64-bit code +*/ + +/* +* Size of a register +*/ +#ifdef __mips64 +#define SZREG 8 +#else +#define SZREG 4 +#endif + +/* +* Use the following macros in assemblercode to load/store registers, +* pointers etc. +*/ +#if (_MIPS_SIM == _MIPS_SIM_ABI32) +#define REG_S sw +#define REG_L lw +#define REG_SUBU subu +#define REG_ADDU addu +#endif +#if (_MIPS_SIM == _MIPS_SIM_NABI32) || (_MIPS_SIM == _MIPS_SIM_ABI64) +#define REG_S sd +#define REG_L ld +#define REG_SUBU dsubu +#define REG_ADDU daddu +#endif + +/* +* How to add/sub/load/store/shift C int variables. +*/ +#if (_MIPS_SZINT ==32 ) +#define INT_ADD add +#define INT_ADDU addu +#define INT_ADDI addi +#define INT_ADDIU addiu +#define INT_SUB sub +#define INT_SUBU subu +#define INT_L lw +#define INT_S sw +#define INT_SLL sll +#define INT_SLLV sllv +#define INT_SRL srl +#define INT_SRLV srlv +#define INT_SRA sra +#define INT_SRAV srav +#endif + +#if (_MIPS_SZINT ==64 ) +#define INT_ADD dadd +#define INT_ADDU daddu +#define INT_ADDI daddi +#define INT_ADDIU daddiu +#define INT_SUB dsub +#define INT_SUBU dsubu +#define INT_L ld +#define INT_S sd +#define INT_SLL dsll +#define INT_SLLV dsllv +#define INT_SRL dsrl +#define INT_SRLV dsrlv +#define INT_SRA dsra +#define INT_SRAV dsrav +#endif + +/* +* How to add/sub/load/store/shift C long variables. +*/ +#if (_MIPS_SZLONG ==32 ) +#define LONG_ADD add +#define LONG_ADDU addu +#define LONG_ADDI addi +#define LONG_ADDIU addiu +#define LONG_SUB sub +#define LONG_SUBU subu +#define LONG_L lw +#define LONG_S sw +#define LONG_SLL sll +#define LONG_SLLV sllv +#define LONG_SRL srl +#define LONG_SRLV srlv +#define LONG_SRA sra +#define LONG_SRAV srav + +#define LONG .word +#define LONGSIZE 4 +#define LONGMASK 3 +#define LONGLOG 2 +#endif + +#if (_MIPS_SZLONG ==64 ) +#define LONG_ADD dadd +#define LONG_ADDU daddu +#define LONG_ADDI daddi +#define LONG_ADDIU daddiu +#define LONG_SUB dsub +#define LONG_SUBU dsubu +#define LONG_L ld +#define LONG_S sd +#define LONG_SLL dsll +#define LONG_SLLV dsllv +#define LONG_SRL dsrl +#define LONG_SRLV dsrlv +#define LONG_SRA dsra +#define LONG_SRAV dsrav + +#define LONG .dword +#define LONGSIZE 8 +#define LONGMASK 7 +#define LONGLOG 3 +#endif + +/* +* How to add/sub/load/store/shift pointers. +*/ +#if (_MIPS_SZPTR ==32 ) +#define PTR_ADD add +#define PTR_ADDU addu +#define PTR_ADDI addi +#define PTR_ADDIU addiu +#define PTR_SUB sub +#define PTR_SUBU subu +#define PTR_L lw +#define PTR_S sw +#define PTR_LA la +#define PTR_LI li +#define PTR_SLL sll +#define PTR_SLLV sllv +#define PTR_SRL srl +#define PTR_SRLV srlv +#define PTR_SRA sra +#define PTR_SRAV srav + +#define PTR_SCALESHIFT 2 + +#define PTR .word +#define PTRSIZE 4 +#define PTRLOG 2 +#endif + +#if (_MIPS_SZPTR ==64 ) +#define PTR_ADD dadd +#define PTR_ADDU daddu +#define PTR_ADDI daddi +#define PTR_ADDIU daddiu +#define PTR_SUB dsub +#define PTR_SUBU dsubu +#define PTR_L ld +#define PTR_S sd +#define PTR_LA dla +#define PTR_LI dli +#define PTR_SLL dsll +#define PTR_SLLV dsllv +#define PTR_SRL dsrl +#define PTR_SRLV dsrlv +#define PTR_SRA dsra +#define PTR_SRAV dsrav + +#define PTR_SCALESHIFT 3 + +#define PTR .dword +#define PTRSIZE 8 +#define PTRLOG 3 +#endif + +/* +* Some cp0 registers were extended to 64bit for MIPS III. +*/ +#if (_MIPS_SIM == _MIPS_SIM_ABI32) +#define MFC0 mfc0 +#define MTC0 mtc0 +#endif +#if (_MIPS_SIM == _MIPS_SIM_NABI32) || (_MIPS_SIM == _MIPS_SIM_ABI64) +#define MFC0 dmfc0 +#define MTC0 dmtc0 +#endif + +#define SSNOP sll zero, zero, 1 + +#ifdef CONFIG_SGI_IP28 +/* Inhibit speculative stores to volatile (e.g.DMA) or invalid addresses. */ +#include <asm/cacheops.h> +#define R10KCBARRIER (addr) cache Cache_Barrier, addr; +#else +#define R10KCBARRIER (addr) +#endif + +#endif /* __ASM_ASM_H */
arch/mips/include/asm/bitsperlong.h new file +8 -0
@@ -0,0 +1,8 @@ +#ifndef __ASM_MIPS_BITSPERLONG_H +#define __ASM_MIPS_BITSPERLONG_H + +#define __BITS_PER_LONG _MIPS_SZLONG + +#include <asm-generic/bitsperlong.h> + +#endif /* __ASM_MIPS_BITSPERLONG_H */
arch/mips/include/asm/byteorder.h new file +19 -0
@@ -0,0 +1,19 @@ +/* +* This file is subject to the terms and conditions of the GNU General Public +* License. See the file "COPYING" in the main directory of this archive +* for more details. +* +* Copyright (C) 1996, 99, 2003 by Ralf Baechle +*/ +#ifndef _ASM_BYTEORDER_H +#define _ASM_BYTEORDER_H + +#if defined(__MIPSEB__) +#include <linux/byteorder/big_endian.h> +#elif defined(__MIPSEL__) +#include <linux/byteorder/little_endian.h> +#else +# error "MIPS, but neither __MIPSEB__, nor __MIPSEL__???" +#endif + +#endif /* _ASM_BYTEORDER_H */
arch/mips/include/asm/elf.h new file +52 -0
52 lines not on this page · raw message
arch/mips/include/asm/io.h new file +65 -0
65 lines not on this page · raw message
arch/mips/include/asm/mipsregs.h new file +948 -0
948 lines not on this page · raw message
arch/mips/include/asm/posix_types.h new file +144 -0
144 lines not on this page · raw message
arch/mips/include/asm/regdef.h new file +100 -0
100 lines not on this page · raw message
arch/mips/include/asm/sections.h new file +1 -0
@@ -0,0 +1 @@ +#include <asm-generic/sections.h>
arch/mips/include/asm/sgidefs.h new file +44 -0
44 lines not on this page · raw message
arch/mips/include/asm/swab.h new file +59 -0
59 lines not on this page · raw message
arch/mips/include/asm/types.h new file +49 -0
49 lines not on this page · raw message
include/asm-generic/int-ll64.h new file +78 -0
78 lines not on this page · raw message
Signature · 7 lines
1.7.5.4 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox