MIPS: xburst: add initial JZ4770 SoC support
Subsystems (2)
cover MIPS: xburst: add initial JZ4770 SoC support
This patchseries adds initial JZ4770 SoC and Ainol Novo7 Paladin tablet support.
The patchseries can be found on github:
https://github.com/frantony/barebox/tree/20150411.jz4770
The most notable problems and todos:
* no PBL support; I have a PBL-enabled barebox version
for the tablet, so barebox can be used as only bootloader for tablet. But this version is based on some dirty hacks
e.g. it uses special pre-compiled X-Boot blob for bootstraping.
Nowadays barebox mips PBL is written in assembler
and I see no way to switch it to C. gcc-4.9.1 for mips has no __naked directive support, see this gcc output
$ cat > 1.c <<EOF;
int __attribute__((naked)) __attribute__((no_instrument_function)) main() {
}
EOF
$ /opt/mips-2014.11/bin/mips-linux-gnu-gcc -o 1.o 1.c 1.c:2:1: warning: 'naked' attribute directive ignored [-Wattributes]
{
^
So for moving X-Boot bootstrap C-code into barebox PBL we have to convert it from C to assembler language :(
Please see JZ4770 bootstrap code in these repos:
https://github.com/gcwnow/UBIBoot/
https://github.com/IngenicSemiconductor/X-BOOT_NPM801
* no clk support just now; we can easely steal it from linux
JZ4780 support code (see wip-ci20-v4.1 branch in https://github.com/paulburton/linux);
* no hardware clocksource support; this can be easely fixed,
see linux JZ4780 support code again;
also see https://github.com/frantony/barebox/blob/next.xburst.jz4770.20130511/arch/mips/mach-xburst/csrc-jz4770.cAntony Pavlov (5):
MIPS: xburst: add JZ4770 SoC support
MIPS: xburst: debug_ll: add JZ4770 support
MIPS: xburst: add Ainol Novo7 Paladin support
MIPS: add ainol-novo7-paladin_defconfig
Documentation: add Ainol Novo7 Paladin board mini-howto
Documentation/boards/mips/ainol-novo7-paladin.rst | 45 +++++++++++ arch/mips/Makefile | 1 + arch/mips/boards/ainol-novo7-paladin/Makefile | 1 + arch/mips/boards/ainol-novo7-paladin/board.c | 27 +++++++ .../ainol-novo7-paladin/include/board/debug_ll.h | 23 ++++++ arch/mips/configs/ainol-novo7-paladin_defconfig | 42 ++++++++++ arch/mips/dts/ainol-novo7-paladin.dts | 34 ++++++++ arch/mips/dts/jz4770.dtsi | 90 ++++++++++++++++++++++ arch/mips/include/asm/cpu.h | 1 + arch/mips/lib/cpu-probe.c | 1 + arch/mips/mach-xburst/Kconfig | 18 ++++- .../mach-xburst/include/mach/debug_ll_jz4770.h | 47 +++++++++++ arch/mips/mach-xburst/include/mach/jz4770.h | 25 ++++++ 13 files changed, 351 insertions(+), 4 deletions(-) create mode 100644 Documentation/boards/mips/ainol-novo7-paladin.rst create mode 100644 arch/mips/boards/ainol-novo7-paladin/Makefile create mode 100644 arch/mips/boards/ainol-novo7-paladin/board.c create mode 100644 arch/mips/boards/ainol-novo7-paladin/include/board/debug_ll.h create mode 100644 arch/mips/configs/ainol-novo7-paladin_defconfig create mode 100644 arch/mips/dts/ainol-novo7-paladin.dts create mode 100644 arch/mips/dts/jz4770.dtsi create mode 100644 arch/mips/mach-xburst/include/mach/debug_ll_jz4770.h create mode 100644 arch/mips/mach-xburst/include/mach/jz4770.h
Signature · 7 lines
2.1.4 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
PATCH 1/5 MIPS: xburst: add JZ4770 SoC support
--- arch/mips/dts/jz4770.dtsi | 90 +++++++++++++++++++++++++++++++++++++++++++ arch/mips/include/asm/cpu.h | 1 + arch/mips/lib/cpu-probe.c | 1 + arch/mips/mach-xburst/Kconfig | 6 +++ 4 files changed, 98 insertions(+)
arch/mips/dts/jz4770.dtsi new file +90 -0
@@ -0,0 +1,90 @@ +#include "skeleton.dtsi" + +/ { + soc { + model = "Ingenic JZ4770"; + #address-cells = <1>; + #size-cells = <1>; + compatible = "simple-bus"; + ranges = <>; + + wdt: wdt@10002000 { + compatible = "ingenic,jz4740-wdt"; + reg = <0x10002000 0x10>; + }; + + uart0: serial@10030000 { + compatible = "ingenic,jz4740-uart"; + reg = <0x10030000 0x100>; + reg-shift = <2>; + clock-frequency = <12000000>; + status = "disabled"; + }; + + uart1: serial@10031000 { + compatible = "ingenic,jz4740-uart"; + reg = <0x10031000 0x100>; + reg-shift = <2>; + clock-frequency = <12000000>; + status = "disabled"; + }; + + uart2: serial@10032000 { + compatible = "ingenic,jz4740-uart"; + reg = <0x10032000 0x100>; + reg-shift = <2>; + clock-frequency = <12000000>; + status = "disabled"; + }; + + uart3: serial@10033000 { + compatible = "ingenic,jz4740-uart"; + reg = <0x10033000 0x100>; + reg-shift = <2>; + clock-frequency = <12000000>; + status = "disabled"; + }; + + gpio0: gpio@10010000 { + compatible = "ingenic,jz4740-gpio"; + gpio-controller; + reg = <0x10010000 0x100>; + #gpio-cells = <2>; + }; + + gpio1: gpio@10010100 { + compatible = "ingenic,jz4740-gpio"; + gpio-controller; + reg = <0x10010100 0x100>; + #gpio-cells = <2>; + }; + + gpio2: gpio@10010200 { + compatible = "ingenic,jz4740-gpio"; + gpio-controller; + reg = <0x10010200 0x100>; + #gpio-cells = <2>; + }; + + gpio3: gpio@10010300 { + compatible = "ingenic,jz4740-gpio"; + gpio-controller; + reg = <0x10010300 0x100>; + #gpio-cells = <2>; + }; + + gpio4: gpio@10010400 { + compatible = "ingenic,jz4740-gpio"; + gpio-controller; + reg = <0x10010400 0x100>; + #gpio-cells = <2>; + }; + + gpio5: gpio@10010500 { + compatible = "ingenic,jz4740-gpio"; + gpio-controller; + reg = <0x10010500 0x100>; + #gpio-cells = <2>; + }; + }; +};
arch/mips/include/asm/cpu.h +1 -0
@@ -27,6 +27,7 @@#define PRID_COMP_MIPS 0x010000#define PRID_COMP_BROADCOM 0x020000#define PRID_COMP_INGENIC 0xd00000 +#define PRID_COMP_INGENIC_JZ4770 0xd10000#define PRID_COMP_INGENIC2 0xe10000/*
arch/mips/lib/cpu-probe.c +1 -0
@@ -158,6 +158,7 @@ void cpu_probe(void)cpu_probe_broadcom (c);break ;case PRID_COMP_INGENIC : +case PRID_COMP_INGENIC_JZ4770 :case PRID_COMP_INGENIC2 :cpu_probe_ingenic (c);break ;
arch/mips/mach-xburst/Kconfig +6 -0
@@ -10,6 +10,12 @@ config CPU_JZ4755 select WATCHDOG select WATCHDOG_JZ4740 +config CPU_JZ4770 + bool + select SYS_HAS_CPU_MIPS32_R2 + select WATCHDOG + select WATCHDOG_JZ4740 + config CPU_JZ4780 bool select SYS_HAS_CPU_MIPS32_R2
Signature · 7 lines
2.1.4 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
PATCH 2/5 MIPS: xburst: debug_ll: add JZ4770 support
In reply to Antony Pavlov--- arch/mips/mach-xburst/Kconfig | 8 ++-- .../mach-xburst/include/mach/debug_ll_jz4770.h | 47 ++++++++++++++++++++++ arch/mips/mach-xburst/include/mach/jz4770.h | 25 ++++++++++++ 3 files changed, 76 insertions(+), 4 deletions(-)
arch/mips/mach-xburst/Kconfig +4 -4
@@ -41,19 +41,19 @@ choice prompt "DEBUG_LL port" config JZ47XX_DEBUG_LL_UART0 - depends on CPU_JZ4755 || CPU_JZ4780 + depends on CPU_JZ4755 || CPU_JZ4770 || CPU_JZ4780 bool "UART0" config JZ47XX_DEBUG_LL_UART1 - depends on CPU_JZ4755 || CPU_JZ4780 + depends on CPU_JZ4755 || CPU_JZ4770 || CPU_JZ4780 bool "UART1" config JZ47XX_DEBUG_LL_UART2 - depends on CPU_JZ4755 || CPU_JZ4780 + depends on CPU_JZ4755 || CPU_JZ4770 || CPU_JZ4780 bool "UART2" config JZ47XX_DEBUG_LL_UART3 - depends on CPU_JZ4780 + depends on CPU_JZ4770 || CPU_JZ4780 bool "UART3" config JZ47XX_DEBUG_LL_UART4
arch/mips/mach-xburst/include/mach/debug_ll_jz4770.h new file +47 -0
47 lines not on this page · raw message
arch/mips/mach-xburst/include/mach/jz4770.h new file +25 -0
@@ -0,0 +1,25 @@ +/* +* JZ4770 SoC definitions +* +* 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. +* +*/ + +#ifndef __MIPS_ASM_MACH_JZ4770_JZ4770_H__ +#define __MIPS_ASM_MACH_JZ4770_JZ4770_H__ + +/* APB bus devices */ +#define JZ4770_UART0_BASE 0xb0030000 +#define JZ4770_UART1_BASE 0xb0031000 +#define JZ4770_UART2_BASE 0xb0032000 +#define JZ4770_UART3_BASE 0xb0033000 + +#endif /* __MIPS_ASM_MACH_JZ4770_JZ4770_H__ */
Signature · 7 lines
2.1.4 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
PATCH 3/5 MIPS: xburst: add Ainol Novo7 Paladin support
In reply to Antony Pavlov--- arch/mips/Makefile | 1 + arch/mips/boards/ainol-novo7-paladin/Makefile | 1 + arch/mips/boards/ainol-novo7-paladin/board.c | 27 +++++++++++++++++ .../ainol-novo7-paladin/include/board/debug_ll.h | 23 +++++++++++++++ arch/mips/dts/ainol-novo7-paladin.dts | 34 ++++++++++++++++++++++ arch/mips/mach-xburst/Kconfig | 4 +++ 6 files changed, 90 insertions(+)
arch/mips/Makefile +1 -0
@@ -88,6 +88,7 @@ machine-$(CONFIG_MACH_MIPS_LOONGSON) := loongson board-$(CONFIG_BOARD_LOONGSON_TECH_LS1B) := loongson-ls1b machine-$(CONFIG_MACH_MIPS_XBURST) := xburst +board-$(CONFIG_BOARD_AINOL_NOVO7_PALADIN) := ainol-novo7-paladin board-$(CONFIG_BOARD_RZX50) := ritmix-rzx50 board-$(CONFIG_BOARD_CI20) := img-ci20
arch/mips/boards/ainol-novo7-paladin/Makefile new file +1 -0
@@ -0,0 +1 @@ +obj-y += board.o
arch/mips/boards/ainol-novo7-paladin/board.c new file +27 -0
@@ -0,0 +1,27 @@ +/* +* Copyright (C) 2015 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. +* +*/ + +#include <common.h> +#include <init.h> + +static int novo7_paladin_hostname_init (void ) +{ +barebox_set_hostname ("novo7-paladin" ); + +return 0 ; +} +console_initcall (novo7_paladin_hostname_init);
arch/mips/boards/ainol-novo7-paladin/include/board/debug_ll.h new file +23 -0
@@ -0,0 +1,23 @@ +/* +* Copyright (C) 2012, 2015 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. +* +*/ + +#ifndef __INCLUDE_NOVO_7_PALADIN_BOARD_DEBUG_LL_H__ +#define __INCLUDE_NOVO_7_PALADIN_BOARD_DEBUG_LL_H__ + +#include <mach/debug_ll_jz4770.h> + +#endif /* __INCLUDE_NOVO_7_PALADIN_BOARD_DEBUG_LL_H__ */
arch/mips/dts/ainol-novo7-paladin.dts new file +34 -0
@@ -0,0 +1,34 @@ +/* + * Ainol Novo7 Paladin device tree + * + * Copyright (c) 2015 Antony Pavlov <[email protected]> + * + * 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. + * + */ + +/dts-v1/; + +#include "jz4770.dtsi" + +/ { + model = "Ainol Novo7 Paladin"; + compatible = "ainol,novo7-paladin"; + + memory { + device_type = "memory"; + reg = <0x0 0x10000000>; + }; +}; + +&uart2 { + status = "okay"; +};
arch/mips/mach-xburst/Kconfig +4 -0
@@ -30,6 +30,10 @@ config BOARD_RZX50 select HAS_POWEROFF select CPU_JZ4755 +config BOARD_AINOL_NOVO7_PALADIN + bool "Ainol Novo7 Paladin" + select CPU_JZ4770 + config BOARD_CI20 bool "Imagination Creator CI20" select CPU_JZ4780
Signature · 7 lines
2.1.4 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
PATCH 4/5 MIPS: add ainol-novo7-paladin_defconfig
In reply to Antony Pavlov--- arch/mips/configs/ainol-novo7-paladin_defconfig | 42 +++++++++++++++++++++++++ 1 file changed, 42 insertions(+)
arch/mips/configs/ainol-novo7-paladin_defconfig new file +42 -0
@@ -0,0 +1,42 @@ +CONFIG_BUILTIN_DTB=y +CONFIG_BUILTIN_DTB_NAME="ainol-novo7-paladin" +CONFIG_MACH_MIPS_XBURST=y +CONFIG_BOARD_AINOL_NOVO7_PALADIN=y +CONFIG_JZ47XX_DEBUG_LL_UART2=y +CONFIG_EXPERIMENTAL=y +CONFIG_BAUDRATE=57600 +CONFIG_GLOB=y +CONFIG_HUSH_FANCY_PROMPT=y +CONFIG_CMDLINE_EDITING=y +CONFIG_AUTO_COMPLETE=y +# CONFIG_DEFAULT_ENVIRONMENT is not set +CONFIG_DEBUG_LL=y +CONFIG_LONGHELP=y +CONFIG_CMD_IOMEM=y +CONFIG_CMD_MEMINFO=y +CONFIG_CMD_BOOTM_SHOW_TYPE=y +CONFIG_CMD_BOOTM_VERBOSE=y +CONFIG_CMD_BOOTM_INITRD=y +CONFIG_CMD_BOOTM_OFTREE=y +CONFIG_CMD_BOOTM_OFTREE_UIMAGE=y +CONFIG_CMD_GO=y +CONFIG_CMD_LOADB=y +CONFIG_CMD_LOADS=y +CONFIG_CMD_LOADY=y +CONFIG_CMD_RESET=y +CONFIG_CMD_SAVES=y +CONFIG_CMD_UIMAGE=y +CONFIG_CMD_GLOBAL=y +CONFIG_CMD_FILETYPE=y +CONFIG_CMD_MD5SUM=y +CONFIG_CMD_SLEEP=y +CONFIG_CMD_EDIT=y +CONFIG_CMD_GPIO=y +CONFIG_OFDEVICE=y +# CONFIG_SPI is not set +CONFIG_CLOCKSOURCE_DUMMY_RATE=16000 +CONFIG_GPIO_JZ4740=y +# CONFIG_PINCTRL is not set +CONFIG_SHA1=y +CONFIG_SHA224=y +CONFIG_SHA256=y
Signature · 7 lines
2.1.4 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
PATCH 5/5 Documentation: add Ainol Novo7 Paladin board mini-howto
In reply to Antony Pavlov--- Documentation/boards/mips/ainol-novo7-paladin.rst | 45 +++++++++++++++++++++++ 1 file changed, 45 insertions(+)
Documentation/boards/mips/ainol-novo7-paladin.rst new file +45 -0
@@ -0,0 +1,45 @@ +Ainol Novo7 Paladin +=================== + +The tablet has + + * Ingenic JZ4770 SoC; + * 512 MiB DDR2 SDRAM; + * 8 GiB eMMC Flash Memory; + * UART; + * touchscreen (800x480); + * 1xUSB interface; + * buttons. + +The tablet uses X-Boot (Ingenic's not interactive U-Boot) as bootloader. + +Running barebox +--------------- + + 1. Connect to the tablet's UART (see. http://a320.emulate.su/2012/05/14/mini-obzor-planshet-ainol-novo7-paladin-i-processor-jz4770/); + + 2. Download and compile ingenic-boot tool for GCW0 + +.. code-block:: none + + $ git clone https://github.com/gcwnow/ingenic-boot + $ cd ingenic-boot + ingenic-boot$ make +.. + + 3. Push & hold VOL- (GPIO 114 aka D18) while power on or reset (this selects USB boot mode by activating BOOTSEL1 signal); + + 3. Upload and start barebox: + +.. code-block:: none + + ingenic-boot$ sudo ./tool/down2ram.sh --config=gcw0_v11_ddr2_512mb --bin=${PATH_TO_BAREBOX_DIR}/barebox-flash-image --downto=0xa0800000 --runat=0xa0800000 +.. + +Links +----- + + * http://www.ainol-novo.com/ainol-novo-7-paladin-first-android-4-0-tablet-pc.html + * ftp://ftp.ingenic.cn/SOC/JZ4770/JZ4770_DS.PDF + * https://github.com/IngenicSemiconductor/X-BOOT_NPM801 + * https://github.com/gcwnow/UBIBoot
Signature · 7 lines
2.1.4 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
Hi Antony,
Quoted 22 lines · Antony Pavlov
This patchseries adds initial JZ4770 SoC and Ainol Novo7 Paladin tablet support.
The patchseries can be found on github:
https://github.com/frantony/barebox/tree/20150411.jz4770The most notable problems and todos:
* no PBL support; I have a PBL-enabled barebox version
for the tablet, so barebox can be used as only bootloader for tablet. But this version is based on some dirty hacks
e.g. it uses special pre-compiled X-Boot blob for bootstraping.Nowadays barebox mips PBL is written in assembler
and I see no way to switch it to C. gcc-4.9.1 for mips has no__nakeddirective support, see this gcc output$ cat > 1.c <<EOF;
int __attribute__((naked)) __attribute__((no_instrument_function))main(){
}
EOF
Quoted 7 lines
$
/opt/mips-2014.11/bin/mips-linux-gnu-gcc-o 1.o 1.c 1.c:2:1: warning: 'naked' attribute directive ignored [-Wattributes]
{
^So for moving X-Boot bootstrap C-code into barebox PBL we have to convert it from C to assembler language :(
Is this really necessary? Only the entry point up to the point where you setup the stack needs to be assembly, from then on C can be used.
Quoted 6 lines
Please see JZ4770 bootstrap code in these repos:
https://github.com/gcwnow/UBIBoot/
https://github.com/IngenicSemiconductor/X-BOOT_NPM801
Quoted 6 lines
* no clk support just now; we can easely steal it from linux
JZ4780 support code (see wip-ci20-v4.1 branch in https://github.com/paulburton/linux);* no hardware clocksource support; this can be easely fixed,
see linux JZ4780 support code again; also see https://github.com/frantony/barebox/blob/next.xburst.jz4770.20130511/arch/mips/mach-xburst/csrc-jz4770.c
Before merging this series I'd like to have clocksource support. Using the dummy clocksource is fine during initial bringup, but I think merged code should not depend on it.
Sascha
Signature · 9 lines
Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox