[U-Boot] Help: U-Boot on Nokia RX-51 (aka N900)

Hello,
U-Boot patches which add support for Nokia RX-51 (aka N900) is here: http://al.robotfuzz.com/~al/maemo/u-boot/
RX-51 has closed 2nd stage bootloader NOLO which can load kernel image from nand (or usb) to ram and boot it. NOLO also done all HW initializations. These U-Boot patches for RX-51 add support that builded U-Boot binary can be loaded and booted by NOLO. So U-Boot will be 3rd bootloader.
Patches are on top of revision bd2313078114c4b44c4a5ce149af43bcb7fc8854 and working fine. I rebased these patches on top of u-boot git master repository, but booting failed. No output on device. Using git bisect I found that problem appeared at revision
561142af20f1fd7b425d9425730014e656defb91 ARM: implement relocation for ARM V7 (OMAP)
If I defined CONFIG_SYS_ARM_WITHOUT_RELOC U-Boot working and booting fine up to revision a9aa3926295df759306258e5e24cace414f53b67
So problem is that relocation patches broke RX-51 support. Can somebody help me how to rewrite/port rx-51 patches to work with ARM relocation (do not forget that U-Boot is loaded by 2nd bootloader to RAM after HW is initialized by NOLO)? If U-Boot will be working on RX-51 I will prepair patches for upstreaming.

On Thursday, September 01, 2011 10:42:48 AM Pali Rohár wrote:
Hello,
U-Boot patches which add support for Nokia RX-51 (aka N900) is here: http://al.robotfuzz.com/~al/maemo/u-boot/
RX-51 has closed 2nd stage bootloader NOLO which can load kernel image from nand (or usb) to ram and boot it. NOLO also done all HW initializations. These U-Boot patches for RX-51 add support that builded U-Boot binary can be loaded and booted by NOLO. So U-Boot will be 3rd bootloader.
Patches are on top of revision bd2313078114c4b44c4a5ce149af43bcb7fc8854 and working fine. I rebased these patches on top of u-boot git master repository, but booting failed. No output on device. Using git bisect I found that problem appeared at revision
561142af20f1fd7b425d9425730014e656defb91 ARM: implement relocation for ARM V7 (OMAP)
If I defined CONFIG_SYS_ARM_WITHOUT_RELOC U-Boot working and booting fine up to revision a9aa3926295df759306258e5e24cace414f53b67
So problem is that relocation patches broke RX-51 support. Can somebody help me how to rewrite/port rx-51 patches to work with ARM relocation (do not forget that U-Boot is loaded by 2nd bootloader to RAM after HW is initialized by NOLO)? If U-Boot will be working on RX-51 I will prepair patches for upstreaming.
Does NOLO enable MMU ?
btw can you post the patches to the ML for review ?
Cheers

On Thursday 01 September 2011 10:46:38 Marek Vasut wrote:
On Thursday, September 01, 2011 10:42:48 AM Pali Rohár wrote:
Hello,
U-Boot patches which add support for Nokia RX-51 (aka N900) is here: http://al.robotfuzz.com/~al/maemo/u-boot/
RX-51 has closed 2nd stage bootloader NOLO which can load kernel image from nand (or usb) to ram and boot it. NOLO also done all HW initializations. These U-Boot patches for RX-51 add support that builded U-Boot binary can be loaded and booted by NOLO. So U-Boot will be 3rd bootloader.
Patches are on top of revision bd2313078114c4b44c4a5ce149af43bcb7fc8854 and working fine. I rebased these patches on top of u-boot git master repository, but booting failed. No output on device. Using git bisect I found that problem appeared at revision
561142af20f1fd7b425d9425730014e656defb91 ARM: implement relocation for ARM V7 (OMAP)
If I defined CONFIG_SYS_ARM_WITHOUT_RELOC U-Boot working and booting fine up to revision a9aa3926295df759306258e5e24cace414f53b67
So problem is that relocation patches broke RX-51 support. Can somebody help me how to rewrite/port rx-51 patches to work with ARM relocation (do not forget that U-Boot is loaded by 2nd bootloader to RAM after HW is initialized by NOLO)? If U-Boot will be working on RX-51 I will prepair patches for upstreaming.
Does NOLO enable MMU ?
I'm not sure, because NOLO is proprietary, closed and without any documentation. Nobody knows what all NOLO doing...
btw can you post the patches to the ML for review ?
4 patches on http://al.robotfuzz.com/~al/maemo/u-boot/ is not mine and is not ready for merging - but working.
I'm prepairing patch series which fix some problems (keymap, watchog, ...). Now it is still based on bd2313078114c4b44c4a5ce149af43bcb7fc8854
Cheers

On Thursday, September 01, 2011 11:06:51 AM Pali Rohár wrote:
On Thursday 01 September 2011 10:46:38 Marek Vasut wrote:
On Thursday, September 01, 2011 10:42:48 AM Pali Rohár wrote:
Hello,
U-Boot patches which add support for Nokia RX-51 (aka N900) is here: http://al.robotfuzz.com/~al/maemo/u-boot/
RX-51 has closed 2nd stage bootloader NOLO which can load kernel image from nand (or usb) to ram and boot it. NOLO also done all HW initializations. These U-Boot patches for RX-51 add support that builded U-Boot binary can be loaded and booted by NOLO. So U-Boot will be 3rd bootloader.
Patches are on top of revision bd2313078114c4b44c4a5ce149af43bcb7fc8854 and working fine. I rebased these patches on top of u-boot git master repository, but booting failed. No output on device. Using git bisect I found that problem appeared at revision
561142af20f1fd7b425d9425730014e656defb91 ARM: implement relocation for ARM V7 (OMAP)
If I defined CONFIG_SYS_ARM_WITHOUT_RELOC U-Boot working and booting fine up to revision a9aa3926295df759306258e5e24cace414f53b67
So problem is that relocation patches broke RX-51 support. Can somebody help me how to rewrite/port rx-51 patches to work with ARM relocation (do not forget that U-Boot is loaded by 2nd bootloader to RAM after HW is initialized by NOLO)? If U-Boot will be working on RX-51 I will prepair patches for upstreaming.
Does NOLO enable MMU ?
I'm not sure, because NOLO is proprietary, closed and without any documentation. Nobody knows what all NOLO doing...
Check CPSR
btw can you post the patches to the ML for review ?
4 patches on http://al.robotfuzz.com/~al/maemo/u-boot/ is not mine and is not ready for merging - but working.
I'm prepairing patch series which fix some problems (keymap, watchog, ...). Now it is still based on bd2313078114c4b44c4a5ce149af43bcb7fc8854
Well ok.
Cheers

On 09/01/2011 10:42 AM, Pali Rohár wrote:
Hello,
Hi Pali,
U-Boot patches which add support for Nokia RX-51 (aka N900) is here: http://al.robotfuzz.com/~al/maemo/u-boot/
It is quite difficult to review patches in this way, considering you have already changed something to adapt to the currect release. I suggest you post your modified patches to ML.
RX-51 has closed 2nd stage bootloader NOLO which can load kernel image from nand (or usb) to ram and boot it. NOLO also done all HW initializations. These U-Boot patches for RX-51 add support that builded U-Boot binary can be loaded and booted by NOLO. So U-Boot will be 3rd bootloader.
Patches are on top of revision bd2313078114c4b44c4a5ce149af43bcb7fc8854 and working fine. I rebased these patches on top of u-boot git master repository, but booting failed. No output on device. Using git bisect I found that problem appeared at revision
561142af20f1fd7b425d9425730014e656defb91 ARM: implement relocation for ARM V7 (OMAP)
If I defined CONFIG_SYS_ARM_WITHOUT_RELOC U-Boot working and booting fine up to revision a9aa3926295df759306258e5e24cace414f53b67
So problem is that relocation patches broke RX-51 support.
Well, it does mean that the RX51 was not adapted for the relocation...
You should take care that the initial stackpointer (check for CONFIG_SYS_INIT_SP_ADDR) is set to a a range into RAM (or internal RAM, if any) and it is not overwritten by other parts (where is your TEXT code ?).
Move all first initialization into board_early_init_f, if any.
Best regards, Stefano Babic

On Thursday 01 September 2011 11:02:25 Stefano Babic wrote:
On 09/01/2011 10:42 AM, Pali Rohár wrote:
Hello,
Hi Pali,
U-Boot patches which add support for Nokia RX-51 (aka N900) is here: http://al.robotfuzz.com/~al/maemo/u-boot/
It is quite difficult to review patches in this way, considering you have already changed something to adapt to the currect release. I suggest you post your modified patches to ML.
Should I rebase patches on top on master now (which still not working) and send here?
RX-51 has closed 2nd stage bootloader NOLO which can load kernel image from nand (or usb) to ram and boot it. NOLO also done all HW initializations. These U-Boot patches for RX-51 add support that builded U-Boot binary can be loaded and booted by NOLO. So U-Boot will be 3rd bootloader.
Patches are on top of revision bd2313078114c4b44c4a5ce149af43bcb7fc8854 and working fine. I rebased these patches on top of u-boot git master repository, but booting failed. No output on device. Using git bisect I found that problem appeared at revision
561142af20f1fd7b425d9425730014e656defb91 ARM: implement relocation for ARM V7 (OMAP)
If I defined CONFIG_SYS_ARM_WITHOUT_RELOC U-Boot working and booting fine up to revision a9aa3926295df759306258e5e24cace414f53b67
So problem is that relocation patches broke RX-51 support.
Well, it does mean that the RX51 was not adapted for the relocation...
You should take care that the initial stackpointer (check for CONFIG_SYS_INIT_SP_ADDR) is set to a a range into RAM (or internal RAM, if any) and it is not overwritten by other parts (where is your TEXT code ?).
I check this.
Move all first initialization into board_early_init_f, if any.
Best regards, Stefano Babic

On 09/01/2011 11:09 AM, Pali Rohár wrote:
It is quite difficult to review patches in this way, considering you have already changed something to adapt to the currect release. I suggest you post your modified patches to ML.
Should I rebase patches on top on master now (which still not working) and send here?
Because the goal is to have not only the RX51 working, but to integrate it into mainline, this is the best way. A lot of people can check into your code and give you useful hints.
Best regards, Stefano Babic

On Thursday 01 September 2011 11:24:58 Stefano Babic wrote:
On 09/01/2011 11:09 AM, Pali Rohár wrote:
It is quite difficult to review patches in this way, considering you have already changed something to adapt to the currect release. I suggest you post your modified patches to ML.
Should I rebase patches on top on master now (which still not working) and send here?
Because the goal is to have not only the RX51 working, but to integrate it into mainline, this is the best way. A lot of people can check into your code and give you useful hints.
Best regards, Stefano Babic
Ok, I attached all patches which I rebased on top of master. But U-Boot still not working, not booting, no output on device.
Patches 0001 - 0006 are not mine, comes from initial u-boot version for rx-51
Patches 0001 - 0009 are for RX-51 support Patches 0010 - 0014 implement on screen ansi terminal boot menu Patch 0015 add bootmenu support for RX-51

On Thursday, September 01, 2011 12:49:49 PM Pali Rohár wrote:
On Thursday 01 September 2011 11:24:58 Stefano Babic wrote:
On 09/01/2011 11:09 AM, Pali Rohár wrote:
It is quite difficult to review patches in this way, considering you have already changed something to adapt to the currect release. I suggest you post your modified patches to ML.
Should I rebase patches on top on master now (which still not working) and send here?
Because the goal is to have not only the RX51 working, but to integrate it into mainline, this is the best way. A lot of people can check into your code and give you useful hints.
Best regards, Stefano Babic
Ok, I attached all patches which I rebased on top of master. But U-Boot still not working, not booting, no output on device.
Patches 0001 - 0006 are not mine, comes from initial u-boot version for rx-51
Patches 0001 - 0009 are for RX-51 support Patches 0010 - 0014 implement on screen ansi terminal boot menu Patch 0015 add bootmenu support for RX-51
git send-email please.
Cheers

From: Alistair Buxton a.j.buxton@gmail.com
This patch adapts the bootm command so that it can use an existing atags command set up by a previous bootloader. If the environment variable "atags" is unset, bootm behaves as normal. If "atags" is set, bootm will skip all boot args setup entirely, and pass the address found in "atags". For example, if a previous boot loader already set up the atags struct at 0x80000100:
setenv atags 0x80000100; bootm 0x80008000
Signed-off-by: Alistair Buxton a.j.buxton@gmail.com --- arch/arm/lib/bootm.c | 37 ++++++++++++++++++++++++++++--------- 1 files changed, 28 insertions(+), 9 deletions(-)
diff --git a/arch/arm/lib/bootm.c b/arch/arm/lib/bootm.c index 802e833..262efda 100644 --- a/arch/arm/lib/bootm.c +++ b/arch/arm/lib/bootm.c @@ -100,6 +100,13 @@ int do_bootm_linux(int flag, int argc, char *argv[], bootm_headers_t *images) int machid = bd->bi_arch_number; void (*kernel_entry)(int zero, int arch, uint params);
+#ifdef CONFIG_CHAINLOADER + uint params; + #define PARAMS params +#else + #define PARAMS (bd->bi_boot_params) +#endif + #ifdef CONFIG_CMDLINE_TAG char *commandline = getenv ("bootargs"); #endif @@ -125,34 +132,46 @@ int do_bootm_linux(int flag, int argc, char *argv[], bootm_headers_t *images) debug ("## Transferring control to Linux (at address %08lx) ...\n", (ulong) kernel_entry);
+#ifdef CONFIG_CHAINLOADER + s = getenv ("atags"); + if (s) { + params = simple_strtoul (s, NULL, 16); + printf ("Using existing atags at 0x%x\n", params); + } else { +#endif + #if defined (CONFIG_SETUP_MEMORY_TAGS) || \ defined (CONFIG_CMDLINE_TAG) || \ defined (CONFIG_INITRD_TAG) || \ defined (CONFIG_SERIAL_TAG) || \ defined (CONFIG_REVISION_TAG) - setup_start_tag (bd); + setup_start_tag (bd); #ifdef CONFIG_SERIAL_TAG - setup_serial_tag (¶ms); + setup_serial_tag (¶ms); #endif #ifdef CONFIG_REVISION_TAG - setup_revision_tag (¶ms); + setup_revision_tag (¶ms); #endif #ifdef CONFIG_SETUP_MEMORY_TAGS - setup_memory_tags (bd); + setup_memory_tags (bd); #endif #ifdef CONFIG_CMDLINE_TAG - setup_commandline_tag (bd, commandline); + setup_commandline_tag (bd, commandline); #endif #ifdef CONFIG_INITRD_TAG - if (images->rd_start && images->rd_end) - setup_initrd_tag (bd, images->rd_start, images->rd_end); + if (images->rd_start && images->rd_end) + setup_initrd_tag (bd, images->rd_start, images->rd_end); +#endif + setup_end_tag(bd); #endif - setup_end_tag(bd); + +#ifdef CONFIG_CHAINLOADER + } #endif
announce_and_cleanup();
- kernel_entry(0, machid, bd->bi_boot_params); + kernel_entry(0, machid, PARAMS); /* does not return */
return 1;

From: Alistair Buxton a.j.buxton@gmail.com
This patch stores the values in r1 and r2 at startup. It also stores the address which u-boot was originally loaded to. This is useful if you feed some other bootloader a u-boot.bin instead of the linux kernel it was expecting. It is rather ugly because it stores these values in an arbitrary memory address.
Signed-off-by: Alistair Buxton a.j.buxton@gmail.com --- arch/arm/cpu/armv7/start.S | 16 ++++++++++++++++ 1 files changed, 16 insertions(+), 0 deletions(-)
diff --git a/arch/arm/cpu/armv7/start.S b/arch/arm/cpu/armv7/start.S index db8e9d2..8a456f0 100644 --- a/arch/arm/cpu/armv7/start.S +++ b/arch/arm/cpu/armv7/start.S @@ -134,6 +134,22 @@ IRQ_STACK_START_IN: */
reset: +#if (CONFIG_CHAINLOADER) + /* + * Ugly hack: store the u-boot load address and kernel params + * 0x82000004: address where this image was loaded + * 0x82000008: mach_type + * 0x8200000c: atags address + */ + adr r0, _start + mov r3, #0x82000000 + add r3, r3, #4 + str r0, [r3] + add r3, r3, #4 + str r1, [r3] + add r3, r3, #4 + str r2, [r3] +#endif bl save_boot_params /* * set the cpu to SVC32 mode

From: Alistair Buxton a.j.buxton@gmail.com
This board definition results in a u-boot.bin which can be chainloaded from NOLO in qemu or on a real N900. It does very little hardware config because NOLO has already configured the board.
NOLO is expecting a kernel image and will treat any image it finds in onenand as such. This u-boot is intended to be flashed to the N900 like a kernel. In order to transparently boot the original kernel, it will be appended to u-boot.bin at 0x40000. NOLO will load the entire image into memory and execute u-boot, which saves the ATAGs set by NOLO. Then the bootscripts will attempt to load uImage or boot.scr from a fat filesystem on MMC1 partition 3. If this fails, the appended kernel image will be booted using the stored ATAGs.
There is also support for framebuffer and the N900 keyboard. USB tty works but is disabled because it prevents the current Maemo kernel from booting.
Signed-off-by: Alistair Buxton a.j.buxton@gmail.com --- board/nokia/rx51/Makefile | 49 ++++++ board/nokia/rx51/config.mk | 33 ++++ board/nokia/rx51/rx51.c | 255 ++++++++++++++++++++++++++++ board/nokia/rx51/rx51.h | 382 ++++++++++++++++++++++++++++++++++++++++++ boards.cfg | 1 + include/configs/nokia_rx51.h | 329 ++++++++++++++++++++++++++++++++++++ 6 files changed, 1049 insertions(+), 0 deletions(-) create mode 100644 board/nokia/rx51/Makefile create mode 100644 board/nokia/rx51/config.mk create mode 100644 board/nokia/rx51/rx51.c create mode 100644 board/nokia/rx51/rx51.h create mode 100644 include/configs/nokia_rx51.h
diff --git a/board/nokia/rx51/Makefile b/board/nokia/rx51/Makefile new file mode 100644 index 0000000..31ad6fd --- /dev/null +++ b/board/nokia/rx51/Makefile @@ -0,0 +1,49 @@ +# +# (C) Copyright 2000, 2001, 2002 +# Wolfgang Denk, DENX Software Engineering, wd@denx.de. +# +# 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 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 +# + +include $(TOPDIR)/config.mk + +LIB = $(obj)lib$(BOARD).a + +COBJS := rx51.o + +SRCS := $(COBJS:.o=.c) +OBJS := $(addprefix $(obj),$(COBJS)) + +$(LIB): $(obj).depend $(OBJS) + $(AR) $(ARFLAGS) $@ $(OBJS) + +clean: + rm -f $(OBJS) + +distclean: clean + rm -f $(LIB) core *.bak $(obj).depend + +######################################################################### + +# defines $(obj).depend target +include $(SRCTREE)/rules.mk + +sinclude $(obj).depend + +######################################################################### diff --git a/board/nokia/rx51/config.mk b/board/nokia/rx51/config.mk new file mode 100644 index 0000000..6c81a34 --- /dev/null +++ b/board/nokia/rx51/config.mk @@ -0,0 +1,33 @@ +# +# (C) Copyright 2006 +# Texas Instruments, <www.ti.com> +# +# Nokia N900 uses OMAP3 (ARM-CortexA8) cpu +# see http://www.ti.com/ for more information on Texas Instruments +# +# 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 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 +# +# Physical Address: +# 8000'0000 (bank0) +# 8800/0000 (bank1) +# Linux-Kernel is expected to be at 8000'8000, entry 8000'8000 +# (mem base + reserved) + +# For use with external or internal boots. +TEXT_BASE = 0x80e80000 diff --git a/board/nokia/rx51/rx51.c b/board/nokia/rx51/rx51.c new file mode 100644 index 0000000..3149a79 --- /dev/null +++ b/board/nokia/rx51/rx51.c @@ -0,0 +1,255 @@ +/* + * (C) Copyright 2010 + * Alistair Buxton a.j.buxton@gmail.com + * + * Derived from Beagle Board and 3430 SDP code: + * (C) Copyright 2004-2008 + * Texas Instruments, <www.ti.com> + * + * Author : + * Sunil Kumar sunilsaini05@gmail.com + * Shashi Ranjan shashiranjanmca05@gmail.com + * + * Richard Woodruff r-woodruff2@ti.com + * Syed Mohammed Khasim khasim@ti.com + * + * 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 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 + */ +#include <common.h> +#include <twl4030.h> +#include <i2c.h> +#include <video_fb.h> +#include <asm/io.h> +#include <asm/arch/mux.h> +#include <asm/arch/sys_proto.h> +#include <asm/arch/gpio.h> +#include <asm/mach-types.h> +#include "rx51.h" + +GraphicDevice gdev; + +/* + * Routine: board_init + * Description: Early hardware init. + */ +int board_init(void) +{ + DECLARE_GLOBAL_DATA_PTR; + + gpmc_init(); /* in SRAM or SDRAM, finish GPMC */ + /* board id for Linux */ + gd->bd->bi_arch_number = MACH_TYPE_NOKIA_RX51; + /* boot param addr */ + gd->bd->bi_boot_params = (OMAP34XX_SDRC_CS0 + 0x100); + + return 0; +} + +/* + * Routine: video_hw_init + * Description: Set up the GraphicDevice depending on sys_boot. + */ +void *video_hw_init(void) +{ + /* fill in Graphic Device */ + gdev.frameAdrs = 0x8f9c0000; + gdev.winSizeX = 800; + gdev.winSizeY = 480; + /* check sys_boot */ + if (readw(0x480022f0)&0xf) { /* in qemu */ + gdev.gdfBytesPP = 4; + gdev.gdfIndex = GDF_32BIT_X888RGB; + memset((void *)gdev.frameAdrs, 0, 0x177000); + } else { /* real hardware */ + gdev.gdfBytesPP = 2; + gdev.gdfIndex = GDF_16BIT_565RGB; + memset((void *)gdev.frameAdrs, 0, 0xbb800); + } + + return (void *) &gdev; +} + +/* + * Routine: misc_init_r + * Description: Configure board specific parts + */ +int misc_init_r(void) +{ +#ifdef CONFIG_CHAINLOADER + char buf[12]; + printf("Getting NOLO supplied boot parameters...\n"); + sprintf(buf, "0x%x", readl(0x82000004)); + setenv("nolo_loadaddr", buf); + sprintf(buf, "0x%x", readl(0x82000004)+0x40000); + setenv("nolo_kernaddr", buf); + sprintf(buf, "0x%x", readl(0x82000008)); + setenv("nolo_machtype", buf); + sprintf(buf, "0x%x", readl(0x8200000c)); + setenv("nolo_atagaddr", buf); +#endif + + dieid_num_r(); + + return 0; +} + +/* + * Routine: set_muxconf_regs + * Description: Setting up the configuration Mux registers specific to the + * hardware. Many pins need to be moved from protect to primary + * mode. + */ +void set_muxconf_regs(void) +{ + MUX_RX51(); +} + +/* + * TWL4030 keypad handler for cfb_console + */ + +char keymap[] = { + /* normal */ + 'q', 'o', 'p', ',', '\b', 0, 'a', 's', + 'w', 'd', 'f', 'g', 'h', 'j', 'k', 'l', + 'e', '.', 0, '\r', 0, 'z', 'x', 'c', + 'r', 'v', 'b', 'n', 'm', ' ', 0, 0, + 't', 0, 0, 0, 0, 0, 0, 0, + 'y', 0, 0, 0, 0, 0, 0, 0, + 'u', 0, 0, 0, 0, 0, 0, 0, + 'i', 0, 0, 0, 0, 0, 0, 0, + /* fn */ + '1', '9', '0', '=', '\b', 0, '*', '+', + '2', '#', '-', '_', '(', ')', '&', '!', + '3', '?', 0, '\r', 0, 0, '$', 0, + '4', '/', '\', '"', ''', '@', 0, 0, + '5', 0, 0, 0, 0, 0, 0, 0, + '6', 0, 0, 0, 0, 0, 0, 0, + '7', 0, 0, 0, 0, 0, 0, 0, + '8', 0, 0, 0, 0, 0, 0, 0, +}; + +u8 keys[8]; +u8 old_keys[8] = {0, 0, 0, 0, 0, 0, 0, 0}; +#define KEYBUF_SIZE 4 +u8 keybuf[KEYBUF_SIZE]; +u8 keybuf_head = 0, keybuf_tail = 0; + +int rx51_kp_init(void) +{ + int ret = 0; + u8 ctrl; + ret = twl4030_i2c_read_u8(TWL4030_CHIP_KEYPAD, &ctrl, + TWL4030_KEYPAD_KEYP_CTRL_REG); + + if (!ret) { + /* turn on keyboard and use hardware scanning */ + ctrl |= TWL4030_KEYPAD_CTRL_KBD_ON; + ctrl |= TWL4030_KEYPAD_CTRL_SOFT_NRST; + ctrl |= TWL4030_KEYPAD_CTRL_SOFTMODEN; + ret |= twl4030_i2c_write_u8(TWL4030_CHIP_KEYPAD, ctrl, + TWL4030_KEYPAD_KEYP_CTRL_REG); + /* enable key event status */ + ret |= twl4030_i2c_write_u8(TWL4030_CHIP_KEYPAD, 0xfe, + TWL4030_KEYPAD_KEYP_IMR1); + /* using the second interrupt event breaks meamo pr1.2 kernel */ + /*ret |= twl4030_i2c_write_u8(TWL4030_CHIP_KEYPAD, 0xfe, + TWL4030_KEYPAD_KEYP_IMR2);*/ + /* enable missed event tracking */ + /*ret |= twl4030_i2c_write_u8(TWL4030_CHIP_KEYPAD, 0x20, + TWL4030_KEYPAD_KEYP_SMS);*/ + /* enable interrupt generation on rising and falling */ + /* this is a workaround for qemu twl4030 emulation */ + ret |= twl4030_i2c_write_u8(TWL4030_CHIP_KEYPAD, 0x57, + TWL4030_KEYPAD_KEYP_EDR); + /* enable ISR clear on read */ + ret |= twl4030_i2c_write_u8(TWL4030_CHIP_KEYPAD, 0x05, + TWL4030_KEYPAD_KEYP_SIH_CTRL); + } + return ret; +} + +char rx51_kp_fill(u8 k, u8 mods) +{ + if (mods & 2) { /* fn */ + k = keymap[k+64]; + } else { + k = keymap[k]; + if (mods & 4) { /* shift */ + if (k >= 'a' && k <= 'z') + k += 'A' - 'a'; + else if (k == '.') + k = ':'; + else if (k == ',') + k = ';'; + } + } + keybuf[keybuf_tail++] = k; + keybuf_tail %= KEYBUF_SIZE; +} + +int rx51_kp_tstc(void) +{ + u8 c, r, dk, k, i; + u8 intr; + u8 mods; + + /* twl4030 remembers up to 2 events */ + for (i = 0; i < 2; i++) { + + /* check interrupt register for events */ + twl4030_i2c_read_u8(TWL4030_CHIP_KEYPAD, &intr, + TWL4030_KEYPAD_KEYP_ISR1+(2*i)); + + if (intr&1) { /* got an event */ + + /* read the key state */ + i2c_read(TWL4030_CHIP_KEYPAD, + TWL4030_KEYPAD_FULL_CODE_7_0, 1, keys, 8); + + /* cut out modifier keys from the keystate */ + mods = keys[4] >> 4; + keys[4] &= 0x0f; + + for (c = 0; c < 8; c++) { + + /* get newly pressed keys only */ + dk = ((keys[c] ^ old_keys[c])&keys[c]); + old_keys[c] = keys[c]; + + /* fill the keybuf */ + for (r = 0; r < 8; r++) { + if (dk&1) + rx51_kp_fill((c*8)+r, mods); + dk = dk >> 1; + } + } + } + } + return (KEYBUF_SIZE + keybuf_tail - keybuf_head)%KEYBUF_SIZE; +} + +int rx51_kp_getc(void) +{ + keybuf_head %= KEYBUF_SIZE; + while (!rx51_kp_tstc()) + ; + return keybuf[keybuf_head++]; +} + diff --git a/board/nokia/rx51/rx51.h b/board/nokia/rx51/rx51.h new file mode 100644 index 0000000..625129c --- /dev/null +++ b/board/nokia/rx51/rx51.h @@ -0,0 +1,382 @@ +/* + * (C) Copyright 2008 + * Dirk Behme dirk.behme@gmail.com + * + * 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 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 _RX51_H_ +#define _RX51_H_ + +const omap3_sysinfo sysinfo = { + DDR_STACKED, + "OMAP3 RX-51", +#if defined(CONFIG_ENV_IS_IN_ONENAND) + "OneNAND", +#else + "NAND", +#endif +}; + +/* + * IEN - Input Enable + * IDIS - Input Disable + * PTD - Pull type Down + * PTU - Pull type Up + * DIS - Pull type selection is inactive + * EN - Pull type selection is active + * M0 - Mode 0 + * The commented string gives the final mux configuration for that pin + */ +#define MUX_RX51() \ + /*SDRC*/\ + MUX_VAL(CP(SDRC_D0), (IEN | PTD | DIS | M0)) /*SDRC_D0*/\ + MUX_VAL(CP(SDRC_D1), (IEN | PTD | DIS | M0)) /*SDRC_D1*/\ + MUX_VAL(CP(SDRC_D2), (IEN | PTD | DIS | M0)) /*SDRC_D2*/\ + MUX_VAL(CP(SDRC_D3), (IEN | PTD | DIS | M0)) /*SDRC_D3*/\ + MUX_VAL(CP(SDRC_D4), (IEN | PTD | DIS | M0)) /*SDRC_D4*/\ + MUX_VAL(CP(SDRC_D5), (IEN | PTD | DIS | M0)) /*SDRC_D5*/\ + MUX_VAL(CP(SDRC_D6), (IEN | PTD | DIS | M0)) /*SDRC_D6*/\ + MUX_VAL(CP(SDRC_D7), (IEN | PTD | DIS | M0)) /*SDRC_D7*/\ + MUX_VAL(CP(SDRC_D8), (IEN | PTD | DIS | M0)) /*SDRC_D8*/\ + MUX_VAL(CP(SDRC_D9), (IEN | PTD | DIS | M0)) /*SDRC_D9*/\ + MUX_VAL(CP(SDRC_D10), (IEN | PTD | DIS | M0)) /*SDRC_D10*/\ + MUX_VAL(CP(SDRC_D11), (IEN | PTD | DIS | M0)) /*SDRC_D11*/\ + MUX_VAL(CP(SDRC_D12), (IEN | PTD | DIS | M0)) /*SDRC_D12*/\ + MUX_VAL(CP(SDRC_D13), (IEN | PTD | DIS | M0)) /*SDRC_D13*/\ + MUX_VAL(CP(SDRC_D14), (IEN | PTD | DIS | M0)) /*SDRC_D14*/\ + MUX_VAL(CP(SDRC_D15), (IEN | PTD | DIS | M0)) /*SDRC_D15*/\ + MUX_VAL(CP(SDRC_D16), (IEN | PTD | DIS | M0)) /*SDRC_D16*/\ + MUX_VAL(CP(SDRC_D17), (IEN | PTD | DIS | M0)) /*SDRC_D17*/\ + MUX_VAL(CP(SDRC_D18), (IEN | PTD | DIS | M0)) /*SDRC_D18*/\ + MUX_VAL(CP(SDRC_D19), (IEN | PTD | DIS | M0)) /*SDRC_D19*/\ + MUX_VAL(CP(SDRC_D20), (IEN | PTD | DIS | M0)) /*SDRC_D20*/\ + MUX_VAL(CP(SDRC_D21), (IEN | PTD | DIS | M0)) /*SDRC_D21*/\ + MUX_VAL(CP(SDRC_D22), (IEN | PTD | DIS | M0)) /*SDRC_D22*/\ + MUX_VAL(CP(SDRC_D23), (IEN | PTD | DIS | M0)) /*SDRC_D23*/\ + MUX_VAL(CP(SDRC_D24), (IEN | PTD | DIS | M0)) /*SDRC_D24*/\ + MUX_VAL(CP(SDRC_D25), (IEN | PTD | DIS | M0)) /*SDRC_D25*/\ + MUX_VAL(CP(SDRC_D26), (IEN | PTD | DIS | M0)) /*SDRC_D26*/\ + MUX_VAL(CP(SDRC_D27), (IEN | PTD | DIS | M0)) /*SDRC_D27*/\ + MUX_VAL(CP(SDRC_D28), (IEN | PTD | DIS | M0)) /*SDRC_D28*/\ + MUX_VAL(CP(SDRC_D29), (IEN | PTD | DIS | M0)) /*SDRC_D29*/\ + MUX_VAL(CP(SDRC_D30), (IEN | PTD | DIS | M0)) /*SDRC_D30*/\ + MUX_VAL(CP(SDRC_D31), (IEN | PTD | DIS | M0)) /*SDRC_D31*/\ + MUX_VAL(CP(SDRC_CLK), (IEN | PTD | DIS | M0)) /*SDRC_CLK*/\ + MUX_VAL(CP(SDRC_DQS0), (IEN | PTD | DIS | M0)) /*SDRC_DQS0*/\ + MUX_VAL(CP(SDRC_DQS1), (IEN | PTD | DIS | M0)) /*SDRC_DQS1*/\ + MUX_VAL(CP(SDRC_DQS2), (IEN | PTD | DIS | M0)) /*SDRC_DQS2*/\ + MUX_VAL(CP(SDRC_DQS3), (IEN | PTD | DIS | M0)) /*SDRC_DQS3*/\ + /*GPMC*/\ + MUX_VAL(CP(GPMC_A1), (IDIS | PTD | DIS | M0)) /*GPMC_A1*/\ + MUX_VAL(CP(GPMC_A2), (IDIS | PTD | DIS | M0)) /*GPMC_A2*/\ + MUX_VAL(CP(GPMC_A3), (IDIS | PTD | DIS | M0)) /*GPMC_A3*/\ + MUX_VAL(CP(GPMC_A4), (IDIS | PTD | DIS | M0)) /*GPMC_A4*/\ + MUX_VAL(CP(GPMC_A5), (IDIS | PTD | DIS | M0)) /*GPMC_A5*/\ + MUX_VAL(CP(GPMC_A6), (IDIS | PTD | DIS | M0)) /*GPMC_A6*/\ + MUX_VAL(CP(GPMC_A7), (IDIS | PTD | DIS | M0)) /*GPMC_A7*/\ + MUX_VAL(CP(GPMC_A8), (IDIS | PTD | DIS | M0)) /*GPMC_A8*/\ + MUX_VAL(CP(GPMC_A9), (IDIS | PTD | DIS | M0)) /*GPMC_A9*/\ + MUX_VAL(CP(GPMC_A10), (IDIS | PTD | DIS | M0)) /*GPMC_A10*/\ + MUX_VAL(CP(GPMC_D0), (IEN | PTD | DIS | M0)) /*GPMC_D0*/\ + MUX_VAL(CP(GPMC_D1), (IEN | PTD | DIS | M0)) /*GPMC_D1*/\ + MUX_VAL(CP(GPMC_D2), (IEN | PTD | DIS | M0)) /*GPMC_D2*/\ + MUX_VAL(CP(GPMC_D3), (IEN | PTD | DIS | M0)) /*GPMC_D3*/\ + MUX_VAL(CP(GPMC_D4), (IEN | PTD | DIS | M0)) /*GPMC_D4*/\ + MUX_VAL(CP(GPMC_D5), (IEN | PTD | DIS | M0)) /*GPMC_D5*/\ + MUX_VAL(CP(GPMC_D6), (IEN | PTD | DIS | M0)) /*GPMC_D6*/\ + MUX_VAL(CP(GPMC_D7), (IEN | PTD | DIS | M0)) /*GPMC_D7*/\ + MUX_VAL(CP(GPMC_D8), (IEN | PTD | DIS | M0)) /*GPMC_D8*/\ + MUX_VAL(CP(GPMC_D9), (IEN | PTD | DIS | M0)) /*GPMC_D9*/\ + MUX_VAL(CP(GPMC_D10), (IEN | PTD | DIS | M0)) /*GPMC_D10*/\ + MUX_VAL(CP(GPMC_D11), (IEN | PTD | DIS | M0)) /*GPMC_D11*/\ + MUX_VAL(CP(GPMC_D12), (IEN | PTD | DIS | M0)) /*GPMC_D12*/\ + MUX_VAL(CP(GPMC_D13), (IEN | PTD | DIS | M0)) /*GPMC_D13*/\ + MUX_VAL(CP(GPMC_D14), (IEN | PTD | DIS | M0)) /*GPMC_D14*/\ + MUX_VAL(CP(GPMC_D15), (IEN | PTD | DIS | M0)) /*GPMC_D15*/\ + MUX_VAL(CP(GPMC_NCS0), (IDIS | PTU | EN | M0)) /*GPMC_nCS0*/\ + MUX_VAL(CP(GPMC_NCS1), (IDIS | PTU | EN | M0)) /*GPMC_nCS1*/\ + MUX_VAL(CP(GPMC_NCS2), (IDIS | PTU | EN | M0)) /*GPMC_nCS2*/\ + MUX_VAL(CP(GPMC_NCS3), (IDIS | PTU | EN | M0)) /*GPMC_nCS3*/\ + MUX_VAL(CP(GPMC_NCS4), (IDIS | PTU | EN | M0)) /*GPMC_nCS4*/\ + MUX_VAL(CP(GPMC_NCS5), (IDIS | PTD | DIS | M0)) /*GPMC_nCS5*/\ + MUX_VAL(CP(GPMC_NCS6), (IEN | PTD | DIS | M1)) /*SYS_nDMA_REQ2*/\ + MUX_VAL(CP(GPMC_NCS7), (IEN | PTU | EN | M1)) /*SYS_nDMA_REQ3*/\ + MUX_VAL(CP(GPMC_NBE1), (IEN | PTD | DIS | M0)) /*GPMC_nBE1*/\ + MUX_VAL(CP(GPMC_WAIT2), (IEN | PTU | EN | M0)) /*GPMC_WAIT2*/\ + MUX_VAL(CP(GPMC_WAIT3), (IEN | PTU | EN | M0)) /*GPMC_WAIT3*/\ + MUX_VAL(CP(GPMC_CLK), (IDIS | PTD | DIS | M0)) /*GPMC_CLK*/\ + MUX_VAL(CP(GPMC_NADV_ALE), (IDIS | PTD | DIS | M0)) /*GPMC_nADV_ALE*/\ + MUX_VAL(CP(GPMC_NOE), (IDIS | PTD | DIS | M0)) /*GPMC_nOE*/\ + MUX_VAL(CP(GPMC_NWE), (IDIS | PTD | DIS | M0)) /*GPMC_nWE*/\ + MUX_VAL(CP(GPMC_NBE0_CLE), (IDIS | PTD | DIS | M0)) /*GPMC_nBE0_CLE*/\ + MUX_VAL(CP(GPMC_NWP), (IEN | PTD | DIS | M0)) /*GPMC_nWP*/\ + MUX_VAL(CP(GPMC_WAIT0), (IEN | PTU | EN | M0)) /*GPMC_WAIT0*/\ + MUX_VAL(CP(GPMC_WAIT1), (IEN | PTU | EN | M0)) /*GPMC_WAIT1*/\ + /*DSS*/\ + MUX_VAL(CP(DSS_PCLK), (IDIS | PTD | DIS | M0)) /*DSS_PCLK*/\ + MUX_VAL(CP(DSS_HSYNC), (IDIS | PTD | DIS | M0)) /*DSS_HSYNC*/\ + MUX_VAL(CP(DSS_VSYNC), (IDIS | PTD | DIS | M0)) /*DSS_VSYNC*/\ + MUX_VAL(CP(DSS_ACBIAS), (IDIS | PTD | DIS | M0)) /*DSS_ACBIAS*/\ + MUX_VAL(CP(DSS_DATA0), (IDIS | PTD | DIS | M0)) /*DSS_DATA0*/\ + MUX_VAL(CP(DSS_DATA1), (IDIS | PTD | DIS | M0)) /*DSS_DATA1*/\ + MUX_VAL(CP(DSS_DATA2), (IDIS | PTD | DIS | M0)) /*DSS_DATA2*/\ + MUX_VAL(CP(DSS_DATA3), (IDIS | PTD | DIS | M0)) /*DSS_DATA3*/\ + MUX_VAL(CP(DSS_DATA4), (IDIS | PTD | DIS | M0)) /*DSS_DATA4*/\ + MUX_VAL(CP(DSS_DATA5), (IDIS | PTD | DIS | M0)) /*DSS_DATA5*/\ + MUX_VAL(CP(DSS_DATA6), (IDIS | PTD | DIS | M0)) /*DSS_DATA6*/\ + MUX_VAL(CP(DSS_DATA7), (IDIS | PTD | DIS | M0)) /*DSS_DATA7*/\ + MUX_VAL(CP(DSS_DATA8), (IDIS | PTD | DIS | M0)) /*DSS_DATA8*/\ + MUX_VAL(CP(DSS_DATA9), (IDIS | PTD | DIS | M0)) /*DSS_DATA9*/\ + MUX_VAL(CP(DSS_DATA10), (IDIS | PTD | DIS | M0)) /*DSS_DATA10*/\ + MUX_VAL(CP(DSS_DATA11), (IDIS | PTD | DIS | M0)) /*DSS_DATA11*/\ + MUX_VAL(CP(DSS_DATA12), (IDIS | PTD | DIS | M0)) /*DSS_DATA12*/\ + MUX_VAL(CP(DSS_DATA13), (IDIS | PTD | DIS | M0)) /*DSS_DATA13*/\ + MUX_VAL(CP(DSS_DATA14), (IDIS | PTD | DIS | M0)) /*DSS_DATA14*/\ + MUX_VAL(CP(DSS_DATA15), (IDIS | PTD | DIS | M0)) /*DSS_DATA15*/\ + MUX_VAL(CP(DSS_DATA16), (IDIS | PTD | DIS | M0)) /*DSS_DATA16*/\ + MUX_VAL(CP(DSS_DATA17), (IDIS | PTD | DIS | M0)) /*DSS_DATA17*/\ + MUX_VAL(CP(DSS_DATA18), (IDIS | PTD | DIS | M0)) /*DSS_DATA18*/\ + MUX_VAL(CP(DSS_DATA19), (IDIS | PTD | DIS | M0)) /*DSS_DATA19*/\ + MUX_VAL(CP(DSS_DATA20), (IDIS | PTD | DIS | M0)) /*DSS_DATA20*/\ + MUX_VAL(CP(DSS_DATA21), (IDIS | PTD | DIS | M0)) /*DSS_DATA21*/\ + MUX_VAL(CP(DSS_DATA22), (IDIS | PTD | DIS | M0)) /*DSS_DATA22*/\ + MUX_VAL(CP(DSS_DATA23), (IDIS | PTD | DIS | M0)) /*DSS_DATA23*/\ + /*CAMERA*/\ + MUX_VAL(CP(CAM_HS), (IEN | PTU | EN | M0)) /*CAM_HS */\ + MUX_VAL(CP(CAM_VS), (IEN | PTU | EN | M0)) /*CAM_VS */\ + MUX_VAL(CP(CAM_XCLKA), (IDIS | PTD | DIS | M0)) /*CAM_XCLKA*/\ + MUX_VAL(CP(CAM_PCLK), (IEN | PTU | EN | M0)) /*CAM_PCLK*/\ + MUX_VAL(CP(CAM_FLD), (IDIS | PTD | DIS | M4)) /*GPIO_98*/\ + MUX_VAL(CP(CAM_D0), (IEN | PTD | DIS | M0)) /*CAM_D0*/\ + MUX_VAL(CP(CAM_D1), (IEN | PTD | DIS | M0)) /*CAM_D1*/\ + MUX_VAL(CP(CAM_D2), (IEN | PTD | DIS | M0)) /*CAM_D2*/\ + MUX_VAL(CP(CAM_D3), (IEN | PTD | DIS | M0)) /*CAM_D3*/\ + MUX_VAL(CP(CAM_D4), (IEN | PTD | DIS | M0)) /*CAM_D4*/\ + MUX_VAL(CP(CAM_D5), (IEN | PTD | DIS | M0)) /*CAM_D5*/\ + MUX_VAL(CP(CAM_D6), (IEN | PTD | DIS | M0)) /*CAM_D6*/\ + MUX_VAL(CP(CAM_D7), (IEN | PTD | DIS | M0)) /*CAM_D7*/\ + MUX_VAL(CP(CAM_D8), (IEN | PTD | DIS | M0)) /*CAM_D8*/\ + MUX_VAL(CP(CAM_D9), (IEN | PTD | DIS | M0)) /*CAM_D9*/\ + MUX_VAL(CP(CAM_D10), (IEN | PTD | DIS | M0)) /*CAM_D10*/\ + MUX_VAL(CP(CAM_D11), (IEN | PTD | DIS | M0)) /*CAM_D11*/\ + MUX_VAL(CP(CAM_XCLKB), (IDIS | PTD | DIS | M0)) /*CAM_XCLKB*/\ + MUX_VAL(CP(CAM_WEN), (IEN | PTD | DIS | M4)) /*GPIO_167*/\ + MUX_VAL(CP(CAM_STROBE), (IDIS | PTD | DIS | M0)) /*CAM_STROBE*/\ + MUX_VAL(CP(CSI2_DX0), (IEN | PTD | DIS | M0)) /*CSI2_DX0*/\ + MUX_VAL(CP(CSI2_DY0), (IEN | PTD | DIS | M0)) /*CSI2_DY0*/\ + MUX_VAL(CP(CSI2_DX1), (IEN | PTD | DIS | M0)) /*CSI2_DX1*/\ + MUX_VAL(CP(CSI2_DY1), (IEN | PTD | DIS | M0)) /*CSI2_DY1*/\ + /*Audio Interface */\ + MUX_VAL(CP(MCBSP2_FSX), (IEN | PTD | DIS | M0)) /*McBSP2_FSX*/\ + MUX_VAL(CP(MCBSP2_CLKX), (IEN | PTD | DIS | M0)) /*McBSP2_CLKX*/\ + MUX_VAL(CP(MCBSP2_DR), (IEN | PTD | DIS | M0)) /*McBSP2_DR*/\ + MUX_VAL(CP(MCBSP2_DX), (IDIS | PTD | DIS | M0)) /*McBSP2_DX*/\ + /*Expansion card */\ + MUX_VAL(CP(MMC1_CLK), (IDIS | PTU | EN | M0)) /*MMC1_CLK*/\ + MUX_VAL(CP(MMC1_CMD), (IEN | PTU | EN | M0)) /*MMC1_CMD*/\ + MUX_VAL(CP(MMC1_DAT0), (IEN | PTU | EN | M0)) /*MMC1_DAT0*/\ + MUX_VAL(CP(MMC1_DAT1), (IEN | PTU | EN | M0)) /*MMC1_DAT1*/\ + MUX_VAL(CP(MMC1_DAT2), (IEN | PTU | EN | M0)) /*MMC1_DAT2*/\ + MUX_VAL(CP(MMC1_DAT3), (IEN | PTU | EN | M0)) /*MMC1_DAT3*/\ + MUX_VAL(CP(MMC1_DAT4), (IEN | PTU | EN | M0)) /*MMC1_DAT4*/\ + MUX_VAL(CP(MMC1_DAT5), (IEN | PTU | EN | M0)) /*MMC1_DAT5*/\ + MUX_VAL(CP(MMC1_DAT6), (IEN | PTU | EN | M0)) /*MMC1_DAT6*/\ + MUX_VAL(CP(MMC1_DAT7), (IEN | PTU | EN | M0)) /*MMC1_DAT7*/\ + /*Wireless LAN */\ + MUX_VAL(CP(MMC2_CLK), (IEN | PTU | EN | M4)) /*GPIO_130*/\ + MUX_VAL(CP(MMC2_CMD), (IEN | PTU | EN | M4)) /*GPIO_131*/\ + MUX_VAL(CP(MMC2_DAT0), (IEN | PTU | EN | M4)) /*GPIO_132*/\ + MUX_VAL(CP(MMC2_DAT1), (IEN | PTU | EN | M4)) /*GPIO_133*/\ + MUX_VAL(CP(MMC2_DAT2), (IEN | PTU | EN | M4)) /*GPIO_134*/\ + MUX_VAL(CP(MMC2_DAT3), (IEN | PTU | EN | M4)) /*GPIO_135*/\ + MUX_VAL(CP(MMC2_DAT4), (IEN | PTU | EN | M4)) /*GPIO_136*/\ + MUX_VAL(CP(MMC2_DAT5), (IEN | PTU | EN | M4)) /*GPIO_137*/\ + MUX_VAL(CP(MMC2_DAT6), (IEN | PTU | EN | M4)) /*GPIO_138*/\ + MUX_VAL(CP(MMC2_DAT7), (IEN | PTU | EN | M4)) /*GPIO_139*/\ + /*Bluetooth*/\ + MUX_VAL(CP(MCBSP3_DX), (IEN | PTD | DIS | M1)) /*UART2_CTS*/\ + MUX_VAL(CP(MCBSP3_DR), (IDIS | PTD | DIS | M1)) /*UART2_RTS*/\ + MUX_VAL(CP(MCBSP3_CLKX), (IDIS | PTD | DIS | M1)) /*UART2_TX*/\ + MUX_VAL(CP(MCBSP3_FSX), (IEN | PTD | DIS | M1)) /*UART2_RX*/\ + MUX_VAL(CP(UART2_CTS), (IEN | PTD | DIS | M4)) /*GPIO_144*/\ + MUX_VAL(CP(UART2_RTS), (IEN | PTD | DIS | M4)) /*GPIO_145*/\ + MUX_VAL(CP(UART2_TX), (IEN | PTD | DIS | M4)) /*GPIO_146*/\ + MUX_VAL(CP(UART2_RX), (IEN | PTD | DIS | M4)) /*GPIO_147*/\ + /*Modem Interface */\ + MUX_VAL(CP(UART1_TX), (IDIS | PTD | DIS | M0)) /*UART1_TX*/\ + MUX_VAL(CP(UART1_RTS), (IDIS | PTD | DIS | M4)) /*GPIO_149*/ \ + MUX_VAL(CP(UART1_CTS), (IDIS | PTD | DIS | M4)) /*GPIO_150*/ \ + MUX_VAL(CP(UART1_RX), (IEN | PTD | DIS | M0)) /*UART1_RX*/\ + MUX_VAL(CP(MCBSP4_CLKX), (IEN | PTD | DIS | M1)) /*SSI1_DAT_RX*/\ + MUX_VAL(CP(MCBSP4_DR), (IEN | PTD | DIS | M1)) /*SSI1_FLAG_RX*/\ + MUX_VAL(CP(MCBSP4_DX), (IEN | PTD | DIS | M1)) /*SSI1_RDY_RX*/\ + MUX_VAL(CP(MCBSP4_FSX), (IEN | PTD | DIS | M1)) /*SSI1_WAKE*/\ + MUX_VAL(CP(MCBSP1_CLKR), (IDIS | PTD | DIS | M4)) /*GPIO_156*/\ + MUX_VAL(CP(MCBSP1_FSR), (IDIS | PTU | EN | M4)) /*GPIO_157*/\ + MUX_VAL(CP(MCBSP1_DX), (IDIS | PTD | DIS | M4)) /*GPIO_158*/\ + MUX_VAL(CP(MCBSP1_DR), (IDIS | PTD | DIS | M4)) /*GPIO_159*/\ + MUX_VAL(CP(MCBSP_CLKS), (IEN | PTU | DIS | M0)) /*McBSP_CLKS*/\ + MUX_VAL(CP(MCBSP1_FSX), (IDIS | PTD | DIS | M4)) /*GPIO_161*/\ + MUX_VAL(CP(MCBSP1_CLKX), (IDIS | PTD | DIS | M4)) /*GPIO_162*/\ + /*Serial Interface*/\ + MUX_VAL(CP(UART3_CTS_RCTX), (IEN | PTD | EN | M0)) /*UART3_CTS_RCTX*/\ + MUX_VAL(CP(UART3_RTS_SD), (IDIS | PTD | DIS | M0)) /*UART3_RTS_SD */\ + MUX_VAL(CP(UART3_RX_IRRX), (IEN | PTD | DIS | M0)) /*UART3_RX_IRRX*/\ + MUX_VAL(CP(UART3_TX_IRTX), (IDIS | PTD | DIS | M0)) /*UART3_TX_IRTX*/\ + MUX_VAL(CP(HSUSB0_CLK), (IEN | PTD | DIS | M0)) /*HSUSB0_CLK*/\ + MUX_VAL(CP(HSUSB0_STP), (IDIS | PTU | EN | M0)) /*HSUSB0_STP*/\ + MUX_VAL(CP(HSUSB0_DIR), (IEN | PTD | DIS | M0)) /*HSUSB0_DIR*/\ + MUX_VAL(CP(HSUSB0_NXT), (IEN | PTD | DIS | M0)) /*HSUSB0_NXT*/\ + MUX_VAL(CP(HSUSB0_DATA0), (IEN | PTD | DIS | M0)) /*HSUSB0_DATA0*/\ + MUX_VAL(CP(HSUSB0_DATA1), (IEN | PTD | DIS | M0)) /*HSUSB0_DATA1*/\ + MUX_VAL(CP(HSUSB0_DATA2), (IEN | PTD | DIS | M0)) /*HSUSB0_DATA2*/\ + MUX_VAL(CP(HSUSB0_DATA3), (IEN | PTD | DIS | M0)) /*HSUSB0_DATA3*/\ + MUX_VAL(CP(HSUSB0_DATA4), (IEN | PTD | DIS | M0)) /*HSUSB0_DATA4*/\ + MUX_VAL(CP(HSUSB0_DATA5), (IEN | PTD | DIS | M0)) /*HSUSB0_DATA5*/\ + MUX_VAL(CP(HSUSB0_DATA6), (IEN | PTD | DIS | M0)) /*HSUSB0_DATA6*/\ + MUX_VAL(CP(HSUSB0_DATA7), (IEN | PTD | DIS | M0)) /*HSUSB0_DATA7*/\ + MUX_VAL(CP(I2C1_SCL), (IEN | PTU | EN | M0)) /*I2C1_SCL*/\ + MUX_VAL(CP(I2C1_SDA), (IEN | PTU | EN | M0)) /*I2C1_SDA*/\ + MUX_VAL(CP(I2C2_SCL), (IEN | PTU | EN | M4)) /*GPIO_168*/\ + MUX_VAL(CP(I2C2_SDA), (IEN | PTU | EN | M4)) /*GPIO_183*/\ + MUX_VAL(CP(I2C3_SCL), (IEN | PTU | EN | M0)) /*I2C3_SCL*/\ + MUX_VAL(CP(I2C3_SDA), (IEN | PTU | EN | M0)) /*I2C3_SDA*/\ + MUX_VAL(CP(I2C4_SCL), (IEN | PTU | EN | M0)) /*I2C4_SCL*/\ + MUX_VAL(CP(I2C4_SDA), (IEN | PTU | EN | M0)) /*I2C4_SDA*/\ + MUX_VAL(CP(HDQ_SIO), (IDIS | PTU | EN | M4)) /*GPIO_170*/\ + MUX_VAL(CP(MCSPI1_CLK), (IEN | PTU | EN | M4)) /*GPIO_171*/\ + MUX_VAL(CP(MCSPI1_SIMO), (IEN | PTU | EN | M4)) /*GPIO_172*/\ + MUX_VAL(CP(MCSPI1_SOMI), (IEN | PTD | DIS | M0)) /*McSPI1_SOMI*/\ + MUX_VAL(CP(MCSPI1_CS0), (IEN | PTD | EN | M0)) /*McSPI1_CS0*/\ + MUX_VAL(CP(MCSPI1_CS1), (IDIS | PTD | EN | M0)) /*McSPI1_CS1*/\ + MUX_VAL(CP(MCSPI1_CS2), (IDIS | PTD | DIS | M4)) /*GPIO_176*/\ + /* USB EHCI (port 2) */\ + MUX_VAL(CP(MCSPI1_CS3), (IEN | PTU | DIS | M3)) /*HSUSB2_DATA2*/\ + MUX_VAL(CP(MCSPI2_CLK), (IEN | PTU | DIS | M3)) /*HSUSB2_DATA7*/\ + MUX_VAL(CP(MCSPI2_SIMO), (IEN | PTU | DIS | M3)) /*HSUSB2_DATA4*/\ + MUX_VAL(CP(MCSPI2_SOMI), (IEN | PTU | DIS | M3)) /*HSUSB2_DATA5*/\ + MUX_VAL(CP(MCSPI2_CS0), (IEN | PTU | DIS | M3)) /*HSUSB2_DATA6*/\ + MUX_VAL(CP(MCSPI2_CS1), (IEN | PTU | DIS | M3)) /*HSUSB2_DATA3*/\ + MUX_VAL(CP(ETK_D10_ES2), (IDIS | PTU | DIS | M3)) /*HSUSB2_CLK*/\ + MUX_VAL(CP(ETK_D11_ES2), (IDIS | PTU | DIS | M3)) /*HSUSB2_STP*/\ + MUX_VAL(CP(ETK_D12_ES2), (IEN | PTU | DIS | M3)) /*HSUSB2_DIR*/\ + MUX_VAL(CP(ETK_D13_ES2), (IEN | PTU | DIS | M3)) /*HSUSB2_NXT*/\ + MUX_VAL(CP(ETK_D14_ES2), (IEN | PTU | DIS | M3)) /*HSUSB2_DATA0*/\ + MUX_VAL(CP(ETK_D15_ES2), (IEN | PTU | DIS | M3)) /*HSUSB2_DATA1*/\ + /*Control and debug */\ + MUX_VAL(CP(SYS_32K), (IEN | PTD | DIS | M0)) /*SYS_32K*/\ + MUX_VAL(CP(SYS_CLKREQ), (IEN | PTD | DIS | M0)) /*SYS_CLKREQ*/\ + MUX_VAL(CP(SYS_NIRQ), (IEN | PTU | EN | M0)) /*SYS_nIRQ*/\ + MUX_VAL(CP(SYS_BOOT0), (IEN | PTD | DIS | M4)) /*GPIO_2*/\ + MUX_VAL(CP(SYS_BOOT1), (IEN | PTD | DIS | M4)) /*GPIO_3*/\ + MUX_VAL(CP(SYS_BOOT2), (IEN | PTD | DIS | M4)) /*GPIO_4 - MMC1_WP*/\ + MUX_VAL(CP(SYS_BOOT3), (IEN | PTD | DIS | M4)) /*GPIO_5*/\ + MUX_VAL(CP(SYS_BOOT4), (IEN | PTD | DIS | M4)) /*GPIO_6*/\ + MUX_VAL(CP(SYS_BOOT5), (IEN | PTD | DIS | M4)) /*GPIO_7*/\ + MUX_VAL(CP(SYS_BOOT6), (IDIS | PTD | DIS | M4)) /*GPIO_8*/ \ + MUX_VAL(CP(SYS_OFF_MODE), (IEN | PTD | DIS | M0)) /*SYS_OFF_MODE*/\ + MUX_VAL(CP(SYS_CLKOUT1), (IEN | PTD | DIS | M0)) /*SYS_CLKOUT1*/\ + MUX_VAL(CP(SYS_CLKOUT2), (IEN | PTU | EN | M4)) /*GPIO_186*/\ + MUX_VAL(CP(ETK_CLK_ES2), (IDIS | PTU | EN | M3)) /*HSUSB1_STP*/\ + MUX_VAL(CP(ETK_CTL_ES2), (IDIS | PTU | DIS | M3)) /*HSUSB1_CLK*/\ + MUX_VAL(CP(ETK_D0_ES2), (IEN | PTU | DIS | M3)) /*HSUSB1_DATA0*/\ + MUX_VAL(CP(ETK_D1_ES2), (IEN | PTU | DIS | M3)) /*HSUSB1_DATA1*/\ + MUX_VAL(CP(ETK_D2_ES2), (IEN | PTU | DIS | M3)) /*HSUSB1_DATA2*/\ + MUX_VAL(CP(ETK_D3_ES2), (IEN | PTU | DIS | M3)) /*HSUSB1_DATA7*/\ + MUX_VAL(CP(ETK_D4_ES2), (IEN | PTU | DIS | M3)) /*HSUSB1_DATA4*/\ + MUX_VAL(CP(ETK_D5_ES2), (IEN | PTU | DIS | M3)) /*HSUSB1_DATA5*/\ + MUX_VAL(CP(ETK_D6_ES2), (IEN | PTU | DIS | M3)) /*HSUSB1_DATA6*/\ + MUX_VAL(CP(ETK_D7_ES2), (IEN | PTU | DIS | M3)) /*HSUSB1_DATA3*/\ + MUX_VAL(CP(ETK_D8_ES2), (IEN | PTU | DIS | M3)) /*HSUSB1_DIR*/\ + MUX_VAL(CP(ETK_D9_ES2), (IEN | PTU | DIS | M3)) /*HSUSB1_NXT*/\ + MUX_VAL(CP(D2D_MCAD1), (IEN | PTD | EN | M0)) /*d2d_mcad1*/\ + MUX_VAL(CP(D2D_MCAD2), (IEN | PTD | EN | M0)) /*d2d_mcad2*/\ + MUX_VAL(CP(D2D_MCAD3), (IEN | PTD | EN | M0)) /*d2d_mcad3*/\ + MUX_VAL(CP(D2D_MCAD4), (IEN | PTD | EN | M0)) /*d2d_mcad4*/\ + MUX_VAL(CP(D2D_MCAD5), (IEN | PTD | EN | M0)) /*d2d_mcad5*/\ + MUX_VAL(CP(D2D_MCAD6), (IEN | PTD | EN | M0)) /*d2d_mcad6*/\ + MUX_VAL(CP(D2D_MCAD7), (IEN | PTD | EN | M0)) /*d2d_mcad7*/\ + MUX_VAL(CP(D2D_MCAD8), (IEN | PTD | EN | M0)) /*d2d_mcad8*/\ + MUX_VAL(CP(D2D_MCAD9), (IEN | PTD | EN | M0)) /*d2d_mcad9*/\ + MUX_VAL(CP(D2D_MCAD10), (IEN | PTD | EN | M0)) /*d2d_mcad10*/\ + MUX_VAL(CP(D2D_MCAD11), (IEN | PTD | EN | M0)) /*d2d_mcad11*/\ + MUX_VAL(CP(D2D_MCAD12), (IEN | PTD | EN | M0)) /*d2d_mcad12*/\ + MUX_VAL(CP(D2D_MCAD13), (IEN | PTD | EN | M0)) /*d2d_mcad13*/\ + MUX_VAL(CP(D2D_MCAD14), (IEN | PTD | EN | M0)) /*d2d_mcad14*/\ + MUX_VAL(CP(D2D_MCAD15), (IEN | PTD | EN | M0)) /*d2d_mcad15*/\ + MUX_VAL(CP(D2D_MCAD16), (IEN | PTD | EN | M0)) /*d2d_mcad16*/\ + MUX_VAL(CP(D2D_MCAD17), (IEN | PTD | EN | M0)) /*d2d_mcad17*/\ + MUX_VAL(CP(D2D_MCAD18), (IEN | PTD | EN | M0)) /*d2d_mcad18*/\ + MUX_VAL(CP(D2D_MCAD19), (IEN | PTD | EN | M0)) /*d2d_mcad19*/\ + MUX_VAL(CP(D2D_MCAD20), (IEN | PTD | EN | M0)) /*d2d_mcad20*/\ + MUX_VAL(CP(D2D_MCAD21), (IEN | PTD | EN | M0)) /*d2d_mcad21*/\ + MUX_VAL(CP(D2D_MCAD22), (IEN | PTD | EN | M0)) /*d2d_mcad22*/\ + MUX_VAL(CP(D2D_MCAD23), (IEN | PTD | EN | M0)) /*d2d_mcad23*/\ + MUX_VAL(CP(D2D_MCAD24), (IEN | PTD | EN | M0)) /*d2d_mcad24*/\ + MUX_VAL(CP(D2D_MCAD25), (IEN | PTD | EN | M0)) /*d2d_mcad25*/\ + MUX_VAL(CP(D2D_MCAD26), (IEN | PTD | EN | M0)) /*d2d_mcad26*/\ + MUX_VAL(CP(D2D_MCAD27), (IEN | PTD | EN | M0)) /*d2d_mcad27*/\ + MUX_VAL(CP(D2D_MCAD28), (IEN | PTD | EN | M0)) /*d2d_mcad28*/\ + MUX_VAL(CP(D2D_MCAD29), (IEN | PTD | EN | M0)) /*d2d_mcad29*/\ + MUX_VAL(CP(D2D_MCAD30), (IEN | PTD | EN | M0)) /*d2d_mcad30*/\ + MUX_VAL(CP(D2D_MCAD31), (IEN | PTD | EN | M0)) /*d2d_mcad31*/\ + MUX_VAL(CP(D2D_MCAD32), (IEN | PTD | EN | M0)) /*d2d_mcad32*/\ + MUX_VAL(CP(D2D_MCAD33), (IEN | PTD | EN | M0)) /*d2d_mcad33*/\ + MUX_VAL(CP(D2D_MCAD34), (IEN | PTD | EN | M0)) /*d2d_mcad34*/\ + MUX_VAL(CP(D2D_MCAD35), (IEN | PTD | EN | M0)) /*d2d_mcad35*/\ + MUX_VAL(CP(D2D_MCAD36), (IEN | PTD | EN | M0)) /*d2d_mcad36*/\ + MUX_VAL(CP(D2D_CLK26MI), (IEN | PTD | DIS | M0)) /*d2d_clk26mi*/\ + MUX_VAL(CP(D2D_NRESPWRON), (IEN | PTD | EN | M0)) /*d2d_nrespwron*/\ + MUX_VAL(CP(D2D_NRESWARM), (IEN | PTU | EN | M0)) /*d2d_nreswarm */\ + MUX_VAL(CP(D2D_ARM9NIRQ), (IEN | PTD | DIS | M0)) /*d2d_arm9nirq */\ + MUX_VAL(CP(D2D_UMA2P6FIQ), (IEN | PTD | DIS | M0)) /*d2d_uma2p6fiq*/\ + MUX_VAL(CP(D2D_SPINT), (IEN | PTD | EN | M0)) /*d2d_spint*/\ + MUX_VAL(CP(D2D_FRINT), (IEN | PTD | EN | M0)) /*d2d_frint*/\ + MUX_VAL(CP(D2D_DMAREQ0), (IEN | PTD | DIS | M0)) /*d2d_dmareq0*/\ + MUX_VAL(CP(D2D_DMAREQ1), (IEN | PTD | DIS | M0)) /*d2d_dmareq1*/\ + MUX_VAL(CP(D2D_DMAREQ2), (IEN | PTD | DIS | M0)) /*d2d_dmareq2*/\ + MUX_VAL(CP(D2D_DMAREQ3), (IEN | PTD | DIS | M0)) /*d2d_dmareq3*/\ + MUX_VAL(CP(D2D_N3GTRST), (IEN | PTD | DIS | M0)) /*d2d_n3gtrst*/\ + MUX_VAL(CP(D2D_N3GTDI), (IEN | PTD | DIS | M0)) /*d2d_n3gtdi*/\ + MUX_VAL(CP(D2D_N3GTDO), (IEN | PTD | DIS | M0)) /*d2d_n3gtdo*/\ + MUX_VAL(CP(D2D_N3GTMS), (IEN | PTD | DIS | M0)) /*d2d_n3gtms*/\ + MUX_VAL(CP(D2D_N3GTCK), (IEN | PTD | DIS | M0)) /*d2d_n3gtck*/\ + MUX_VAL(CP(D2D_N3GRTCK), (IEN | PTD | DIS | M0)) /*d2d_n3grtck*/\ + MUX_VAL(CP(D2D_MSTDBY), (IEN | PTU | EN | M0)) /*d2d_mstdby*/\ + MUX_VAL(CP(D2D_SWAKEUP), (IEN | PTD | EN | M0)) /*d2d_swakeup*/\ + MUX_VAL(CP(D2D_IDLEREQ), (IEN | PTD | DIS | M0)) /*d2d_idlereq*/\ + MUX_VAL(CP(D2D_IDLEACK), (IEN | PTU | EN | M0)) /*d2d_idleack*/\ + MUX_VAL(CP(D2D_MWRITE), (IEN | PTD | DIS | M0)) /*d2d_mwrite*/\ + MUX_VAL(CP(D2D_SWRITE), (IEN | PTD | DIS | M0)) /*d2d_swrite*/\ + MUX_VAL(CP(D2D_MREAD), (IEN | PTD | DIS | M0)) /*d2d_mread*/\ + MUX_VAL(CP(D2D_SREAD), (IEN | PTD | DIS | M0)) /*d2d_sread*/\ + MUX_VAL(CP(D2D_MBUSFLAG), (IEN | PTD | DIS | M0)) /*d2d_mbusflag*/\ + MUX_VAL(CP(D2D_SBUSFLAG), (IEN | PTD | DIS | M0)) /*d2d_sbusflag*/\ + MUX_VAL(CP(SDRC_CKE0), (IDIS | PTU | EN | M0)) /*sdrc_cke0*/\ + MUX_VAL(CP(SDRC_CKE1), (IDIS | PTU | EN | M0)) /*sdrc_cke1*/ + +#define MUX_RX51_C() \ + MUX_VAL(CP(MCBSP3_DX), (IEN | PTD | DIS | M4)) /*GPIO_140*/\ + MUX_VAL(CP(MCBSP3_DR), (IEN | PTD | DIS | M4)) /*GPIO_142*/\ + MUX_VAL(CP(MCBSP3_CLKX), (IEN | PTD | DIS | M4)) /*GPIO_141*/\ + MUX_VAL(CP(UART2_CTS), (IEN | PTU | EN | M0)) /*UART2_CTS*/\ + MUX_VAL(CP(UART2_RTS), (IDIS | PTD | DIS | M0)) /*UART2_RTS*/\ + MUX_VAL(CP(UART2_TX), (IDIS | PTD | DIS | M0)) /*UART2_TX*/ + +#endif diff --git a/boards.cfg b/boards.cfg index c253f03..844f25d 100644 --- a/boards.cfg +++ b/boards.cfg @@ -178,6 +178,7 @@ omap3_beagle arm armv7 beagle ti omap3_evm arm armv7 evm ti omap3 omap3_sdp3430 arm armv7 sdp3430 ti omap3 devkit8000 arm armv7 devkit8000 timll omap3 +nokia_rx51 arm armv7 rx51 nokia omap3 omap4_panda arm armv7 panda ti omap4 omap4_sdp4430 arm armv7 sdp4430 ti omap4 s5p_goni arm armv7 goni samsung s5pc1xx diff --git a/include/configs/nokia_rx51.h b/include/configs/nokia_rx51.h new file mode 100644 index 0000000..45b942a --- /dev/null +++ b/include/configs/nokia_rx51.h @@ -0,0 +1,329 @@ +/* + * (C) Copyright 2010 + * Alistair Buxton a.j.buxton@gmail.com + * + * Derived from Beagle Board code: + * (C) Copyright 2006-2008 + * Texas Instruments. + * Richard Woodruff r-woodruff2@ti.com + * Syed Mohammed Khasim x0khasim@ti.com + * + * Configuration settings for the Nokia RX-51 aka N900. + * + * 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 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 __CONFIG_H +#define __CONFIG_H + +/* + * High Level Configuration Options + */ +#define CONFIG_ARMV7 1 /* This is an ARM V7 CPU core */ +#define CONFIG_OMAP 1 /* in a TI OMAP core */ +#define CONFIG_OMAP34XX 1 /* which is a 34XX */ +#define CONFIG_OMAP3430 1 /* which is in a 3430 */ +#define CONFIG_OMAP3_RX51 1 /* working with RX51 */ +#define CONFIG_CHAINLOADER 1 /* Loaded by NOLO */ + +#define CONFIG_SDRC /* The chip has SDRC controller */ + +#include <asm/arch/cpu.h> /* get chip and board defs */ +#include <asm/arch/omap3.h> + +/* + * Display CPU and Board information + */ +#define CONFIG_DISPLAY_CPUINFO 1 +#define CONFIG_DISPLAY_BOARDINFO 1 + +/* Clock Defines */ +#define V_OSCK 26000000 /* Clock output from T2 */ +#define V_SCLK (V_OSCK >> 1) + +#undef CONFIG_USE_IRQ /* no support for IRQs */ +#define CONFIG_MISC_INIT_R +#define CONFIG_SKIP_LOWLEVEL_INIT /* NOLO set everything up */ + +#define CONFIG_CMDLINE_TAG 1 /* enable passing of ATAGs */ +#define CONFIG_SETUP_MEMORY_TAGS 1 +#define CONFIG_INITRD_TAG 1 +#define CONFIG_REVISION_TAG 1 + +/* + * Size of malloc() pool + */ +#define CONFIG_ENV_SIZE (128 << 10) /* 128 KiB */ + /* Sector */ +#define CONFIG_SYS_MALLOC_LEN (CONFIG_ENV_SIZE + (128 << 10)) +#define CONFIG_SYS_GBL_DATA_SIZE 128 /* bytes reserved for */ + /* initial data */ + +/* + * Hardware drivers + */ + +/* + * NS16550 Configuration + */ +#define V_NS16550_CLK 48000000 /* 48MHz (APLL96/2) */ + +#define CONFIG_SYS_NS16550 +#define CONFIG_SYS_NS16550_SERIAL +#define CONFIG_SYS_NS16550_REG_SIZE (-4) +#define CONFIG_SYS_NS16550_CLK V_NS16550_CLK + +/* + * select serial console configuration + */ +#define CONFIG_CONS_INDEX 3 +#define CONFIG_SYS_NS16550_COM3 OMAP34XX_UART3 +#define CONFIG_SERIAL3 3 /* UART3 on RX-51 */ + +/* allow to overwrite serial and ethaddr */ +#define CONFIG_ENV_OVERWRITE +#define CONFIG_BAUDRATE 115200 +#define CONFIG_SYS_BAUDRATE_TABLE {4800, 9600, 19200, 38400, 57600,\ + 115200} +#define CONFIG_MMC 1 +#define CONFIG_OMAP3_MMC 1 +#define CONFIG_DOS_PARTITION 1 + +/* DDR - I use Micron DDR */ +#define CONFIG_OMAP3_MICRON_DDR 1 + +/* USB - broken */ +#define CONFIG_MUSB_UDC 1 +#define CONFIG_USB_OMAP3 1 +#define CONFIG_TWL4030_USB 1 + +/* USB device configuration - broken */ +#define CONFIG_USB_DEVICE 1 +/* FIXME: usbtty breaks maemo pr1.2 kernel booting +#define CONFIG_USB_TTY 1 +*/ +#define CONFIG_SYS_CONSOLE_IS_IN_ENV 1 + +/* commands to include */ +#include <config_cmd_default.h> + +#define CONFIG_CMD_EXT2 /* EXT2 Support */ +#define CONFIG_CMD_FAT /* FAT support */ + +#define CONFIG_CMD_I2C /* I2C serial bus support */ +#define CONFIG_CMD_MMC /* MMC support */ +#define CONFIG_CMD_ONENAND /* NAND support */ + +#undef CONFIG_CMD_FLASH /* flinfo, erase, protect */ +#undef CONFIG_CMD_FPGA /* FPGA configuration Support */ +#undef CONFIG_CMD_IMI /* iminfo */ +#undef CONFIG_CMD_IMLS /* List all found images */ +#undef CONFIG_CMD_NET /* bootp, tftpboot, rarpboot */ +#undef CONFIG_CMD_NFS /* NFS support */ + +#define CONFIG_SYS_NO_FLASH +#define CONFIG_HARD_I2C 1 +#define CONFIG_SYS_I2C_SPEED 100000 +#define CONFIG_SYS_I2C_SLAVE 1 +#define CONFIG_SYS_I2C_BUS 0 +#define CONFIG_SYS_I2C_BUS_SELECT 1 +#define CONFIG_DRIVER_OMAP34XX_I2C 1 + +/* + * TWL4030 + */ +#define CONFIG_TWL4030_POWER 1 +#define CONFIG_TWL4030_LED 1 +#define CONFIG_TWL4030_KEYPAD 1 + +/* + * Framebuffer + */ +/* Video console */ +#define CONFIG_VIDEO +#define CONFIG_CFB_CONSOLE +#define CONFIG_VIDEO_LOGO +#define VIDEO_FB_16BPP_PIXEL_SWAP +#define VIDEO_FB_16BPP_WORD_SWAP +#define CONFIG_VIDEO_SW_CURSOR +#define CONFIG_SPLASH_SCREEN + +/* functions for cfb_console */ +#define VIDEO_KBD_INIT_FCT rx51_kp_init() +#define VIDEO_TSTC_FCT rx51_kp_tstc +#define VIDEO_GETC_FCT rx51_kp_getc +#ifndef __ASSEMBLY__ +int rx51_kp_init(void); +int rx51_kp_tstc(void); +int rx51_kp_getc(void); +#endif + +/* Environment information */ +#define CONFIG_BOOTDELAY 3 + +#define CONFIG_EXTRA_ENV_SETTINGS \ + "usbtty=cdc_acm\0" \ + "stdin=vga\0stdout=vga\0stderr=vga\0" \ + "setcon=setenv stdin ${con};" \ + "setenv stdout ${con};" \ + "setenv stderr ${con}\0" \ + "sercon=setenv con serial; run setcon\0" \ + "usbcon=setenv con usbtty; run setcon\0" \ + "vgacon=setenv con vga; run setcon\0" \ + "loadaddr=0x82000000\0" \ + "meegoargs=setenv bootargs\0" \ + "loadbootscript=fatload mmc 0 ${loadaddr} boot.scr\0" \ + "bootscript=echo Running bootscript from mmc ...; " \ + "source ${loadaddr}\0" \ + "loaduimage=fatload mmc 0:3 ${loadaddr} uImage\0" \ + "mmcboot=echo Booting from mmc ...; " \ + "run meegoargs; " \ + "bootm ${loadaddr}\0" \ + "noloboot=echo Booting NOLO supplied kernel ...; " \ + "setenv atags ${nolo_atagaddr};" \ + "bootm ${nolo_kernaddr}\0" + +#define CONFIG_PREBOOT \ + "echo Extra commands:;" \ + "echo run sercon - Use serial port for control.;" \ + "echo run usbcon - Use usbtty for control.;" \ + "echo run vgacon - Use framebuffer/keyboard.;" \ + "echo run mmcboot - Boot from SD card slot.;" \ + "echo run noloboot - Boot kernel loaded by NOLO." + +#define CONFIG_BOOTCOMMAND \ + "if mmc init; then " \ + "if run loadbootscript; then " \ + "run bootscript; " \ + "else " \ + "if run loaduimage; then " \ + "run mmcboot; " \ + "else run noloboot; " \ + "fi; " \ + "fi; " \ + "else run noloboot; fi" + +#define CONFIG_AUTO_COMPLETE 1 +/* + * Miscellaneous configurable options + */ +#define CONFIG_SYS_LONGHELP /* undef to save memory */ +#define CONFIG_SYS_HUSH_PARSER /* use "hush" command parser */ +#define CONFIG_SYS_PROMPT_HUSH_PS2 "> " +#define CONFIG_SYS_PROMPT "OMAP3 RX-51 # " +#define CONFIG_SYS_CBSIZE 256 /* Console I/O Buffer Size */ +/* Print Buffer Size */ +#define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE + \ + sizeof(CONFIG_SYS_PROMPT) + 16) +#define CONFIG_SYS_MAXARGS 16 /* max number of command args */ +/* Boot Argument Buffer Size */ +#define CONFIG_SYS_BARGSIZE (CONFIG_SYS_CBSIZE) + +#define CONFIG_SYS_MEMTEST_START (OMAP34XX_SDRC_CS0) /* memtest */ + /* works on */ +#define CONFIG_SYS_MEMTEST_END (OMAP34XX_SDRC_CS0 + \ + 0x01F00000) /* 31MB */ + +#define CONFIG_SYS_LOAD_ADDR (OMAP34XX_SDRC_CS0) /* default */ + /* load address */ + +/* + * OMAP3 has 12 GP timers, they can be driven by the system clock + * (12/13/16.8/19.2/38.4MHz) or by 32KHz clock. We use 13MHz (V_SCLK). + * This rate is divided by a local divisor. + */ +#define CONFIG_SYS_TIMERBASE (OMAP34XX_GPT2) +#define CONFIG_SYS_PTV 2 /* Divisor: 2^(PTV+1) => 8 */ +#define CONFIG_SYS_HZ 1000 + +/*----------------------------------------------------------------------- + * Stack sizes + * + * The stack sizes are set up in start.S using the settings below + */ +#define CONFIG_STACKSIZE (128 << 10) /* regular stack 128 KiB */ +#ifdef CONFIG_USE_IRQ +#define CONFIG_STACKSIZE_IRQ (4 << 10) /* IRQ stack 4 KiB */ +#define CONFIG_STACKSIZE_FIQ (4 << 10) /* FIQ stack 4 KiB */ +#endif + +/*----------------------------------------------------------------------- + * Physical Memory Map + */ +#define CONFIG_NR_DRAM_BANKS 2 /* CS1 may or may not be populated */ +#define PHYS_SDRAM_1 OMAP34XX_SDRC_CS0 +#define PHYS_SDRAM_1_SIZE (32 << 20) /* at least 32 MiB */ +#define PHYS_SDRAM_2 OMAP34XX_SDRC_CS1 + +/* SDRAM Bank Allocation method */ +#define SDRC_R_B_C 1 + +/*----------------------------------------------------------------------- + * FLASH and environment organization + */ + +/* **** PISMO SUPPORT *** */ + +/* Configure the PISMO */ +#define PISMO1_NAND_SIZE GPMC_SIZE_128M +#define PISMO1_ONEN_SIZE GPMC_SIZE_128M + +#define CONFIG_SYS_MAX_FLASH_SECT 520 /* max number of sectors on */ + /* one chip */ +#define CONFIG_SYS_MAX_FLASH_BANKS 2 /* max number of flash banks */ +#define CONFIG_SYS_MONITOR_LEN (256 << 10) /* Reserve 2 sectors */ + +#define CONFIG_SYS_FLASH_BASE boot_flash_base + +/* Monitor at start of flash */ +#define CONFIG_SYS_MONITOR_BASE CONFIG_SYS_FLASH_BASE +#define CONFIG_SYS_ONENAND_BASE ONENAND_MAP + +#define CONFIG_ENV_IS_IN_ONENAND 1 +#define ONENAND_ENV_OFFSET 0x260000 /* environment starts here */ +#define SMNAND_ENV_OFFSET 0x260000 /* environment starts here */ + +#define CONFIG_SYS_ENV_SECT_SIZE boot_flash_sec +#define CONFIG_ENV_OFFSET boot_flash_off +#define CONFIG_ENV_ADDR SMNAND_ENV_OFFSET + +/*----------------------------------------------------------------------- + * CFI FLASH driver setup + */ +/* timeout values are in ticks */ +#define CONFIG_SYS_FLASH_ERASE_TOUT (100 * CONFIG_SYS_HZ) +#define CONFIG_SYS_FLASH_WRITE_TOUT (100 * CONFIG_SYS_HZ) + +/* Flash banks JFFS2 should use */ +#define CONFIG_SYS_MAX_MTD_BANKS (CONFIG_SYS_MAX_FLASH_BANKS + \ + CONFIG_SYS_MAX_NAND_DEVICE) +#define CONFIG_SYS_JFFS2_MEM_NAND +/* use flash_info[2] */ +#define CONFIG_SYS_JFFS2_FIRST_BANK CONFIG_SYS_MAX_FLASH_BANKS +#define CONFIG_SYS_JFFS2_NUM_BANKS 1 + +#ifndef __ASSEMBLY__ +extern unsigned int boot_flash_base; +extern volatile unsigned int boot_flash_env_addr; +extern unsigned int boot_flash_off; +extern unsigned int boot_flash_sec; +extern unsigned int boot_flash_type; +#endif + +#endif /* __CONFIG_H */

On Thursday, September 01, 2011 07:34:29 Pali Rohár wrote:
--- /dev/null +++ b/board/nokia/rx51/Makefile
+LIB = $(obj)lib$(BOARD).a +$(LIB): $(obj).depend $(OBJS)
- $(AR) $(ARFLAGS) $@ $(OBJS)
your makefiles are old. the LIB is supposed to be a .o not .a now, and you need to call the link command rather than use $(AR). look at board/bf537- stamp/Makefile as a simple example.
--- /dev/null +++ b/board/nokia/rx51/config.mk
+TEXT_BASE = 0x80e80000
pretty sure this is old and you should use a CONFIG_xxx in your board config header. then you can delete this config.mk file.
--- /dev/null +++ b/board/nokia/rx51/rx51.c
+GraphicDevice gdev;
no camel case
+char keymap[] = {
- /* normal */
- 'q', 'o', 'p', ',', '\b', 0, 'a', 's',
- 'w', 'd', 'f', 'g', 'h', 'j', 'k', 'l',
- 'e', '.', 0, '\r', 0, 'z', 'x', 'c',
- 'r', 'v', 'b', 'n', 'm', ' ', 0, 0,
- 't', 0, 0, 0, 0, 0, 0, 0,
- 'y', 0, 0, 0, 0, 0, 0, 0,
- 'u', 0, 0, 0, 0, 0, 0, 0,
- 'i', 0, 0, 0, 0, 0, 0, 0,
- /* fn */
- '1', '9', '0', '=', '\b', 0, '*', '+',
- '2', '#', '-', '_', '(', ')', '&', '!',
- '3', '?', 0, '\r', 0, 0, '$', 0,
- '4', '/', '\', '"', ''', '@', 0, 0,
- '5', 0, 0, 0, 0, 0, 0, 0,
- '6', 0, 0, 0, 0, 0, 0, 0,
- '7', 0, 0, 0, 0, 0, 0, 0,
- '8', 0, 0, 0, 0, 0, 0, 0,
+};
+u8 keys[8]; +u8 old_keys[8] = {0, 0, 0, 0, 0, 0, 0, 0}; +#define KEYBUF_SIZE 4 +u8 keybuf[KEYBUF_SIZE]; +u8 keybuf_head = 0, keybuf_tail = 0;
these probably all should be static. and "keymap[]" should probably also be const.
--- /dev/null +++ b/board/nokia/rx51/rx51.h
+const omap3_sysinfo sysinfo = {
you should not be defining variable storage in header files
+/*
- IEN - Input Enable
- IDIS - Input Disable
- PTD - Pull type Down
- PTU - Pull type Up
- DIS - Pull type selection is inactive
- EN - Pull type selection is active
- M0 - Mode 0
- The commented string gives the final mux configuration for that pin
- */
this looks like SoC info and not board specific. should this be in an SoC header somewhere instead ? -mike

On Thursday 01 September 2011 09:57:13 you wrote:
On Thursday, September 01, 2011 07:34:29 Pali Rohár wrote:
--- /dev/null +++ b/board/nokia/rx51/Makefile
+LIB = $(obj)lib$(BOARD).a +$(LIB): $(obj).depend $(OBJS)
- $(AR) $(ARFLAGS) $@ $(OBJS)
your makefiles are old. the LIB is supposed to be a .o not .a now, and you need to call the link command rather than use $(AR). look at board/bf537- stamp/Makefile as a simple example.
ok, now I have updated makefile
--- /dev/null +++ b/board/nokia/rx51/config.mk
+TEXT_BASE = 0x80e80000
pretty sure this is old and you should use a CONFIG_xxx in your board config header. then you can delete this config.mk file.
deleted
--- /dev/null +++ b/board/nokia/rx51/rx51.c
+GraphicDevice gdev;
no camel case
GraphicDevice is defined in include/video_fb.h
+char keymap[] = {
- /* normal */
- 'q', 'o', 'p', ',', '\b', 0, 'a', 's',
- 'w', 'd', 'f', 'g', 'h', 'j', 'k', 'l',
- 'e', '.', 0, '\r', 0, 'z', 'x', 'c',
- 'r', 'v', 'b', 'n', 'm', ' ', 0, 0,
- 't', 0, 0, 0, 0, 0, 0, 0,
- 'y', 0, 0, 0, 0, 0, 0, 0,
- 'u', 0, 0, 0, 0, 0, 0, 0,
- 'i', 0, 0, 0, 0, 0, 0, 0,
- /* fn */
- '1', '9', '0', '=', '\b', 0, '*', '+',
- '2', '#', '-', '_', '(', ')', '&', '!',
- '3', '?', 0, '\r', 0, 0, '$', 0,
- '4', '/', '\', '"', ''', '@', 0, 0,
- '5', 0, 0, 0, 0, 0, 0, 0,
- '6', 0, 0, 0, 0, 0, 0, 0,
- '7', 0, 0, 0, 0, 0, 0, 0,
- '8', 0, 0, 0, 0, 0, 0, 0,
+};
+u8 keys[8]; +u8 old_keys[8] = {0, 0, 0, 0, 0, 0, 0, 0}; +#define KEYBUF_SIZE 4 +u8 keybuf[KEYBUF_SIZE]; +u8 keybuf_head = 0, keybuf_tail = 0;
these probably all should be static. and "keymap[]" should probably also be const.
done
--- /dev/null +++ b/board/nokia/rx51/rx51.h
+const omap3_sysinfo sysinfo = {
you should not be defining variable storage in header files
this code was derivated from board/ti/beagle/beagle.h and beagle.h still has this code
+/*
- IEN - Input Enable
- IDIS - Input Disable
- PTD - Pull type Down
- PTU - Pull type Up
- DIS - Pull type selection is inactive
- EN - Pull type selection is active
- M0 - Mode 0
- The commented string gives the final mux configuration for that pin
- */
this looks like SoC info and not board specific. should this be in an SoC header somewhere instead ?
all boards in board/ti/ has this code
-mike

On Saturday 08 October 2011 20:20:47 Pali Rohár wrote:
On Thursday 01 September 2011 09:57:13 you wrote:
On Thursday, September 01, 2011 07:34:29 Pali Rohár wrote:
--- /dev/null +++ b/board/nokia/rx51/rx51.c
+GraphicDevice gdev;
no camel case
GraphicDevice is defined in include/video_fb.h
ok, nothing you can do about that
--- /dev/null +++ b/board/nokia/rx51/rx51.h
+const omap3_sysinfo sysinfo = {
you should not be defining variable storage in header files
this code was derivated from board/ti/beagle/beagle.h and beagle.h still has this code
beagle.h is broken too. please don't copy their brokenness :).
+/*
- IEN - Input Enable
- IDIS - Input Disable
- PTD - Pull type Down
- PTU - Pull type Up
- DIS - Pull type selection is inactive
- EN - Pull type selection is active
- M0 - Mode 0
- The commented string gives the final mux configuration for that pin
- */
this looks like SoC info and not board specific. should this be in an SoC header somewhere instead ?
all boards in board/ti/ has this code
dumb behavior shouldn't be encouraged :). that indicates even more strongly that this should be in a SoC header somewhere. -mike

On Sunday 09 October 2011 11:59:29 Mike Frysinger wrote:
On Saturday 08 October 2011 20:20:47 Pali Rohár wrote:
On Thursday 01 September 2011 09:57:13 you wrote:
On Thursday, September 01, 2011 07:34:29 Pali Rohár wrote:
--- /dev/null +++ b/board/nokia/rx51/rx51.c
+GraphicDevice gdev;
no camel case
GraphicDevice is defined in include/video_fb.h
ok, nothing you can do about that
--- /dev/null +++ b/board/nokia/rx51/rx51.h
+const omap3_sysinfo sysinfo = {
you should not be defining variable storage in header files
this code was derivated from board/ti/beagle/beagle.h and beagle.h still has this code
beagle.h is broken too. please don't copy their brokenness :).
Ok, this RX-51 code I mode into rx51.c (I hope it will be ok)
+/*
- IEN - Input Enable
- IDIS - Input Disable
- PTD - Pull type Down
- PTU - Pull type Up
- DIS - Pull type selection is inactive
- EN - Pull type selection is active
- M0 - Mode 0
- The commented string gives the final mux configuration for
that pin + */
this looks like SoC info and not board specific. should this be in an SoC header somewhere instead ?
all boards in board/ti/ has this code
dumb behavior shouldn't be encouraged :). that indicates even more strongly that this should be in a SoC header somewhere. -mike
definitions of MUX are in arch/arm/include/asm/arch/mux.h and in rx51.h is used these defines. Info in rx51.h is RX-51 specified, other ti boards have similar but different code.

From: Matan Ziv-Av matan@svgalib.org
--- board/nokia/rx51/rx51.c | 7 +++++++ include/configs/nokia_rx51.h | 1 + 2 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/board/nokia/rx51/rx51.c b/board/nokia/rx51/rx51.c index 3149a79..347d08a 100644 --- a/board/nokia/rx51/rx51.c +++ b/board/nokia/rx51/rx51.c @@ -104,6 +104,13 @@ int misc_init_r(void) setenv("nolo_atagaddr", buf); #endif
+ // set environment variable slide_sw + // if keyboard slide is open/close + omap_set_gpio_direction(71, 1); + unsigned val = omap_get_gpio_datain(71); + omap_free_gpio(71); + setenv("slide_sw", val ? "close" : "open"); + dieid_num_r();
return 0; diff --git a/include/configs/nokia_rx51.h b/include/configs/nokia_rx51.h index 45b942a..5c3b068 100644 --- a/include/configs/nokia_rx51.h +++ b/include/configs/nokia_rx51.h @@ -200,6 +200,7 @@ int rx51_kp_getc(void); "bootm ${nolo_kernaddr}\0"
#define CONFIG_PREBOOT \ + "if test $slide_sw != open ; then run noloboot; fi ;" \ "echo Extra commands:;" \ "echo run sercon - Use serial port for control.;" \ "echo run usbcon - Use usbtty for control.;" \

On Thursday, September 01, 2011 07:34:30 Pali Rohár wrote:
board/nokia/rx51/rx51.c | 7 +++++++ include/configs/nokia_rx51.h | 1 +
this is a new board port. why not squash all your fixes into one instead of sending out an incomplete/buggy board port which needs patches to fixup ? -mike

On Thursday 01 September 2011 09:58:06 you wrote:
On Thursday, September 01, 2011 07:34:30 Pali Rohár wrote:
board/nokia/rx51/rx51.c | 7 +++++++ include/configs/nokia_rx51.h | 1 +
this is a new board port. why not squash all your fixes into one instead of sending out an incomplete/buggy board port which needs patches to fixup ?
I wrote that my patch series was not complete and not correct. In next (complete) series I will mix board files into one patch.
-mike

On Saturday 08 October 2011 19:29:27 Pali Rohár wrote:
On Thursday 01 September 2011 09:58:06 you wrote:
On Thursday, September 01, 2011 07:34:30 Pali Rohár wrote:
board/nokia/rx51/rx51.c | 7 +++++++ include/configs/nokia_rx51.h | 1 +
this is a new board port. why not squash all your fixes into one instead of sending out an incomplete/buggy board port which needs patches to fixup ?
I wrote that my patch series was not complete and not correct. In next (complete) series I will mix board files into one patch.
OK
please keep replies on the list and don't seen them to specific people -mike

From: Matan Ziv-Av matan@svgalib.org
--- board/nokia/rx51/rx51.h | 20 ++++++++++---------- 1 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/board/nokia/rx51/rx51.h b/board/nokia/rx51/rx51.h index 625129c..cb58053 100644 --- a/board/nokia/rx51/rx51.h +++ b/board/nokia/rx51/rx51.h @@ -199,16 +199,16 @@ const omap3_sysinfo sysinfo = { MUX_VAL(CP(MMC1_DAT6), (IEN | PTU | EN | M0)) /*MMC1_DAT6*/\ MUX_VAL(CP(MMC1_DAT7), (IEN | PTU | EN | M0)) /*MMC1_DAT7*/\ /*Wireless LAN */\ - MUX_VAL(CP(MMC2_CLK), (IEN | PTU | EN | M4)) /*GPIO_130*/\ - MUX_VAL(CP(MMC2_CMD), (IEN | PTU | EN | M4)) /*GPIO_131*/\ - MUX_VAL(CP(MMC2_DAT0), (IEN | PTU | EN | M4)) /*GPIO_132*/\ - MUX_VAL(CP(MMC2_DAT1), (IEN | PTU | EN | M4)) /*GPIO_133*/\ - MUX_VAL(CP(MMC2_DAT2), (IEN | PTU | EN | M4)) /*GPIO_134*/\ - MUX_VAL(CP(MMC2_DAT3), (IEN | PTU | EN | M4)) /*GPIO_135*/\ - MUX_VAL(CP(MMC2_DAT4), (IEN | PTU | EN | M4)) /*GPIO_136*/\ - MUX_VAL(CP(MMC2_DAT5), (IEN | PTU | EN | M4)) /*GPIO_137*/\ - MUX_VAL(CP(MMC2_DAT6), (IEN | PTU | EN | M4)) /*GPIO_138*/\ - MUX_VAL(CP(MMC2_DAT7), (IEN | PTU | EN | M4)) /*GPIO_139*/\ + MUX_VAL(CP(MMC2_CLK), (IEN | PTU | EN | M0)) /*GPIO_130*/\ + MUX_VAL(CP(MMC2_CMD), (IEN | PTU | EN | M0)) /*GPIO_131*/\ + MUX_VAL(CP(MMC2_DAT0), (IEN | PTU | EN | M0)) /*GPIO_132*/\ + MUX_VAL(CP(MMC2_DAT1), (IEN | PTU | EN | M0)) /*GPIO_133*/\ + MUX_VAL(CP(MMC2_DAT2), (IEN | PTU | EN | M0)) /*GPIO_134*/\ + MUX_VAL(CP(MMC2_DAT3), (IEN | PTU | EN | M0)) /*GPIO_135*/\ + MUX_VAL(CP(MMC2_DAT4), (IEN | PTU | EN | M0)) /*GPIO_136*/\ + MUX_VAL(CP(MMC2_DAT5), (IEN | PTU | EN | M0)) /*GPIO_137*/\ + MUX_VAL(CP(MMC2_DAT6), (IEN | PTU | EN | M0)) /*GPIO_138*/\ + MUX_VAL(CP(MMC2_DAT7), (IEN | PTU | EN | M0)) /*GPIO_139*/\ /*Bluetooth*/\ MUX_VAL(CP(MCBSP3_DX), (IEN | PTD | DIS | M1)) /*UART2_CTS*/\ MUX_VAL(CP(MCBSP3_DR), (IDIS | PTD | DIS | M1)) /*UART2_RTS*/\

From: Matan Ziv-Av matan@svgalib.org
--- include/configs/nokia_rx51.h | 24 ++++++++++++++++++------ 1 files changed, 18 insertions(+), 6 deletions(-)
diff --git a/include/configs/nokia_rx51.h b/include/configs/nokia_rx51.h index 5c3b068..bc4bd0b 100644 --- a/include/configs/nokia_rx51.h +++ b/include/configs/nokia_rx51.h @@ -188,16 +188,22 @@ int rx51_kp_getc(void); "vgacon=setenv con vga; run setcon\0" \ "loadaddr=0x82000000\0" \ "meegoargs=setenv bootargs\0" \ - "loadbootscript=fatload mmc 0 ${loadaddr} boot.scr\0" \ + "loadbootscript=fatload mmc 0:3 ${loadaddr} boot.scr\0" \ + "loadibootscript=fatload mmc 2:1 ${loadaddr} boot.scr\0" \ "bootscript=echo Running bootscript from mmc ...; " \ "source ${loadaddr}\0" \ "loaduimage=fatload mmc 0:3 ${loadaddr} uImage\0" \ + "loadiuimage=fatload mmc 2:1 ${loadaddr} uImage\0" \ "mmcboot=echo Booting from mmc ...; " \ "run meegoargs; " \ "bootm ${loadaddr}\0" \ "noloboot=echo Booting NOLO supplied kernel ...; " \ "setenv atags ${nolo_atagaddr};" \ - "bootm ${nolo_kernaddr}\0" + "bootm ${nolo_kernaddr}\0" \ + "mmciboot=echo Booting from internal mmc ...; " \ + "fatload mmc 2:1 ${loadaddr} uImage;" \ + "run meegoargs; " \ + "bootm ${loadaddr}\0"
#define CONFIG_PREBOOT \ "if test $slide_sw != open ; then run noloboot; fi ;" \ @@ -210,12 +216,18 @@ int rx51_kp_getc(void);
#define CONFIG_BOOTCOMMAND \ "if mmc init; then " \ - "if run loadbootscript; then " \ + "if run loadibootscript; then " \ + "echo Found boot.scr on mmc 2:1; " \ "run bootscript; " \ "else " \ - "if run loaduimage; then " \ - "run mmcboot; " \ - "else run noloboot; " \ + "if run loadbootscript; then " \ + "echo Found boot.scr on mmc 0:3; " \ + "run bootscript; " \ + "else " \ + "if run loaduimage; then " \ + "run mmcboot; " \ + "else run noloboot; " \ + "fi; " \ "fi; " \ "fi; " \ "else run noloboot; fi"

--- board/nokia/rx51/Makefile | 7 ++++--- board/nokia/rx51/config.mk | 2 +- board/nokia/rx51/rx51.c | 2 +- include/configs/nokia_rx51.h | 7 +++++++ 4 files changed, 13 insertions(+), 5 deletions(-)
diff --git a/board/nokia/rx51/Makefile b/board/nokia/rx51/Makefile index 31ad6fd..92a0c9a 100644 --- a/board/nokia/rx51/Makefile +++ b/board/nokia/rx51/Makefile @@ -23,15 +23,16 @@
include $(TOPDIR)/config.mk
-LIB = $(obj)lib$(BOARD).a +LIB = $(obj)lib$(BOARD).o
-COBJS := rx51.o +COBJS-y := $(BOARD).o
+COBJS := $(sort $(COBJS-y)) SRCS := $(COBJS:.o=.c) OBJS := $(addprefix $(obj),$(COBJS))
$(LIB): $(obj).depend $(OBJS) - $(AR) $(ARFLAGS) $@ $(OBJS) + $(call cmd_link_o_target, $(OBJS))
clean: rm -f $(OBJS) diff --git a/board/nokia/rx51/config.mk b/board/nokia/rx51/config.mk index 6c81a34..3477f09 100644 --- a/board/nokia/rx51/config.mk +++ b/board/nokia/rx51/config.mk @@ -30,4 +30,4 @@ # (mem base + reserved)
# For use with external or internal boots. -TEXT_BASE = 0x80e80000 +CONFIG_SYS_TEXT_BASE = 0x80008000 diff --git a/board/nokia/rx51/rx51.c b/board/nokia/rx51/rx51.c index 347d08a..96e65d6 100644 --- a/board/nokia/rx51/rx51.c +++ b/board/nokia/rx51/rx51.c @@ -38,7 +38,7 @@ #include <asm/io.h> #include <asm/arch/mux.h> #include <asm/arch/sys_proto.h> -#include <asm/arch/gpio.h> +#include <asm/omap_gpio.h> #include <asm/mach-types.h> #include "rx51.h"
diff --git a/include/configs/nokia_rx51.h b/include/configs/nokia_rx51.h index bc4bd0b..6da56f5 100644 --- a/include/configs/nokia_rx51.h +++ b/include/configs/nokia_rx51.h @@ -316,6 +316,13 @@ int rx51_kp_getc(void); #define CONFIG_ENV_OFFSET boot_flash_off #define CONFIG_ENV_ADDR SMNAND_ENV_OFFSET
+#define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM_1 +#define CONFIG_SYS_INIT_RAM_ADDR 0x4020f800 +#define CONFIG_SYS_INIT_RAM_SIZE 0x800 +#define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SYS_INIT_RAM_ADDR + \ + CONFIG_SYS_INIT_RAM_SIZE - \ + GENERATED_GBL_DATA_SIZE) + /*----------------------------------------------------------------------- * CFI FLASH driver setup */

* use test_and_set_bit and __clear_bit to access twl4030 i2c bus only once at same time * do not reset watchdog too often (max every 2 seconds) --- board/nokia/rx51/rx51.c | 25 +++++++++++++++++++++++-- include/configs/nokia_rx51.h | 1 + 2 files changed, 24 insertions(+), 2 deletions(-)
diff --git a/board/nokia/rx51/rx51.c b/board/nokia/rx51/rx51.c index 96e65d6..a90e4dd 100644 --- a/board/nokia/rx51/rx51.c +++ b/board/nokia/rx51/rx51.c @@ -36,6 +36,7 @@ #include <i2c.h> #include <video_fb.h> #include <asm/io.h> +#include <asm/bitops.h> #include <asm/arch/mux.h> #include <asm/arch/sys_proto.h> #include <asm/omap_gpio.h> @@ -192,6 +193,23 @@ int rx51_kp_init(void) return ret; }
+static unsigned long int twl_wd_start = 0; +static volatile unsigned long int twl_chip_lock; + +void hw_watchdog_reset(void) +{ + + if ( get_timer(twl_wd_start) < 2 * CONFIG_SYS_HZ ) + return; + + if ( test_and_set_bit(0, &twl_chip_lock) ) + return; + twl4030_i2c_write_u8(TWL4030_CHIP_PM_RECEIVER, 31, TWL4030_PM_RECEIVER_WATCHDOG_CFG); + __clear_bit(0, &twl_chip_lock); + + twl_wd_start = get_timer(0); +} + char rx51_kp_fill(u8 k, u8 mods) { if (mods & 2) { /* fn */ @@ -217,6 +235,9 @@ int rx51_kp_tstc(void) u8 intr; u8 mods;
+ if ( test_and_set_bit(0, &twl_chip_lock) ) + return 0; + /* twl4030 remembers up to 2 events */ for (i = 0; i < 2; i++) {
@@ -249,6 +270,7 @@ int rx51_kp_tstc(void) } } } + __clear_bit(0, &twl_chip_lock); return (KEYBUF_SIZE + keybuf_tail - keybuf_head)%KEYBUF_SIZE; }
@@ -256,7 +278,6 @@ int rx51_kp_getc(void) { keybuf_head %= KEYBUF_SIZE; while (!rx51_kp_tstc()) - ; + udelay(10000); return keybuf[keybuf_head++]; } - diff --git a/include/configs/nokia_rx51.h b/include/configs/nokia_rx51.h index 6da56f5..6d93146 100644 --- a/include/configs/nokia_rx51.h +++ b/include/configs/nokia_rx51.h @@ -144,6 +144,7 @@ #define CONFIG_SYS_I2C_BUS 0 #define CONFIG_SYS_I2C_BUS_SELECT 1 #define CONFIG_DRIVER_OMAP34XX_I2C 1 +#define CONFIG_HW_WATCHDOG
/* * TWL4030

* make functions and variables static * add support for additional key combination with ctrl and fn * add support for keys: up, down, left, right, volume_up, volume_down --- board/nokia/rx51/rx51.c | 34 +++++++++++++++++++--------------- 1 files changed, 19 insertions(+), 15 deletions(-)
diff --git a/board/nokia/rx51/rx51.c b/board/nokia/rx51/rx51.c index a90e4dd..01187de 100644 --- a/board/nokia/rx51/rx51.c +++ b/board/nokia/rx51/rx51.c @@ -132,32 +132,32 @@ void set_muxconf_regs(void) * TWL4030 keypad handler for cfb_console */
-char keymap[] = { +static char keymap[] = { /* normal */ 'q', 'o', 'p', ',', '\b', 0, 'a', 's', 'w', 'd', 'f', 'g', 'h', 'j', 'k', 'l', - 'e', '.', 0, '\r', 0, 'z', 'x', 'c', - 'r', 'v', 'b', 'n', 'm', ' ', 0, 0, - 't', 0, 0, 0, 0, 0, 0, 0, + 'e', '.', 24, '\r', 0, 'z', 'x', 'c', + 'r', 'v', 'b', 'n', 'm', ' ', ' ', 27, + 't', 25, 26, 0, 0, 0, 0, 0, 'y', 0, 0, 0, 0, 0, 0, 0, 'u', 0, 0, 0, 0, 0, 0, 0, - 'i', 0, 0, 0, 0, 0, 0, 0, + 'i', 5, 6, 0, 0, 0, 0, 0, /* fn */ '1', '9', '0', '=', '\b', 0, '*', '+', '2', '#', '-', '_', '(', ')', '&', '!', - '3', '?', 0, '\r', 0, 0, '$', 0, - '4', '/', '\', '"', ''', '@', 0, 0, - '5', 0, 0, 0, 0, 0, 0, 0, + '3', '?', '^', '\r', 0, 156, '$', 238, + '4', '/', '\', '"', ''', '@', 0, '<', + '5', '|', '>', 0, 0, 0, 0, 0, '6', 0, 0, 0, 0, 0, 0, 0, '7', 0, 0, 0, 0, 0, 0, 0, - '8', 0, 0, 0, 0, 0, 0, 0, + '8', 16, 17, 0, 0, 0, 0, 0, };
-u8 keys[8]; -u8 old_keys[8] = {0, 0, 0, 0, 0, 0, 0, 0}; +static u8 keys[8]; +static u8 old_keys[8] = {0, 0, 0, 0, 0, 0, 0, 0}; #define KEYBUF_SIZE 4 -u8 keybuf[KEYBUF_SIZE]; -u8 keybuf_head = 0, keybuf_tail = 0; +static u8 keybuf[KEYBUF_SIZE]; +static u8 keybuf_head = 0, keybuf_tail = 0;
int rx51_kp_init(void) { @@ -210,12 +210,16 @@ void hw_watchdog_reset(void) twl_wd_start = get_timer(0); }
-char rx51_kp_fill(u8 k, u8 mods) +static void rx51_kp_fill(u8 k, u8 mods) { if (mods & 2) { /* fn */ k = keymap[k+64]; } else { k = keymap[k]; + if (mods & 1) { /* ctrl */ + if (k >= 'a' && k <= 'z') + k -= 'a' + 1; + } if (mods & 4) { /* shift */ if (k >= 'a' && k <= 'z') k += 'A' - 'a'; @@ -231,7 +235,7 @@ char rx51_kp_fill(u8 k, u8 mods)
int rx51_kp_tstc(void) { - u8 c, r, dk, k, i; + u8 c, r, dk, i; u8 intr; u8 mods;

--- include/common.h | 32 ++++++++++++++++++++++++++++++++ 1 files changed, 32 insertions(+), 0 deletions(-)
diff --git a/include/common.h b/include/common.h index 12a1074..0627384 100644 --- a/include/common.h +++ b/include/common.h @@ -680,6 +680,38 @@ void clear_ctrlc (void); /* clear the Control-C condition */ int disable_ctrlc (int); /* 1 to disable, 0 to enable Control-C detect */
/* + * ANSI terminal + */ + +#define ANSI_CURSOR_UP "\e[%dA" +#define ANSI_CURSOR_DOWN "\e[%dB" +#define ANSI_CURSOR_FORWARD "\e[%dC" +#define ANSI_CURSOR_BACK "\e[%dD" +#define ANSI_CURSOR_NEXTLINE "\e[%dE" +#define ANSI_CURSOR_PREVIOUSLINE "\e[%dF" +#define ANSI_CURSOR_COLUMN "\e[%dG" +#define ANSI_CURSOR_POSITION "\e[%d;%dH" +#define ANSI_CLEAR_CONSOLE "\e[2J" +#define ANSI_CLEAR_LINE_TO_END "\e[0K" +#define ANSI_CLEAR_LINE "\e[2K" +#define ANSI_COLOR "\e[%dm" + +#define BLACK 0 +#define RED 1 +#define GREEN 2 +#define YELLOW 3 +#define BLUE 4 +#define MAGENTA 5 +#define CYAN 6 +#define WHITE 7 +#define DEFAULT 8 + +#define ANSI_COLOR_ATTR_RESET 0 +#define ANSI_COLOR_ATTR_REVERSE 7 +#define ANSI_COLOR_TEXT(c) (30+c) +#define ANSI_COLOR_BG(c) (40+c) + +/* * STDIO based functions (can always be used) */ /* serial stuff */

--- drivers/video/cfb_console.c | 387 ++++++++++++++++++++++++++++++++++++++++--- 1 files changed, 361 insertions(+), 26 deletions(-)
diff --git a/drivers/video/cfb_console.c b/drivers/video/cfb_console.c index 3a93b64..e16c76a 100644 --- a/drivers/video/cfb_console.c +++ b/drivers/video/cfb_console.c @@ -371,6 +371,10 @@ static int console_row; /* cursor row */
static u32 eorx, fgx, bgx; /* color pats */
+static char ansi_buf[10] = { 0, }; +static int ansi_buf_size = 0; +static int ansi_colors_need_revert = 0; + static const int video_font_draw_table8[] = { 0x00000000, 0x000000ff, 0x0000ff00, 0x0000ffff, 0x00ff0000, 0x00ff00ff, 0x00ffff00, 0x00ffffff, @@ -597,22 +601,34 @@ static void video_putchar(int xx, int yy, unsigned char c) video_drawchars(xx, yy + video_logo_height, &c, 1); }
-#if defined(CONFIG_CONSOLE_CURSOR) || defined(CONFIG_VIDEO_SW_CURSOR) -static void video_set_cursor(void) +static void console_swap_colors(void) { - /* swap drawing colors */ eorx = fgx; fgx = bgx; bgx = eorx; eorx = fgx ^ bgx; +} + +static void console_set_text_color(int c) +{ + // TODO +} + +static void console_set_background_color(int c) +{ + // TODO +} + +#if defined(CONFIG_CONSOLE_CURSOR) || defined(CONFIG_VIDEO_SW_CURSOR) +static void video_set_cursor(void) +{ + /* swap drawing colors */ + console_swap_colors(); /* draw cursor */ video_putchar(console_col * VIDEO_FONT_WIDTH, console_row * VIDEO_FONT_HEIGHT, ' '); /* restore drawing colors */ - eorx = fgx; - fgx = bgx; - bgx = eorx; - eorx = fgx ^ bgx; + console_swap_colors(); } #endif
@@ -672,6 +688,49 @@ static void memcpyl(int *d, int *s, int c) } #endif
+static void console_clear(void) +{ +#ifdef VIDEO_HW_RECTFILL + video_hw_rectfill(VIDEO_PIXEL_SIZE, /* bytes per pixel */ + 0, /* dest pos x */ + video_logo_height, /* dest pos y */ + VIDEO_VISIBLE_COLS, /* frame width */ + VIDEO_VISIBLE_ROWS, /* frame height */ + bgx /* fill color */ + ); +#else + memsetl(CONSOLE_ROW_FIRST, CONSOLE_SIZE, bgx); +#endif +} + +static void console_clear_line(int line, int begin, int end) +{ +#ifdef VIDEO_HW_RECTFILL + video_hw_rectfill(VIDEO_PIXEL_SIZE, /* bytes per pixel */ + VIDEO_FONT_WIDTH * begin, /* dest pos x */ /* FIXME: correct? */ + video_logo_height + CONSOLE_ROW_SIZE * line, /* dest pos y */ /* FIXME: correct? */ + VIDEO_FONT_WIDTH * ( end - begin ), /* frame width */ /* FIXME: correct? */ + VIDEO_FONT_HEIGHT, /* frame height */ + bgx /* fill color */ + ); +#else + int i; + if ( begin == 0 && end == CONSOLE_COLS ) + memsetl(CONSOLE_ROW_FIRST + CONSOLE_ROW_SIZE * line, /* offset of row */ + CONSOLE_ROW_SIZE >> 2, /* length of row */ + bgx /* fill color */ + ); + else + for ( i = 0; i < VIDEO_FONT_HEIGHT; ++i ) + memsetl(CONSOLE_ROW_FIRST + CONSOLE_ROW_SIZE * line + /* offset of row */ + VIDEO_FONT_WIDTH * VIDEO_PIXEL_SIZE * begin + /* offset of col */ + i * VIDEO_LINE_LEN, /* col offset of i-th line */ + VIDEO_FONT_WIDTH * ( end - begin ) / 2, /* length to end of line */ + bgx /* fill color */ + ); +#endif +} + static void console_scrollup(void) { /* copy up rows ignoring the first one */ @@ -694,18 +753,7 @@ static void console_scrollup(void) #endif
/* clear the last one */ -#ifdef VIDEO_HW_RECTFILL - video_hw_rectfill(VIDEO_PIXEL_SIZE, /* bytes per pixel */ - 0, /* dest pos x */ - VIDEO_VISIBLE_ROWS - - VIDEO_FONT_HEIGHT, /* dest pos y */ - VIDEO_VISIBLE_COLS, /* frame width */ - VIDEO_FONT_HEIGHT, /* frame height */ - CONSOLE_BG_COL /* fill color */ - ); -#else - memsetl(CONSOLE_ROW_LAST, CONSOLE_ROW_SIZE >> 2, CONSOLE_BG_COL); -#endif + console_clear_line(CONSOLE_ROWS-1, 0, CONSOLE_COLS); }
static void console_back(void) @@ -723,7 +771,7 @@ static void console_back(void) console_row * VIDEO_FONT_HEIGHT, ' '); }
-static void console_newline(void) +static void console_cursor_check(void) { /* Check if last character in the line was just drawn. If so, cursor was overwriten and need not to be cleared. Cursor clearing without this @@ -732,7 +780,62 @@ static void console_newline(void) */ if (console_col < CONSOLE_COLS) CURSOR_OFF; - console_row++; +} + +static void console_cursor_fix(void) +{ + if (console_row <= 0) + console_row = 0; + if (console_row > CONSOLE_ROWS) + console_row = CONSOLE_ROWS-1; + if (console_col <= 0) + console_col = 0; + if (console_col > CONSOLE_COLS) + console_col = CONSOLE_COLS; +} + +static void console_cursor_up(int n) +{ + console_cursor_check(); + console_row -= n; + console_cursor_fix(); +} + +static void console_cursor_down(int n) +{ + console_cursor_check(); + console_row += n; + console_cursor_fix(); +} + +static void console_cursor_left(int n) +{ + console_cursor_check(); + console_col -= n; + console_cursor_fix(); +} + +static void console_cursor_right(int n) +{ + console_cursor_check(); + console_col += n; + console_cursor_fix(); +} + +static void console_cursor_set_position(int row, int col) +{ + console_cursor_check(); + if (console_row != -1) + console_row = row; + if (console_col != -1) + console_col = col; + console_cursor_fix(); +} + +static void console_newline(int n) +{ + console_cursor_check(); + console_row += n; console_col = 0;
/* Check if we need to scroll the terminal */ @@ -741,17 +844,25 @@ static void console_newline(void) console_scrollup();
/* Decrement row number */ - console_row--; + console_row = CONSOLE_ROWS-1; } }
+static void console_previewsline(int n) +{ + /* FIXME: also scroll terminal ? */ + console_cursor_check(); + console_row -= n; + console_cursor_fix(); +} + static void console_cr(void) { CURSOR_OFF; console_col = 0; }
-void video_putc(const char c) +static void parse_putc(const char c) { static int nl = 1;
@@ -762,7 +873,7 @@ void video_putc(const char c)
case '\n': /* next line */ if (console_col || (!console_col && nl)) - console_newline(); + console_newline(1); nl = 1; break;
@@ -772,7 +883,7 @@ void video_putc(const char c) console_col &= ~0x0007;
if (console_col >= CONSOLE_COLS) - console_newline(); + console_newline(1); break;
case 8: /* backspace */ @@ -786,13 +897,237 @@ void video_putc(const char c)
/* check for newline */ if (console_col >= CONSOLE_COLS) { - console_newline(); + console_newline(1); nl = 0; } } CURSOR_SET; }
+void video_putc(const char c) +{ + int i; + + if (c == 27) + { + for (i = 0; i < ansi_buf_size; ++i) + parse_putc(ansi_buf[i]); + ansi_buf[0] = 27; + ansi_buf_size = 1; + return; + } + + if (ansi_buf_size > 0) + { + // 0 - ESC + // 1 - [ + // 2 - num1 + // 3 - .. + // 4 - ; + // 5 - num2 + // 6 - .. + // 7 - cchar + int next = 0; + + int flush = 0; + int fail = 0; + + int num1 = 0; + int num2 = 0; + int cchar = 0; + + ansi_buf[ansi_buf_size++] = c; + + if (ansi_buf_size >= sizeof (ansi_buf)) + fail = 1; + + for (i = 0; i < ansi_buf_size; ++i) + { + if (fail) + break; + + switch (next) { + case 0: + if (ansi_buf[i] == 27) + next = 1; + else + fail = 1; + break; + + case 1: + if (ansi_buf[i] == '[') + next = 2; + else + fail = 1; + break; + + case 2: + if (ansi_buf[i] >= '0' && ansi_buf[i] <= '9') + { + num1 = ansi_buf[i]-'0'; + next = 3; + } + else + fail = 1; + break; + + case 3: + if (ansi_buf[i] >= '0' && ansi_buf[i] <= '9') + { + num1 *= 10; + num1 += ansi_buf[i]-'0'; + } + else + { + --i; + next = 4; + } + break; + + case 4: + if (ansi_buf[i] != ';') + { + --i; + next = 7; + } + else + next = 5; + break; + + case 5: + if (ansi_buf[i] >= '0' && ansi_buf[i] <= '9') + { + num2 = ansi_buf[i]-'0'; + next = 6; + } + else + fail = 1; + break; + + case 6: + if (ansi_buf[i] >= '0' && ansi_buf[i] <= '9') + { + num2 *= 10; + num2 += ansi_buf[i]-'0'; + } + else + { + --i; + next = 7; + } + break; + + case 7: + if ((ansi_buf[i] >= 'A' && ansi_buf[i] <= 'H') || ansi_buf[i] == 'J' || ansi_buf[i] == 'K' || ansi_buf[i] == 'm') + { + cchar = ansi_buf[i]; + flush = 1; + } + else + fail = 1; + break; + } + } + + if (fail) + { + for (i = 0; i < ansi_buf_size; ++i) + parse_putc(ansi_buf[i]); + ansi_buf_size = 0; + return; + } + + if (flush) + { + ansi_buf_size = 0; + switch (cchar) { + case 'A': + //move cursor num1 rows up + console_cursor_up(num1); + break; + case 'B': + //move cursor num1 rows down + console_cursor_down(num1); + break; + case 'C': + //move cursor num1 columns forward + console_cursor_right(num1); + break; + case 'D': + //move cursor num1 columns back + console_cursor_left(num1); + break; + case 'E': + //move cursor num1 rows up at begin of row + console_previewsline(num1); + break; + case 'F': + //move cursor num1 rows down at begin of row + console_newline(num1); + break; + case 'G': + //move cursor to column num1 + console_cursor_set_position(-1, num1-1); + break; + case 'H': + //move cursor to row num1, column num2 + console_cursor_set_position(num1-1, num2-1); + break; + case 'J': + //clear console and move cursor to 0, 0 + console_clear(); + console_cursor_set_position(0, 0); + break; + case 'K': + //clear line + if ( num1 == 0 ) + console_clear_line(console_row, console_col, CONSOLE_COLS-1); + else if ( num1 == 1 ) + console_clear_line(console_row, 0, console_col); + else + console_clear_line(console_row, 0, CONSOLE_COLS-1); + break; + case 'm': + if (num1 == 0) //reset swapped colors + { + if (ansi_colors_need_revert) + { + console_swap_colors(); + ansi_colors_need_revert = 0; + } + } + else if (num1 == 7) //swap colors (only once) + { + if (!ansi_colors_need_revert) + { + console_swap_colors(); + ansi_colors_need_revert = 1; + } + } + else if (num1 == 38) // set default text color + { + fgx = CONSOLE_FG_COL; + eorx = fgx ^ bgx; + } + else if (num1 == 48) // set default background color + { + bgx = CONSOLE_BG_COL; + eorx = fgx ^ bgx; + } + else if (num1 >= 30 && num1 <= 37) //set text color + console_set_text_color(num1-30); + else if (num1 >= 40 && num1 <= 37) //set background color + console_set_background_color(num1-40); + break; + } + } + } + else + { + parse_putc(c); + } +} + void video_puts(const char *s) { int count = strlen(s);

* Configuration is done via env variables bootmenu_delay and bootmenu_<num>:
bootmenu_delay=<delay> bootmenu_<num>="<title>: <commands>" (title and commands are separated by first char ':')
<delay> is delay in seconds of autobooting first entry <num> is boot menu entry, starting from zero <title> is text shown in boot screen <commands> are commands which will be executed when menu entry will be selected
* First argument of bootmenu command override bootmenu_delay env * If env bootmenu_delay or bootmenu argument is not specified, 10 seconds for delay will be used * If delay is 0, no entry will be show on screen, screen will not be cleared and first entry will be called * If delay is less then 0, no autoboot delay will be used * Boot Menu will stop finding next menu entry if last was not defined * Boot Menu always add menu entry "U-Boot console" at end of all entries
* Example using:
setenv bootmenu_0 "First: bootm 0x82000000" # Set first menu entry setenv bootmenu_1 "Second: bootm 0x83000000" # Set second menu entry setenv bootmenu_2 "Reset: reset" # Set third menu entry bootmenu 20 # Run bootmenu with autoboot delay 20s --- common/Makefile | 1 + common/cmd_bootmenu.c | 316 ++++++++++++++++++++++++++++++++++++++++++++++ include/config_cmd_all.h | 1 + 3 files changed, 318 insertions(+), 0 deletions(-) create mode 100644 common/cmd_bootmenu.c
diff --git a/common/Makefile b/common/Makefile index d662468..d51d577 100644 --- a/common/Makefile +++ b/common/Makefile @@ -68,6 +68,7 @@ COBJS-$(CONFIG_CMD_SOURCE) += cmd_source.o COBJS-$(CONFIG_CMD_BDI) += cmd_bdinfo.o COBJS-$(CONFIG_CMD_BEDBUG) += bedbug.o cmd_bedbug.o COBJS-$(CONFIG_CMD_BMP) += cmd_bmp.o +COBJS-$(CONFIG_CMD_BOOTMENU) += cmd_bootmenu.o COBJS-$(CONFIG_CMD_BOOTLDR) += cmd_bootldr.o COBJS-$(CONFIG_CMD_CACHE) += cmd_cache.o COBJS-$(CONFIG_CMD_CONSOLE) += cmd_console.o diff --git a/common/cmd_bootmenu.c b/common/cmd_bootmenu.c new file mode 100644 index 0000000..7f8e6a8 --- /dev/null +++ b/common/cmd_bootmenu.c @@ -0,0 +1,316 @@ +/* + * (C) Copyright 2011 Pali Rohár pali.rohar@gmail.com + * + * 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 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 + */ + +#include <common.h> +#include <command.h> +#include <watchdog.h> +#include <linux/string.h> + +#ifdef CONFIG_SYS_HUSH_PARSER +#include <hush.h> +#endif + +static char * get_option(int n) { + + char name[] = "bootmenu_\0\0"; + + if ( n < 0 || n > 99 ) + return NULL; + + sprintf(name+9, "%d", n); + + return getenv(name); + +} + +static char * get_end_of_title(char * str) { + + if ( ! str ) + return NULL; + + return strchr(str, ':'); + +} + +static int print_title(char * begin, char * end) { + + if ( ! begin || ! end || end < begin ) + return 1; + + while ( begin != end ) + putc(*(begin++)); + + return 0; + +} + +static int print_entry(int n, int reverse) { + + char * str = get_option(n); + char * end = get_end_of_title(str); + + if ( ! end ) + return 1; + + printf(ANSI_CURSOR_POSITION, n+4, 1); + + if ( reverse ) + printf(ANSI_COLOR, ANSI_COLOR_ATTR_REVERSE); + + printf(" "); + print_title(str, end); + printf(ANSI_CLEAR_LINE_TO_END); + + if ( reverse ) { + + putc('\n'); //HACK: this prevent to draw black cursor by cfb_console driver + printf(ANSI_COLOR, ANSI_COLOR_ATTR_RESET); + + } + + return 0; + +} + +static int print_menu(int active) { + + int n = 0; + + printf(ANSI_CURSOR_POSITION, 1, 1); + printf(ANSI_CLEAR_LINE); + printf(ANSI_CURSOR_POSITION, 2, 1); + printf(" *** U-Boot BOOT MENU ***"); + printf(ANSI_CLEAR_LINE_TO_END); + printf(ANSI_CURSOR_POSITION, 3, 1); + printf(ANSI_CLEAR_LINE); + + while ( 1 ) { + + int ret = print_entry(n, n == active ? 1 : 0); + + if ( ret == 1 ) + break; + + ++n; + + } + + printf(ANSI_CURSOR_POSITION, n+4, 1); + + if ( n == active ) + printf(ANSI_COLOR, ANSI_COLOR_ATTR_REVERSE); + + printf(" U-Boot console"); + printf(ANSI_CLEAR_LINE_TO_END); + + if ( n == active ) { + + putc('\n'); //HACK: this prevent to draw black cursor by cfb_console driver + printf(ANSI_COLOR, ANSI_COLOR_ATTR_RESET); + + } + + printf(ANSI_CURSOR_POSITION, n+5, 1); + printf(ANSI_CLEAR_LINE); + printf(ANSI_CURSOR_POSITION, n+6, 1); + printf(" Press UP/DOWN to move, ENTER to select"); + printf(ANSI_CLEAR_LINE_TO_END); + printf(ANSI_CURSOR_POSITION, n+7, 1); + printf(ANSI_CLEAR_LINE); + + return n; + +} + +int do_bootmenu(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { + + int active = 0; + int abort = 0; + int key = 0; + int count = 0; + int delay = 10; + int instant = 0; + char * delay_str = NULL; + + if ( argc >= 2 ) + delay_str = argv[1]; + + if ( ! delay_str ) + delay_str = getenv("bootmenu_delay"); + + if ( delay_str ) + delay = (int)simple_strtol(delay_str, NULL, 10); + + if ( delay == 0 ) { + + if ( get_end_of_title(get_option(0)) ) // prevent setting U-Boot console as first menu entry + count = 1; + + instant = 1; + + } + + if ( delay < 0 ) + abort = 1; + + if ( ! instant ) { + + printf(ANSI_CLEAR_CONSOLE); + printf(ANSI_CURSOR_POSITION, 1, 1); + + } + + while ( 1 ) { + + if ( abort || delay > 0 ) + count = print_menu(active); + + if ( ! abort ) { + + if ( delay > 0 ) + printf(" Hit any key to stop autoboot: %2d ", delay); + + while ( delay > 0 ) { + + int i; + + for ( i = 0; i < 100; ++i ) { + + if ( tstc() ) { + + abort = 1; + key = getc(); + break; + + } + + WATCHDOG_RESET(); + udelay(10000); + + } + + if ( abort ) + break; + + --delay; + printf("\b\b\b%2d ", delay); + + } + + if ( delay <= 0 ) + key = '\r'; + + } else { + + while ( ! tstc() ) { + + WATCHDOG_RESET(); + udelay(10000); + + } + + key = getc(); + + } + + if ( key == 24 ) { + + if ( active > 0 ) + --active; + + } else if ( key == 25 ) { + + if ( active < count ) + ++active; + + } else if ( key == '\r' ) { + + char * str; + char * end; + + putc('\n'); + + if ( ! instant ) { + + printf(ANSI_CLEAR_CONSOLE); + printf(ANSI_CURSOR_POSITION, 1, 1); + + } + + WATCHDOG_RESET(); + + if ( active == count ) { // Last entry is always U-Boot console + + printf("Starting U-Boot console\n\n"); + return 0; + + } + + str = get_option(active); + end = get_end_of_title(str); + + if ( ! end ) { + + printf("Invalid Boot Menu entry %d\nStarting U-Boot console\n\n", active); + return 0; + + } + + if ( ! end[1] ) { + + printf("Invalid Boot Menu entry %d: ", active); + print_title(str, end); + printf("\nStarting U-Boot console\n\n"); + return 0; + + } + + printf("Booting Boot Menu entry %d: ", active); + print_title(str, end); + printf(" ...\n\n"); + +# ifndef CONFIG_SYS_HUSH_PARSER + run_command(end+1, 0); +# else + parse_string_outer(end+1, FLAG_PARSE_SEMICOLON | FLAG_EXIT_FROM_LOOP); +# endif + + printf("\nFailed booting Boot Menu entry %d: ", active); + print_title(str, end); + printf("\nStarting U-Boot console\n\n"); + return 0; + + } + + } + + /* never happends */ + return 1; + +} + +U_BOOT_CMD( + bootmenu, 2, 1, do_bootmenu, + "ANSI terminal bootmenu", + "[delay]\n" + " - show ANSI terminal bootmenu with autoboot delay (default 10s)" +); diff --git a/include/config_cmd_all.h b/include/config_cmd_all.h index 9716f9c..360cc10 100644 --- a/include/config_cmd_all.h +++ b/include/config_cmd_all.h @@ -20,6 +20,7 @@ #define CONFIG_CMD_BEDBUG /* Include BedBug Debugger */ #define CONFIG_CMD_BMP /* BMP support */ #define CONFIG_CMD_BOOTD /* bootd */ +#define CONFIG_CMD_BOOTMENU /* ANSI terminal Boot Menu */ #define CONFIG_CMD_BSP /* Board Specific functions */ #define CONFIG_CMD_CACHE /* icache, dcache */ #define CONFIG_CMD_CDP /* Cisco Discovery Protocol */

NAK: someone has just posted menu support to the list. we dont want multiple implementations getting merged. -mike

On Thursday 01 September 2011 09:59:05 you wrote:
NAK: someone has just posted menu support to the list. we dont want multiple implementations getting merged.
ok, if my bootmenu is not for upstream I move bootmenu support (with rx51 board) into separate patch which can be applied on top of master.
-mike

* If defined CONFIG_MENU and CONFIG_MENUKEY to 0 run env "menu_cmd" if key any pressed * If defined CONFIG_MENU and other CONFIG_MENUKEY run env "menu_cmd" if key pressed is save as CONFIG_MENUKEY * If defined CONFIG_MENU and not CONFIG_MENUKEY run env "menu_cmd" always * If not defined CONFIG_MENU do nothing * CONFIG_MENUKEY working only if defined CONFIG_MENU and CONFIG_BOOTDELAY >= 0 --- common/main.c | 32 +++++++++++++++++++++----------- 1 files changed, 21 insertions(+), 11 deletions(-)
diff --git a/common/main.c b/common/main.c index 3324d9d..f28b250 100644 --- a/common/main.c +++ b/common/main.c @@ -81,6 +81,19 @@ int do_mdm_init = 0; extern void mdm_init(void); /* defined in board.c */ #endif
+#if defined (CONFIG_MENUKEY) && ! defined (CONFIG_MENU) && ( ! defined(CONFIG_BOOTDELAY) || CONFIG_BOOTDELAY < 0 ) +#error CONFIG_MENUKEY is defined, but not CONFIG_MENU and/or CONFIG_BOOTDELAY >= 0 +#error define CONFIG_MENU and CONFIG_BOOTDELAY too +#endif + +#ifdef CONFIG_MENU +# ifdef CONFIG_MENUKEY +static int menucmd = 0; +# else +static int menucmd = 1; +# endif +#endif + /*************************************************************************** * Watch for 'delay' seconds for autoboot stop or autoboot delay string. * returns: 0 - no key string, allow autoboot @@ -198,10 +211,6 @@ static inline int abortboot(int bootdelay)
# else /* !defined(CONFIG_AUTOBOOT_KEYED) */
-#ifdef CONFIG_MENUKEY -static int menukey = 0; -#endif - static inline int abortboot(int bootdelay) { int abort = 0; @@ -235,8 +244,9 @@ static inline int abortboot(int bootdelay) if (tstc()) { /* we got a key press */ abort = 1; /* don't auto boot */ bootdelay = 0; /* no more delay */ -# ifdef CONFIG_MENUKEY - menukey = getc(); +# if defined (CONFIG_MENU) && defined (CONFIG_MENUKEY) + if (CONFIG_MENUKEY == 0 || CONFIG_MENUKEY == getc()) + menucmd = 1; # else (void) getc(); /* consume input */ # endif @@ -264,6 +274,7 @@ static inline int abortboot(int bootdelay)
void main_loop (void) { + char *s; #ifndef CONFIG_SYS_HUSH_PARSER static char lastcommand[CONFIG_SYS_CBSIZE] = { 0, }; int len; @@ -272,7 +283,6 @@ void main_loop (void) #endif
#if defined(CONFIG_BOOTDELAY) && (CONFIG_BOOTDELAY >= 0) - char *s; int bootdelay; #endif #ifdef CONFIG_PREBOOT @@ -387,9 +397,10 @@ void main_loop (void) disable_ctrlc(prev); /* restore Control C checking */ # endif } +#endif /* CONFIG_BOOTDELAY */
-# ifdef CONFIG_MENUKEY - if (menukey == CONFIG_MENUKEY) { +#ifdef CONFIG_MENU + if (menucmd == 1) { s = getenv("menucmd"); if (s) { # ifndef CONFIG_SYS_HUSH_PARSER @@ -400,8 +411,7 @@ void main_loop (void) # endif } } -#endif /* CONFIG_MENUKEY */ -#endif /* CONFIG_BOOTDELAY */ +#endif
/* * Main Loop for Monitor Command Processing

* if defined run env "premonitor" before Main Loop for Monitor Command Processing --- common/env_common.c | 3 +++ common/main.c | 10 ++++++++++ 2 files changed, 13 insertions(+), 0 deletions(-)
diff --git a/common/env_common.c b/common/env_common.c index 19149b5..fe9e525 100644 --- a/common/env_common.c +++ b/common/env_common.c @@ -99,6 +99,9 @@ const uchar default_environment[] = { #ifdef CONFIG_PREBOOT "preboot=" CONFIG_PREBOOT "\0" #endif +#ifdef CONFIG_PREMONITOR + "premonitor=" CONFIG_PREMONITOR "\0" +#endif #ifdef CONFIG_ROOTPATH "rootpath=" MK_STR(CONFIG_ROOTPATH) "\0" #endif diff --git a/common/main.c b/common/main.c index f28b250..b1fb453 100644 --- a/common/main.c +++ b/common/main.c @@ -413,6 +413,16 @@ void main_loop (void) } #endif
+#ifdef CONFIG_PREMONITOR + if ((s = getenv ("premonitor")) != NULL) { +# ifndef CONFIG_SYS_HUSH_PARSER + run_command (s, 0); +# else + parse_string_outer(s, FLAG_PARSE_SEMICOLON | FLAG_EXIT_FROM_LOOP); +# endif + } +#endif /* CONFIG_PREMONITOR */ + /* * Main Loop for Monitor Command Processing */

--- include/configs/nokia_rx51.h | 54 +++++++++++++++++++++++++++++++----------- 1 files changed, 40 insertions(+), 14 deletions(-)
diff --git a/include/configs/nokia_rx51.h b/include/configs/nokia_rx51.h index 6d93146..1c599e2 100644 --- a/include/configs/nokia_rx51.h +++ b/include/configs/nokia_rx51.h @@ -130,6 +130,8 @@ #define CONFIG_CMD_MMC /* MMC support */ #define CONFIG_CMD_ONENAND /* NAND support */
+#define CONFIG_CMD_BOOTMENU /* ANSI terminal Boot Menu */ + #undef CONFIG_CMD_FLASH /* flinfo, erase, protect */ #undef CONFIG_CMD_FPGA /* FPGA configuration Support */ #undef CONFIG_CMD_IMI /* iminfo */ @@ -176,7 +178,7 @@ int rx51_kp_getc(void); #endif
/* Environment information */ -#define CONFIG_BOOTDELAY 3 +#define CONFIG_MENU
#define CONFIG_EXTRA_ENV_SETTINGS \ "usbtty=cdc_acm\0" \ @@ -191,29 +193,42 @@ int rx51_kp_getc(void); "meegoargs=setenv bootargs\0" \ "loadbootscript=fatload mmc 0:3 ${loadaddr} boot.scr\0" \ "loadibootscript=fatload mmc 2:1 ${loadaddr} boot.scr\0" \ - "bootscript=echo Running bootscript from mmc ...; " \ + "bootscript=echo Running bootscript ...; " \ "source ${loadaddr}\0" \ "loaduimage=fatload mmc 0:3 ${loadaddr} uImage\0" \ "loadiuimage=fatload mmc 2:1 ${loadaddr} uImage\0" \ - "mmcboot=echo Booting from mmc ...; " \ - "run meegoargs; " \ - "bootm ${loadaddr}\0" \ "noloboot=echo Booting NOLO supplied kernel ...; " \ "setenv atags ${nolo_atagaddr};" \ "bootm ${nolo_kernaddr}\0" \ - "mmciboot=echo Booting from internal mmc ...; " \ - "fatload mmc 2:1 ${loadaddr} uImage;" \ + "mmcboot=echo Booting from external SD card ...; " \ + "loaduimage; " \ "run meegoargs; " \ - "bootm ${loadaddr}\0" + "bootm ${loadaddr}\0" \ + "mmciboot=echo Booting from internal eMMC memory ...; " \ + "loadiuimage; " \ + "run meegoargs; " \ + "bootm ${loadaddr}\0" \ + "menucmd=bootmenu\0" \ + "bootmenu_0=Maemo 5 kernel (Internal flash): run noloboot\0" \ + "bootmenu_1=Boot script (Internal eMMC, partition 1): if run loadibootscript; then run bootscript; fi\0" \ + "bootmenu_2=Boot script (External SD card, partition 3): if run loadbootscript; then run bootscript; fi\0" \ + "bootmenu_3=uImage kernel (Internal eMMC, partition 1): run mmciboot\0" \ + "bootmenu_4=uImage kernel (External SD card, partition 3): run mmcboot\0" \ + "bootmenu_5=Follow U-Boot boot order: boot\0" \ + "bootmenu_delay=3\0"
#define CONFIG_PREBOOT \ - "if test $slide_sw != open ; then run noloboot; fi ;" \ + "if test $slide_sw != open; then setenv bootmenu_delay 0; fi" + +#define CONFIG_PREMONITOR \ "echo Extra commands:;" \ "echo run sercon - Use serial port for control.;" \ "echo run usbcon - Use usbtty for control.;" \ "echo run vgacon - Use framebuffer/keyboard.;" \ + "echo run noloboot - Boot kernel loaded by NOLO.;" \ + "echo run mmciboot - Boot from internal eMMC.;" \ "echo run mmcboot - Boot from SD card slot.;" \ - "echo run noloboot - Boot kernel loaded by NOLO." + "echo"
#define CONFIG_BOOTCOMMAND \ "if mmc init; then " \ @@ -225,13 +240,24 @@ int rx51_kp_getc(void); "echo Found boot.scr on mmc 0:3; " \ "run bootscript; " \ "else " \ - "if run loaduimage; then " \ - "run mmcboot; " \ - "else run noloboot; " \ + "if run loadiuimage; then " \ + "echo Found uImage on mmc 2:1; " \ + "run mmciboot; " \ + "else " \ + "if run loaduimage; then " \ + "echo Found uImage on mmc 0:3; " \ + "run mmcboot; " \ + "else " \ + "echo Not found boot.scr or uImage on mmc 2:1 or 0:3; " \ + "run noloboot; " \ + "fi; " \ "fi; " \ "fi; " \ "fi; " \ - "else run noloboot; fi" + "else " \ + "echo Initializing eMMC and/or SD card failed; " \ + "run noloboot; " \ + "fi"
#define CONFIG_AUTO_COMPLETE 1 /*

+#ifdef CONFIG_CHAINLOADER
- uint params;
- #define PARAMS params
+#else
- #define PARAMS (bd->bi_boot_params)
+#endif
do not indent the "#" with preprocessors
also, this can be rewritten a bit. always declare uint params regardless of the define, and then when in the chainloader logic, set it to the env value, otherwise set it to bd->bi_boot_params. then you can delete this dedicated and ugly "PARAMS" define.
+#ifdef CONFIG_CHAINLOADER
this is kind of a crappy define. how about "CONFIG_ATAGSADDR".
also, you'll need to update toplevel README to document the new option.
- s = getenv ("atags");
"atagsaddr" is probably a better name as a plain "atags" can be interpreted multiple ways
params = simple_strtoul (s, NULL, 16);
no spaces before the open paren in func calls. wrong: foo (a); right: foo(a);
printf ("Using existing atags at 0x%x\n", params);
0x%x -> %#x -mike

On Thursday 01 September 2011 09:52:08 you wrote:
+#ifdef CONFIG_CHAINLOADER
- uint params;
- #define PARAMS params
+#else
- #define PARAMS (bd->bi_boot_params)
+#endif
do not indent the "#" with preprocessors
ok
also, this can be rewritten a bit. always declare uint params regardless of the define, and then when in the chainloader logic, set it to the env value, otherwise set it to bd->bi_boot_params. then you can delete this dedicated and ugly "PARAMS" define.
ok, PARAMS was deleted.
+#ifdef CONFIG_CHAINLOADER
this is kind of a crappy define. how about "CONFIG_ATAGSADDR".
I think that here CONFIG_CHAINLOADER is not needed. I think that bootm can use other atag without needed defined CONFIG_CHAINLOADER.
also, you'll need to update toplevel README to document the new option.
ok, I update toplevel README file.
- s = getenv ("atags");
"atagsaddr" is probably a better name as a plain "atags" can be interpreted multiple ways
renamed to atagaddr.
params = simple_strtoul (s, NULL, 16);
no spaces before the open paren in func calls. wrong: foo (a); right: foo(a);
fixed
printf ("Using existing atags at 0x%x\n", params);
0x%x -> %#x
fixed
-mike

Dear Pali =?ISO-8859-1?Q?Roh=E1r?=,
In message 34603899.3xsChgV26D@pali-elitebook you wrote:
Ok, I attached all patches which I rebased on top of master. But U-Boot still not working, not booting, no output on device.
Please stick to standard patch submission rules - all patches must be submitted inline; MIME attachments are strongly discouraged. Fpr details pleass see http://www.denx.de/wiki/U-Boot/Patches
From: Alistair Buxton a.j.buxton@gmail.com Date: Wed, 1 Sep 2010 23:07:20 +0100 Subject: [PATCH 01/15] Make bootm optionally use pre-existing atags for Linux kernel boot.
This patch adapts the bootm command so that it can use an existing atags command set up by a previous bootloader. If the environment variable "atags" is unset, bootm behaves as normal. If "atags" is set, bootm will skip all boot args setup entirely, and pass the address found in "atags". For example, if a previous boot loader already set up the atags struct at 0x80000100:
This has zero chances for being mainlined. Please stick with standard boot commands, and adapt this for a standard SPL approach.
From: Alistair Buxton a.j.buxton@gmail.com Date: Wed, 1 Sep 2010 23:04:03 +0100 Subject: [PATCH 02/15] Store existing atags at startup if chainloading.
This patch stores the values in r1 and r2 at startup. It also stores the address which u-boot was originally loaded to. This is useful if you feed some other bootloader a u-boot.bin instead of the linux kernel it was expecting. It is rather ugly because it stores these values in an arbitrary memory address.
Ditto. This should be adapted to fit into the regular SPL framework instead.
...
From: Alistair Buxton a.j.buxton@gmail.com Date: Mon, 6 Sep 2010 03:01:34 +0100 Subject: [PATCH 03/15] Nokia RX-51 aka N900 support
This board definition results in a u-boot.bin which can be chainloaded from NOLO in qemu or on a real N900. It does very little hardware config because NOLO has already configured the board.
As mentioned before, this is normal in a SPL context.
--- /dev/null +++ b/board/nokia/rx51/config.mk
Please get rid of board specific config.mk files.
+TEXT_BASE 0x80e80000
This is wrong and needs to be fixed anyway.
+int board_init(void) +{
- DECLARE_GLOBAL_DATA_PTR;
This cannot work.. The compiler miscompiles this. This declaration MUST be done at file scope.
/* turn on keyboard and use hardware scanning */
ctrl |TWL4030_KEYPAD_CTRL_KBD_ON;
ctrl |TWL4030_KEYPAD_CTRL_SOFT_NRST;
ctrl |TWL4030_KEYPAD_CTRL_SOFTMODEN;
ret |twl4030_i2c_write_u8(TWL4030_CHIP_KEYPAD, ctrl,
TWL4030_KEYPAD_KEYP_CTRL_REG);
/* enable key event status */
ret |twl4030_i2c_write_u8(TWL4030_CHIP_KEYPAD, 0xfe,
TWL4030_KEYPAD_KEYP_IMR1);
/* using the second interrupt event breaks meamo pr1.2 kernel */
/*ret |twl4030_i2c_write_u8(TWL4030_CHIP_KEYPAD, 0xfe,
TWL4030_KEYPAD_KEYP_IMR2);*/
/* enable missed event tracking */
/*ret |twl4030_i2c_write_u8(TWL4030_CHIP_KEYPAD, 0x20,
TWL4030_KEYPAD_KEYP_SMS);*/
/* enable interrupt generation on rising and falling */
/* this is a workaround for qemu twl4030 emulation */
ret |twl4030_i2c_write_u8(TWL4030_CHIP_KEYPAD, 0x57,
TWL4030_KEYPAD_KEYP_EDR);
/* enable ISR clear on read */
ret |twl4030_i2c_write_u8(TWL4030_CHIP_KEYPAD, 0x05,
TWL4030_KEYPAD_KEYP_SIH_CTRL);
I have no idea what you think this code is doing. It will definitely not be accepted for mainline.
Also, please make sure to remove dead (commented out) code.
...
diff --git a/include/configs/nokia_rx51.h b/include/configs/nokia_rx51.h new file mode 100644 index 0000000..45b942a --- /dev/null +++ b/include/configs/nokia_rx51.h
...
+#define CONFIG_ARMV7 1 /* This is an ARM V7 CPU core */ +#define CONFIG_OMAP 1 /* in a TI OMAP core */ +#define CONFIG_OMAP34XX 1 /* which is a 34XX */ +#define CONFIG_OMAP3430 1 /* which is in a 3430 */ +#define CONFIG_OMAP3_RX51 1 /* working with RX51 */ +#define CONFIG_CHAINLOADER 1 /* Loaded by NOLO */
Please never set any values for #defines which select features only. Please fix globally.
...
From c5c232a3669bed778c438db0280ea78273d17e25 Mon Sep 17 00:00:00 2001 From: Matan Ziv-Av matan@svgalib.org Date: Tue, 7 Dec 2010 12:01:34 +0100 Subject: [PATCH 04/15] Only delay boot if keyboard open
board/nokia/rx51/rx51.c | 7 +++++++ include/configs/nokia_rx51.h | 1 + 2 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/board/nokia/rx51/rx51.c b/board/nokia/rx51/rx51.c index 3149a79..347d08a 100644 --- a/board/nokia/rx51/rx51.c +++ b/board/nokia/rx51/rx51.c @@ -104,6 +104,13 @@ int misc_init_r(void) setenv("nolo_atagaddr", buf); #endif
- // set environment variable slide_sw
- // if keyboard slide is open/close
C++ comments are not allowed. Please fix globally. Make sure to run your patches through checkpatch.
From: Matan Ziv-Av matan@svgalib.org Date: Tue, 7 Dec 2010 12:03:38 +0100 Subject: [PATCH 05/15] Change Wireless LAN mode from M4 to M0
Please squash into earlier patch that creates this file.
board/nokia/rx51/rx51.h | 20 ++++++++++---------- 1 files changed, 10 insertions(+), 10 deletions(-)
From: Matan Ziv-Av matan@svgalib.org Date: Tue, 7 Dec 2010 12:08:54 +0100 Subject: [PATCH 06/15] Look for boot.scr on 'mmc 0:3' instead 'mmc 0' and add support for loading boot.scr from 'mmc 2:1'
Subject too long.
Please squash into earlier patch that creates this file.
From: ?UTF-8?q?Pali Rohár?pali.rohar@gmail.com Date: Thu, 1 Sep 2011 12:13:32 +0200 Subject: [PATCH 07/15] RX-51: Fixed compilation on top of master (changes from Beagle Board)
Please squash into earlier patch that creates these files.
From: ?UTF-8?q?Pali Rohár?pali.rohar@gmail.com Date: Wed, 31 Aug 2011 10:58:35 +0200 Subject: [PATCH 08/15] RX-51: Add support for resetting twl4030 watchdog
- use test_and_set_bit and __clear_bit to access twl4030 i2c bus only once at same time
Mind line length. Please fix globally.
- __clear_bit(0, &twl_chip_lock);
Don't invent yoru own macros when we have standard mecros in place that do the same (here: clrbits_*() from <asm/io.h>).
@@ -256,7 +278,6 @@ int rx51_kp_getc(void) { keybuf_head %KEYBUF_SIZE; while (!rx51_kp_tstc())
;
udelay(10000);
Use a much shorter delay here, maybe even udelay(1).
From: ?UTF-8?q?Pali Rohár?pali.rohar@gmail.com Date: Wed, 31 Aug 2011 11:02:08 +0200 Subject: [PATCH 09/15] RX-51: Fix keymap
- make functions and variables static
- add support for additional key combination with ctrl and fn
- add support for keys: up, down, left, right, volume_up, volume_down
Squash into earlier patches.
From: ?UTF-8?q?Pali Rohár?pali.rohar@gmail.com Date: Wed, 31 Aug 2011 15:40:58 +0200 Subject: [PATCH 10/15] include/common.h: Add some macros for ANSI escape codes
include/common.h | 32 ++++++++++++++++++++++++++++++++ 1 files changed, 32 insertions(+), 0 deletions(-)
This does not belong into common.h.
...
From: ?UTF-8?q?Pali Rohár?pali.rohar@gmail.com Date: Wed, 31 Aug 2011 15:41:24 +0200 Subject: [PATCH 11/15] drivers/video/cfb_console.c: Added support for ANSI escape codes
This has several issues:
- You add it unconditionally, thus blowing up the code soze for everybody, whether they want this feature or not. - You add it only here, not to all console drivers, thus creating incompatible behaviour. This is not nice.
+static void console_set_text_color(int c) +{
- // TODO
+}
+static void console_set_background_color(int c) +{
- // TODO
+}
Either implement the code, or omit the functions alltogeter. Do not add dead code.
...
if (num1 0) //reset swapped colors
{
if (ansi_colors_need_revert)
{
console_swap_colors();
ansi_colors_need_revert 0;
}
Incorrect brace style. Please fix globally.
From: =?UTF-8?q?Pali=20Roh=C3=A1r?= pali.rohar@gmail.com Date: Wed, 31 Aug 2011 12:07:50 +0200 Subject: [PATCH 12/15] New command bootmenu: ANSI terminal Boot Menu support
- Configuration is done via env variables bootmenu_delay and bootmenu_<num>:
Please check if you can rather use Jason Hobbs' "Add generic, reusable menu code" patch series.
...
From: ?UTF-8?q?Pali Rohár?pali.rohar@gmail.com Date: Wed, 31 Aug 2011 14:12:06 +0200 Subject: [PATCH 14/15] New config variable CONFIG_PREMONITOR
- if defined run env "premonitor" before Main Loop for Monitor Command Processing
What does this do that preboot cannot do?
Best regards,
Wolfgang Denk

On Thursday 01 September 2011 13:53:42 you wrote:
Dear Pali =?ISO-8859-1?Q?Roh=E1r?=,
In message 34603899.3xsChgV26D@pali-elitebook you wrote:
Ok, I attached all patches which I rebased on top of master. But U-Boot still not working, not booting, no output on device.
Please stick to standard patch submission rules - all patches must be submitted inline; MIME attachments are strongly discouraged. Fpr details pleass see http://www.denx.de/wiki/U-Boot/Patches
I wrote that this patch series was incomplete and not correct. I will fix that and I will use git send-email.
From: Alistair Buxton a.j.buxton@gmail.com Date: Wed, 1 Sep 2010 23:07:20 +0100 Subject: [PATCH 01/15] Make bootm optionally use pre-existing atags for Linux kernel boot.
This patch adapts the bootm command so that it can use an existing atags command set up by a previous bootloader. If the environment variable "atags" is unset, bootm behaves as normal. If "atags" is set, bootm will skip all boot args setup entirely, and pass the address found in "atags". For example, if a previous boot loader already set up the atags struct at 0x80000100:
This has zero chances for being mainlined. Please stick with standard boot commands, and adapt this for a standard SPL approach.
what is problem with using bi_boot_params from enviromental variable atagaddr? what is SPL?
From: Alistair Buxton a.j.buxton@gmail.com Date: Wed, 1 Sep 2010 23:04:03 +0100 Subject: [PATCH 02/15] Store existing atags at startup if chainloading.
This patch stores the values in r1 and r2 at startup. It also stores the address which u-boot was originally loaded to. This is useful if you feed some other bootloader a u-boot.bin instead of the linux kernel it was expecting. It is rather ugly because it stores these values in an arbitrary memory address.
Ditto. This should be adapted to fit into the regular SPL framework instead.
so, what is correct way how to store atag address (register r2) for board code?
...
From: Alistair Buxton a.j.buxton@gmail.com Date: Mon, 6 Sep 2010 03:01:34 +0100 Subject: [PATCH 03/15] Nokia RX-51 aka N900 support
This board definition results in a u-boot.bin which can be chainloaded from NOLO in qemu or on a real N900. It does very little hardware config because NOLO has already configured the board.
As mentioned before, this is normal in a SPL context.
--- /dev/null +++ b/board/nokia/rx51/config.mk
Please get rid of board specific config.mk files.
file deleted
+TEXT_BASE 0x80e80000
This is wrong and needs to be fixed anyway.
+int board_init(void) +{
- DECLARE_GLOBAL_DATA_PTR;
This cannot work.. The compiler miscompiles this. This declaration MUST be done at file scope.
fixed
/* turn on keyboard and use hardware scanning */
ctrl |TWL4030_KEYPAD_CTRL_KBD_ON;
ctrl |TWL4030_KEYPAD_CTRL_SOFT_NRST;
ctrl |TWL4030_KEYPAD_CTRL_SOFTMODEN;
ret |twl4030_i2c_write_u8(TWL4030_CHIP_KEYPAD, ctrl,
TWL4030_KEYPAD_KEYP_CTRL_REG);
/* enable key event status */
ret |twl4030_i2c_write_u8(TWL4030_CHIP_KEYPAD, 0xfe,
TWL4030_KEYPAD_KEYP_IMR1);
/* using the second interrupt event breaks meamo pr1.2 kernel */
/*ret |twl4030_i2c_write_u8(TWL4030_CHIP_KEYPAD, 0xfe,
TWL4030_KEYPAD_KEYP_IMR2);*/
/* enable missed event tracking */
/*ret |twl4030_i2c_write_u8(TWL4030_CHIP_KEYPAD, 0x20,
TWL4030_KEYPAD_KEYP_SMS);*/
/* enable interrupt generation on rising and falling */
/* this is a workaround for qemu twl4030 emulation */
ret |twl4030_i2c_write_u8(TWL4030_CHIP_KEYPAD, 0x57,
TWL4030_KEYPAD_KEYP_EDR);
/* enable ISR clear on read */
ret |twl4030_i2c_write_u8(TWL4030_CHIP_KEYPAD, 0x05,
TWL4030_KEYPAD_KEYP_SIH_CTRL);
I have no idea what you think this code is doing. It will definitely not be accepted for mainline.
this enable HW keyboard
Also, please make sure to remove dead (commented out) code.
ok, commented code will be deleted
...
diff --git a/include/configs/nokia_rx51.h b/include/configs/nokia_rx51.h new file mode 100644 index 0000000..45b942a --- /dev/null +++ b/include/configs/nokia_rx51.h
...
+#define CONFIG_ARMV7 1 /* This is an ARM V7 CPU core */ +#define CONFIG_OMAP 1 /* in a TI OMAP core */ +#define CONFIG_OMAP34XX 1 /* which is a 34XX */ +#define CONFIG_OMAP3430 1 /* which is in a 3430 */ +#define CONFIG_OMAP3_RX51 1 /* working with RX51 */ +#define CONFIG_CHAINLOADER 1 /* Loaded by NOLO */
Please never set any values for #defines which select features only. Please fix globally.
fixed all defines
...
From c5c232a3669bed778c438db0280ea78273d17e25 Mon Sep 17 00:00:00 2001 From: Matan Ziv-Av matan@svgalib.org Date: Tue, 7 Dec 2010 12:01:34 +0100 Subject: [PATCH 04/15] Only delay boot if keyboard open
board/nokia/rx51/rx51.c | 7 +++++++ include/configs/nokia_rx51.h | 1 + 2 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/board/nokia/rx51/rx51.c b/board/nokia/rx51/rx51.c index 3149a79..347d08a 100644 --- a/board/nokia/rx51/rx51.c +++ b/board/nokia/rx51/rx51.c @@ -104,6 +104,13 @@ int misc_init_r(void)
setenv("nolo_atagaddr", buf);
#endif
- // set environment variable slide_sw
- // if keyboard slide is open/close
C++ comments are not allowed. Please fix globally. Make sure to run your patches through checkpatch.
"//" comments changed to /* .. */
From: Matan Ziv-Av matan@svgalib.org Date: Tue, 7 Dec 2010 12:03:38 +0100 Subject: [PATCH 05/15] Change Wireless LAN mode from M4 to M0
Please squash into earlier patch that creates this file.
I will squash all board files/commits into one patch.
board/nokia/rx51/rx51.h | 20 ++++++++++---------- 1 files changed, 10 insertions(+), 10 deletions(-)
From: Matan Ziv-Av matan@svgalib.org Date: Tue, 7 Dec 2010 12:08:54 +0100 Subject: [PATCH 06/15] Look for boot.scr on 'mmc 0:3' instead 'mmc 0' and add support for loading boot.scr from 'mmc 2:1'
Subject too long.
Please squash into earlier patch that creates this file.
From: ?UTF-8?q?Pali Rohár?pali.rohar@gmail.com Date: Thu, 1 Sep 2011 12:13:32 +0200 Subject: [PATCH 07/15] RX-51: Fixed compilation on top of master (changes from Beagle Board)
Please squash into earlier patch that creates these files.
From: ?UTF-8?q?Pali Rohár?pali.rohar@gmail.com Date: Wed, 31 Aug 2011 10:58:35 +0200 Subject: [PATCH 08/15] RX-51: Add support for resetting twl4030 watchdog
- use test_and_set_bit and __clear_bit to access twl4030 i2c bus only
once at same time
Mind line length. Please fix globally.
- __clear_bit(0, &twl_chip_lock);
Don't invent yoru own macros when we have standard mecros in place that do the same (here: clrbits_*() from <asm/io.h>).
I think that these are standrad macros. test_and_set_bit and __clear_bit are defined in include/asm/bitops.h and include/linux/bitops.h
@@ -256,7 +278,6 @@ int rx51_kp_getc(void)
{
keybuf_head %KEYBUF_SIZE; while (!rx51_kp_tstc())
;
udelay(10000);
Use a much shorter delay here, maybe even udelay(1).
Ok I'm using udelay(1) + hw_watchdog_reset()
From: ?UTF-8?q?Pali Rohár?pali.rohar@gmail.com Date: Wed, 31 Aug 2011 11:02:08 +0200 Subject: [PATCH 09/15] RX-51: Fix keymap
- make functions and variables static
- add support for additional key combination with ctrl and fn
- add support for keys: up, down, left, right, volume_up, volume_down
Squash into earlier patches.
From: ?UTF-8?q?Pali Rohár?pali.rohar@gmail.com Date: Wed, 31 Aug 2011 15:40:58 +0200 Subject: [PATCH 10/15] include/common.h: Add some macros for ANSI escape codes
include/common.h | 32 ++++++++++++++++++++++++++++++++ 1 files changed, 32 insertions(+), 0 deletions(-)
This does not belong into common.h.
So where it should be defined?
...
From: ?UTF-8?q?Pali Rohár?pali.rohar@gmail.com Date: Wed, 31 Aug 2011 15:41:24 +0200 Subject: [PATCH 11/15] drivers/video/cfb_console.c: Added support for ANSI escape codes
This has several issues:
- You add it unconditionally, thus blowing up the code soze for everybody, whether they want this feature or not.
Ok, I create for this config macro (CONFIG_VIDEO_CFB_ANSI) which can enable/disable ANSI termal support in cfb video driver.
- You add it only here, not to all console drivers, thus creating incompatible behaviour. This is not nice.
Serial console output and usbtty are using host terminal (on PC). And all modern terminal support ANSI escape chars. So only framebuffer devices are without ANSI support. And this patch implement support fot standard framebuffer driver.
+static void console_set_text_color(int c) +{
- // TODO
+}
+static void console_set_background_color(int c) +{
- // TODO
+}
Either implement the code, or omit the functions alltogeter. Do not add dead code.
background and text color is not used, functions deleted.
...
if (num1 0) //reset swapped colors
{
if (ansi_colors_need_revert)
{
console_swap_colors();
ansi_colors_need_revert 0;
}
Incorrect brace style. Please fix globally.
fixed
From: =?UTF-8?q?Pali=20Roh=C3=A1r?= pali.rohar@gmail.com Date: Wed, 31 Aug 2011 12:07:50 +0200 Subject: [PATCH 12/15] New command bootmenu: ANSI terminal Boot Menu support>
- Configuration is done via env variables bootmenu_delay and
bootmenu_<num>:
Please check if you can rather use Jason Hobbs' "Add generic, reusable menu code" patch series.
I'd like to use for rx51 my bootmenu. I rebase bootmenu patches on top of master so then bootmenu can be simple added/deleted by one patch.
...
From: ?UTF-8?q?Pali Rohár?pali.rohar@gmail.com Date: Wed, 31 Aug 2011 14:12:06 +0200 Subject: [PATCH 14/15] New config variable CONFIG_PREMONITOR
- if defined run env "premonitor" before Main Loop for Monitor Command
Processing
What does this do that preboot cannot do?
before running monitor loop I'd like wrote some info to console (specific board info, board commands, board macros). but if these info will be written in preboot it can be deleted by menu section. after preboot is running menu where can be used for example my bootmenu (which clean console output). so section after menu and before preboot is needed.
Best regards,
Wolfgang Denk

On Thursday 01 September 2011 10:42:48 you wrote:
Hello,
U-Boot patches which add support for Nokia RX-51 (aka N900) is here: http://al.robotfuzz.com/~al/maemo/u-boot/
RX-51 has closed 2nd stage bootloader NOLO which can load kernel image from nand (or usb) to ram and boot it. NOLO also done all HW initializations. These U-Boot patches for RX-51 add support that builded U-Boot binary can be loaded and booted by NOLO. So U-Boot will be 3rd bootloader.
Patches are on top of revision bd2313078114c4b44c4a5ce149af43bcb7fc8854 and working fine. I rebased these patches on top of u-boot git master repository, but booting failed. No output on device. Using git bisect I found that problem appeared at revision
561142af20f1fd7b425d9425730014e656defb91 ARM: implement relocation for ARM V7 (OMAP)
If I defined CONFIG_SYS_ARM_WITHOUT_RELOC U-Boot working and booting fine up to revision a9aa3926295df759306258e5e24cace414f53b67
So problem is that relocation patches broke RX-51 support. Can somebody help me how to rewrite/port rx-51 patches to work with ARM relocation (do not forget that U-Boot is loaded by 2nd bootloader to RAM after HW is initialized by NOLO)? If U-Boot will be working on RX-51 I will prepair patches for upstreaming.
Ali1234 now fixed relocation problem on RX-51. I rebase and fix all patches.
https://github.com/ali1234/u-boot- n900/commit/35669073e8f785acbc11c01faae531b5183ec3ba

Hello,
I'm sending new patch series, which add Nokia RX-51 support to U-Boot. This patches are based on master commit 06e42c6e2ce269667daecd6229d0b7c813838203 and now U-Boot working on Nokia RX-51.

* Hide function save_boot_params if CONFIG_SPL_BUILD is not defined (function do nothing)
* Same behaviour as in file arch/arm/cpu/armv7/omap4/lowlevel_init.S * This allow to implement board specified function save_boot_params in board code
Signed-off-by: Pali Rohár pali.rohar@gmail.com --- arch/arm/cpu/armv7/omap3/lowlevel_init.S | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/arm/cpu/armv7/omap3/lowlevel_init.S b/arch/arm/cpu/armv7/omap3/lowlevel_init.S index 2f6930b..c42c5dd 100644 --- a/arch/arm/cpu/armv7/omap3/lowlevel_init.S +++ b/arch/arm/cpu/armv7/omap3/lowlevel_init.S @@ -35,15 +35,15 @@ _TEXT_BASE: .word CONFIG_SYS_TEXT_BASE /* sdram load addr from config.mk */
+#ifdef CONFIG_SPL_BUILD .global save_boot_params save_boot_params: -#ifdef CONFIG_SPL_BUILD ldr r4, =omap3_boot_device ldr r5, [r0, #0x4] and r5, r5, #0xff str r5, [r4] -#endif bx lr +#endif
.global omap3_gp_romcode_call omap3_gp_romcode_call:

This patch adapts the bootm command so that it can use an existing atags command set up by a previous bootloader. If the environment variable "atagaddr" is unset, bootm behaves as normal. If "atagaddr" is set, bootm will use atags address from environment variable and also append new boot args (if specified in u-boot). For example, if a previous boot loader already set up the atags struct at 0x80000100:
setenv atagaddr 0x80000100; bootm 0x80008000
Signed-off-by: Pali Rohár pali.rohar@gmail.com --- README | 2 ++ arch/arm/lib/bootm.c | 27 +++++++++++++++++++++++++-- 2 files changed, 27 insertions(+), 2 deletions(-)
diff --git a/README b/README index ff72e47..3dd5a97 100644 --- a/README +++ b/README @@ -3564,6 +3564,8 @@ Some configuration options can be set using Environment Variables.
List of environment variables (most likely not complete):
+ atagaddr - bootm will use ATAGs struct from specified address (arm only) + baudrate - see CONFIG_BAUDRATE
bootdelay - see CONFIG_BOOTDELAY diff --git a/arch/arm/lib/bootm.c b/arch/arm/lib/bootm.c index 802e833..4a3c423 100644 --- a/arch/arm/lib/bootm.c +++ b/arch/arm/lib/bootm.c @@ -125,12 +125,24 @@ int do_bootm_linux(int flag, int argc, char *argv[], bootm_headers_t *images) debug ("## Transferring control to Linux (at address %08lx) ...\n", (ulong) kernel_entry);
+ s = getenv ("atagaddr"); + if (s) { + bd->bi_boot_params = simple_strtoul(s, NULL, 16); + printf("Using existing atags at %#x\n", bd->bi_boot_params); + + params = (struct tag *) bd->bi_boot_params; + while (params->hdr.size > 0) + params = tag_next (params); + } else { #if defined (CONFIG_SETUP_MEMORY_TAGS) || \ defined (CONFIG_CMDLINE_TAG) || \ defined (CONFIG_INITRD_TAG) || \ defined (CONFIG_SERIAL_TAG) || \ defined (CONFIG_REVISION_TAG) - setup_start_tag (bd); + setup_start_tag (bd); + } +#endif + #ifdef CONFIG_SERIAL_TAG setup_serial_tag (¶ms); #endif @@ -147,8 +159,19 @@ int do_bootm_linux(int flag, int argc, char *argv[], bootm_headers_t *images) if (images->rd_start && images->rd_end) setup_initrd_tag (bd, images->rd_start, images->rd_end); #endif - setup_end_tag(bd); + + if (s) { + if (params->hdr.size > 0) + setup_end_tag(bd); + } else { +#if defined (CONFIG_SETUP_MEMORY_TAGS) || \ + defined (CONFIG_CMDLINE_TAG) || \ + defined (CONFIG_INITRD_TAG) || \ + defined (CONFIG_SERIAL_TAG) || \ + defined (CONFIG_REVISION_TAG) + setup_end_tag(bd); #endif + }
announce_and_cleanup();

On Saturday 17 December 2011 12:03:04 Pali Rohár wrote:
- s = getenv ("atagaddr");
no space before the "("
#if defined (CONFIG_SETUP_MEMORY_TAGS) || \ defined (CONFIG_CMDLINE_TAG) || \ defined (CONFIG_INITRD_TAG) || \ defined (CONFIG_SERIAL_TAG) || \ defined (CONFIG_REVISION_TAG) ... +#if defined (CONFIG_SETUP_MEMORY_TAGS) || \
- defined (CONFIG_CMDLINE_TAG) || \
- defined (CONFIG_INITRD_TAG) || \
- defined (CONFIG_SERIAL_TAG) || \
- defined (CONFIG_REVISION_TAG)
rather than duplicating the same list in multiple places, why not setup a local define in this file and then use that everywhere else. -mike

On Sunday 18 December 2011 13:54:21 Mike Frysinger wrote:
On Saturday 17 December 2011 12:03:04 Pali Rohár wrote:
- s = getenv ("atagaddr");
no space before the "("
#if defined (CONFIG_SETUP_MEMORY_TAGS) || \
defined (CONFIG_CMDLINE_TAG) || \ defined (CONFIG_INITRD_TAG) || \ defined (CONFIG_SERIAL_TAG) || \ defined (CONFIG_REVISION_TAG)
... +#if defined (CONFIG_SETUP_MEMORY_TAGS) || \
- defined (CONFIG_CMDLINE_TAG) || \
- defined (CONFIG_INITRD_TAG) || \
- defined (CONFIG_SERIAL_TAG) || \
- defined (CONFIG_REVISION_TAG)
rather than duplicating the same list in multiple places, why not setup a local define in this file and then use that everywhere else. -mike
I will add local define CONFIG_ANY_TAG to bootm.c
+#if defined (CONFIG_SETUP_MEMORY_TAGS) || \ + defined (CONFIG_CMDLINE_TAG) || \ + defined (CONFIG_INITRD_TAG) || \ + defined (CONFIG_SERIAL_TAG) || \ + defined (CONFIG_REVISION_TAG) +#define CONFIG_ANY_TAG +#endif

* Code from linux kernel: include/linux/i2c/twl.h
Signed-off-by: Pali Rohár pali.rohar@gmail.com --- include/twl4030.h | 98 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 98 insertions(+), 0 deletions(-)
diff --git a/include/twl4030.h b/include/twl4030.h index 9cd32ab..f040594 100644 --- a/include/twl4030.h +++ b/include/twl4030.h @@ -151,6 +151,103 @@ #define TWL4030_PM_MASTER_SW_EVENTS_DEVSLP (1 << 1) #define TWL4030_PM_MASTER_SW_EVENTS_DEVOFF (1 << 0)
+/* Power bus message definitions */ + +/* The TWL4030/5030 splits its power-management resources (the various + * regulators, clock and reset lines) into 3 processor groups - P1, P2 and + * P3. These groups can then be configured to transition between sleep, wait-on + * and active states by sending messages to the power bus. See Section 5.4.2 + * Power Resources of TWL4030 TRM + */ + +/* Processor groups */ +#define DEV_GRP_NULL 0x0 +#define DEV_GRP_P1 0x1 /* P1: all OMAP devices */ +#define DEV_GRP_P2 0x2 /* P2: all Modem devices */ +#define DEV_GRP_P3 0x4 /* P3: all peripheral devices */ + +/* Resource groups */ +#define RES_GRP_RES 0x0 /* Reserved */ +#define RES_GRP_PP 0x1 /* Power providers */ +#define RES_GRP_RC 0x2 /* Reset and control */ +#define RES_GRP_PP_RC 0x3 +#define RES_GRP_PR 0x4 /* Power references */ +#define RES_GRP_PP_PR 0x5 +#define RES_GRP_RC_PR 0x6 +#define RES_GRP_ALL 0x7 /* All resource groups */ + +#define RES_TYPE2_R0 0x0 + +#define RES_TYPE_ALL 0x7 + +/* Resource states */ +#define RES_STATE_WRST 0xF +#define RES_STATE_ACTIVE 0xE +#define RES_STATE_SLEEP 0x8 +#define RES_STATE_OFF 0x0 + +/* Power resources */ + +/* Power providers */ +#define RES_VAUX1 1 +#define RES_VAUX2 2 +#define RES_VAUX3 3 +#define RES_VAUX4 4 +#define RES_VMMC1 5 +#define RES_VMMC2 6 +#define RES_VPLL1 7 +#define RES_VPLL2 8 +#define RES_VSIM 9 +#define RES_VDAC 10 +#define RES_VINTANA1 11 +#define RES_VINTANA2 12 +#define RES_VINTDIG 13 +#define RES_VIO 14 +#define RES_VDD1 15 +#define RES_VDD2 16 +#define RES_VUSB_1V5 17 +#define RES_VUSB_1V8 18 +#define RES_VUSB_3V1 19 +#define RES_VUSBCP 20 +#define RES_REGEN 21 +/* Reset and control */ +#define RES_NRES_PWRON 22 +#define RES_CLKEN 23 +#define RES_SYSEN 24 +#define RES_HFCLKOUT 25 +#define RES_32KCLKOUT 26 +#define RES_RESET 27 +/* Power Reference */ +#define RES_Main_Ref 28 + +#define TOTAL_RESOURCES 28 +/* + * Power Bus Message Format ... these can be sent individually by Linux, + * but are usually part of downloaded scripts that are run when various + * power events are triggered. + * + * Broadcast Message (16 Bits): + * DEV_GRP[15:13] MT[12] RES_GRP[11:9] RES_TYPE2[8:7] RES_TYPE[6:4] + * RES_STATE[3:0] + * + * Singular Message (16 Bits): + * DEV_GRP[15:13] MT[12] RES_ID[11:4] RES_STATE[3:0] + */ + +#define MSG_BROADCAST(devgrp, grp, type, type2, state) \ + ( (devgrp) << 13 | 1 << 12 | (grp) << 9 | (type2) << 7 \ + | (type) << 4 | (state)) + +#define MSG_SINGULAR(devgrp, id, state) \ + ((devgrp) << 13 | 0 << 12 | (id) << 4 | (state)) + +#define MSG_BROADCAST_ALL(devgrp, state) \ + ((devgrp) << 5 | (state)) + +#define MSG_BROADCAST_REF MSG_BROADCAST_ALL +#define MSG_BROADCAST_PROV MSG_BROADCAST_ALL +#define MSG_BROADCAST__CLK_RST MSG_BROADCAST_ALL + /* Power Managment Receiver */ #define TWL4030_PM_RECEIVER_SC_CONFIG 0x5B #define TWL4030_PM_RECEIVER_SC_DETECT1 0x5C @@ -311,6 +408,7 @@ #define TWL4030_PM_RECEIVER_VDAC_VSEL_18 0x03 #define TWL4030_PM_RECEIVER_VMMC1_VSEL_30 0x02 #define TWL4030_PM_RECEIVER_VMMC1_VSEL_32 0x03 +#define TWL4030_PM_RECEIVER_VSIM_VSEL_18 0x03
/* Device Selection in PM Receiver Module */ #define TWL4030_PM_RECEIVER_DEV_GRP_P1 0x20

Signed-off-by: Pali Rohár pali.rohar@gmail.com --- include/common.h | 18 ++++++++++++++++++ 1 files changed, 18 insertions(+), 0 deletions(-)
diff --git a/include/common.h b/include/common.h index 5cfdd76..0a5e84e 100644 --- a/include/common.h +++ b/include/common.h @@ -760,6 +760,24 @@ void clear_ctrlc (void); /* clear the Control-C condition */ int disable_ctrlc (int); /* 1 to disable, 0 to enable Control-C detect */
/* + * ANSI terminal + */ + +#define ANSI_CURSOR_UP "\e[%dA" +#define ANSI_CURSOR_DOWN "\e[%dB" +#define ANSI_CURSOR_FORWARD "\e[%dC" +#define ANSI_CURSOR_BACK "\e[%dD" +#define ANSI_CURSOR_NEXTLINE "\e[%dE" +#define ANSI_CURSOR_PREVIOUSLINE "\e[%dF" +#define ANSI_CURSOR_COLUMN "\e[%dG" +#define ANSI_CURSOR_POSITION "\e[%d;%dH" +#define ANSI_CLEAR_CONSOLE "\e[2J" +#define ANSI_CLEAR_LINE_TO_END "\e[0K" +#define ANSI_CLEAR_LINE "\e[2K" +#define ANSI_COLOR_RESET "\e[0m" +#define ANSI_COLOR_REVERSE "\e[7m" + +/* * STDIO based functions (can always be used) */ /* serial stuff */

* Ignore ANSI escape sequences for moving cursor, which are generated by keyboard
Signed-off-by: Pali Rohár pali.rohar@gmail.com --- common/main.c | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 49 insertions(+), 0 deletions(-)
diff --git a/common/main.c b/common/main.c index e96c95a..5531130 100644 --- a/common/main.c +++ b/common/main.c @@ -958,6 +958,7 @@ int readline_into_buffer (const char *const prompt, char * buffer) int n = 0; /* buffer index */ int plen = 0; /* prompt length */ int col; /* output column cnt */ + int esc = 0; /* ansi escape char */ char c;
/* print prompt */ @@ -1024,7 +1025,55 @@ int readline_into_buffer (const char *const prompt, char * buffer) p=delete_char(p_buf, p, &col, &n, plen); continue;
+ case '\e': /* ANSI escape char */ + esc = 1; + continue; + default: + + /* + * Check for ANSI escape chars + */ + if (esc == 0 && c == '\e') { + esc = 1; + continue; + } else if (esc == 1) { + if (c == '[') { + esc = 2; + continue; + } + if (n < CONFIG_SYS_CBSIZE-2) { + ++n; + *p++ = '\e'; + putc('\e'); + } + esc = 0; + } else if (esc == 2 || esc == 3) { + if (esc == 2 && c == '1') { + esc = 3; + continue; + } + /* Ignore ANSI escape sequences generated by keyboard */ + /* \e [ 1 A-D and \e [ A-D */ + if ( c >= 'A' && c <= 'D' ) { + esc = 0; + continue; + } + if (esc == 2 && n < CONFIG_SYS_CBSIZE-3) { + n += 2; + *p++ = '\e'; + *p++ = '['; + puts("\e["); + } else if (esc == 3 && n < CONFIG_SYS_CBSIZE-4) { + n += 3; + *p++ = '\e'; + *p++ = '['; + *p++ = '1'; + puts("\e[1"); + } + esc = 0; + } + /* * Must be a normal character then */

On Sunday 18 December 2011 13:58:30 Mike Frysinger wrote:
On Saturday 17 December 2011 12:03:07 Pali Rohár wrote:
- Ignore ANSI escape sequences for moving cursor, which are generated
by
keyboard
you need to line wrap your changelogs -mike
I will fix all commit messages.

* Use correct buffer size, do not damage screen output
Signed-off-by: Pali Rohár pali.rohar@gmail.com --- drivers/video/cfb_console.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/video/cfb_console.c b/drivers/video/cfb_console.c index 904caf7..9092399 100644 --- a/drivers/video/cfb_console.c +++ b/drivers/video/cfb_console.c @@ -701,7 +701,7 @@ static void console_scrollup(void) ); #else memcpyl(CONSOLE_ROW_FIRST, CONSOLE_ROW_SECOND, - CONSOLE_SCROLL_SIZE >> 2); + CONSOLE_SCROLL_SIZE); #endif
/* clear the last one */

* swap background and text color
Signed-off-by: Pali Rohár pali.rohar@gmail.com --- drivers/video/cfb_console.c | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/drivers/video/cfb_console.c b/drivers/video/cfb_console.c index 9092399..867c789 100644 --- a/drivers/video/cfb_console.c +++ b/drivers/video/cfb_console.c @@ -602,6 +602,14 @@ static void video_putchar(int xx, int yy, unsigned char c) video_drawchars(xx, yy + video_logo_height, &c, 1); }
+static void console_swap_colors(void) +{ + eorx = fgx; + fgx = bgx; + bgx = eorx; + eorx = fgx ^ bgx; +} + #if defined(CONFIG_CONSOLE_CURSOR) || defined(CONFIG_VIDEO_SW_CURSOR) static void video_set_cursor(void) {

On Saturday 17 December 2011 12:03:09 Pali Rohár wrote:
--- a/drivers/video/cfb_console.c +++ b/drivers/video/cfb_console.c
+static void console_swap_colors(void) +{
- eorx = fgx;
- fgx = bgx;
- bgx = eorx;
- eorx = fgx ^ bgx;
+}
there's nothing calling this new func in this patch ... -mike

On Sunday 18 December 2011 13:57:40 Mike Frysinger wrote:
On Saturday 17 December 2011 12:03:09 Pali Rohár wrote:
--- a/drivers/video/cfb_console.c +++ b/drivers/video/cfb_console.c
+static void console_swap_colors(void) +{
- eorx = fgx;
- fgx = bgx;
- bgx = eorx;
- eorx = fgx ^ bgx;
+}
there's nothing calling this new func in this patch ... -mike
This function in needed for ANSI terminal support in Patch 10.

On Sunday 18 December 2011 14:00:10 Pali Rohár wrote:
On Sunday 18 December 2011 13:57:40 Mike Frysinger wrote:
On Saturday 17 December 2011 12:03:09 Pali Rohár wrote:
--- a/drivers/video/cfb_console.c +++ b/drivers/video/cfb_console.c
+static void console_swap_colors(void) +{
- eorx = fgx;
- fgx = bgx;
- bgx = eorx;
- eorx = fgx ^ bgx;
+}
there's nothing calling this new func in this patch ...
This function in needed for ANSI terminal support in Patch 10.
so squash it into the patch where it actually gets used -mike

* console_clear - clear full console framebuffer output * console_clear_line - clear part of specified line (or full)
Signed-off-by: Pali Rohár pali.rohar@gmail.com --- drivers/video/cfb_console.c | 56 +++++++++++++++++++++++++++++++++--------- 1 files changed, 44 insertions(+), 12 deletions(-)
diff --git a/drivers/video/cfb_console.c b/drivers/video/cfb_console.c index 867c789..7a4f0f3 100644 --- a/drivers/video/cfb_console.c +++ b/drivers/video/cfb_console.c @@ -691,6 +691,49 @@ static void memcpyl(int *d, int *s, int c) } #endif
+static void console_clear(void) +{ +#ifdef VIDEO_HW_RECTFILL + video_hw_rectfill(VIDEO_PIXEL_SIZE, /* bytes per pixel */ + 0, /* dest pos x */ + video_logo_height, /* dest pos y */ + VIDEO_VISIBLE_COLS, /* frame width */ + VIDEO_VISIBLE_ROWS, /* frame height */ + bgx /* fill color */ + ); +#else + memsetl(CONSOLE_ROW_FIRST, CONSOLE_SIZE, bgx); +#endif +} + +static void console_clear_line(int line, int begin, int end) +{ +#ifdef VIDEO_HW_RECTFILL + video_hw_rectfill(VIDEO_PIXEL_SIZE, /* bytes per pixel */ + VIDEO_FONT_WIDTH * begin, /* dest pos x */ /* FIXME: correct? */ + video_logo_height + CONSOLE_ROW_SIZE * line, /* dest pos y */ /* FIXME: correct? */ + VIDEO_FONT_WIDTH * ( end - begin ), /* frame width */ /* FIXME: correct? */ + VIDEO_FONT_HEIGHT, /* frame height */ + bgx /* fill color */ + ); +#else + int i; + if ( begin == 0 && end == CONSOLE_COLS ) + memsetl(CONSOLE_ROW_FIRST + CONSOLE_ROW_SIZE * line, /* offset of row */ + CONSOLE_ROW_SIZE >> 2, /* length of row */ + bgx /* fill color */ + ); + else + for ( i = 0; i < VIDEO_FONT_HEIGHT; ++i ) + memsetl(CONSOLE_ROW_FIRST + CONSOLE_ROW_SIZE * line + /* offset of row */ + VIDEO_FONT_WIDTH * VIDEO_PIXEL_SIZE * begin + /* offset of col */ + i * VIDEO_LINE_LEN, /* col offset of i-th line */ + (VIDEO_FONT_WIDTH * VIDEO_PIXEL_SIZE * ( end - begin + 1)) >> 2, /* length to end of line */ + bgx /* fill color */ + ); +#endif +} + static void console_scrollup(void) { /* copy up rows ignoring the first one */ @@ -713,18 +756,7 @@ static void console_scrollup(void) #endif
/* clear the last one */ -#ifdef VIDEO_HW_RECTFILL - video_hw_rectfill(VIDEO_PIXEL_SIZE, /* bytes per pixel */ - 0, /* dest pos x */ - VIDEO_VISIBLE_ROWS - - VIDEO_FONT_HEIGHT, /* dest pos y */ - VIDEO_VISIBLE_COLS, /* frame width */ - VIDEO_FONT_HEIGHT, /* frame height */ - CONSOLE_BG_COL /* fill color */ - ); -#else - memsetl(CONSOLE_ROW_LAST, CONSOLE_ROW_SIZE >> 2, CONSOLE_BG_COL); -#endif + console_clear_line(CONSOLE_ROWS-1, 0, CONSOLE_COLS); }
static void console_back(void)

On Saturday 17 December 2011 12:03:10 Pali Rohár wrote:
--- a/drivers/video/cfb_console.c +++ b/drivers/video/cfb_console.c
+static void console_clear_line(int line, int begin, int end) +{ +#ifdef VIDEO_HW_RECTFILL
- video_hw_rectfill(VIDEO_PIXEL_SIZE, /* bytes per pixel */
VIDEO_FONT_WIDTH * begin, /* dest pos x */ /* FIXME:
correct? */
video_logo_height + CONSOLE_ROW_SIZE * line, /* dest pos y */
/*
FIXME: correct? */ + VIDEO_FONT_WIDTH * ( end - begin ),
/* frame
width */ /* FIXME: correct? */ + VIDEO_FONT_HEIGHT,
/* frame height
*/
bgx /* fill color */
);
+#else
- int i;
- if ( begin == 0 && end == CONSOLE_COLS )
memsetl(CONSOLE_ROW_FIRST + CONSOLE_ROW_SIZE * line, /* offset of
row */
CONSOLE_ROW_SIZE >> 2, /* length of row */
bgx /* fill color */
);
- else
for ( i = 0; i < VIDEO_FONT_HEIGHT; ++i )
memsetl(CONSOLE_ROW_FIRST + CONSOLE_ROW_SIZE * line + /* offset
of row
*/ + VIDEO_FONT_WIDTH * VIDEO_PIXEL_SIZE * begin + /*
offset of col */
i * VIDEO_LINE_LEN, /* col offset of i-th
line */
(VIDEO_FONT_WIDTH * VIDEO_PIXEL_SIZE * ( end - begin + 1))
2, /*
length to end of line */ + bgx /*
fill color */
);
these lines are way too long -- notice how my e-mail client craps everywhere because of it ;). put the comments on their own line, move them all to before the func call, or drop them. -mike

* console_cursor_fix - check and fix cursor position (if it is not out of screen) * console_cursor_up, console_cursor_down, console_cursor_left, console_cursor_right and console_cursor_set_position for changing cursor position * console_newline - added param to specify count of creating new lines * console_previewsline - opposite of console_newline
Signed-off-by: Pali Rohár pali.rohar@gmail.com --- drivers/video/cfb_console.c | 64 +++++++++++++++++++++++++++++++++++++++---- 1 files changed, 58 insertions(+), 6 deletions(-)
diff --git a/drivers/video/cfb_console.c b/drivers/video/cfb_console.c index 7a4f0f3..9e0f665 100644 --- a/drivers/video/cfb_console.c +++ b/drivers/video/cfb_console.c @@ -773,9 +773,54 @@ static void console_back(void) CURSOR_SET; }
-static void console_newline(void) +static void console_cursor_fix(void) { - console_row++; + if (console_row < 0) + console_row = 0; + if (console_row >= CONSOLE_ROWS) + console_row = CONSOLE_ROWS-1; + if (console_col < 0) + console_col = 0; + if (console_col >= CONSOLE_COLS) + console_col = CONSOLE_COLS-1; +} + +static void console_cursor_up(int n) +{ + console_row -= n; + console_cursor_fix(); +} + +static void console_cursor_down(int n) +{ + console_row += n; + console_cursor_fix(); +} + +static void console_cursor_left(int n) +{ + console_col -= n; + console_cursor_fix(); +} + +static void console_cursor_right(int n) +{ + console_col += n; + console_cursor_fix(); +} + +static void console_cursor_set_position(int row, int col) +{ + if (console_row != -1) + console_row = row; + if (console_col != -1) + console_col = col; + console_cursor_fix(); +} + +static void console_newline(int n) +{ + console_row += n; console_col = 0;
/* Check if we need to scroll the terminal */ @@ -784,10 +829,17 @@ static void console_newline(void) console_scrollup();
/* Decrement row number */ - console_row--; + console_row = CONSOLE_ROWS-1; } }
+static void console_previewsline(int n) +{ + /* FIXME: also scroll terminal ? */ + console_row -= n; + console_cursor_fix(); +} + static void console_cr(void) { console_col = 0; @@ -806,7 +858,7 @@ void video_putc(const char c)
case '\n': /* next line */ if (console_col || (!console_col && nl)) - console_newline(); + console_newline(1); nl = 1; break;
@@ -815,7 +867,7 @@ void video_putc(const char c) console_col &= ~0x0007;
if (console_col >= CONSOLE_COLS) - console_newline(); + console_newline(1); break;
case 8: /* backspace */ @@ -829,7 +881,7 @@ void video_putc(const char c)
/* check for newline */ if (console_col >= CONSOLE_COLS) { - console_newline(); + console_newline(1); nl = 0; } }

On Saturday 17 December 2011 12:03:11 Pali Rohár wrote:
- console_cursor_fix - check and fix cursor position (if it is not out of
screen) * console_cursor_up, console_cursor_down, console_cursor_left, console_cursor_right and console_cursor_set_position for changing cursor position * console_newline - added param to specify count of creating new lines * console_previewsline - opposite of console_newline
you need to line wrap your changelogs -mike

* This patch add support for cursor move and reverse colors via ANSI espace codes in cfb_console driver * ANSI escape codes can be enabled/disabled via CONFIG_CFB_CONSOLE_ANSI
Signed-off-by: Pali Rohár pali.rohar@gmail.com --- drivers/video/cfb_console.c | 205 ++++++++++++++++++++++++++++++++++++++++++- 1 files changed, 204 insertions(+), 1 deletions(-)
diff --git a/drivers/video/cfb_console.c b/drivers/video/cfb_console.c index 9e0f665..845efde 100644 --- a/drivers/video/cfb_console.c +++ b/drivers/video/cfb_console.c @@ -377,6 +377,10 @@ static int console_row; /* cursor row */
static u32 eorx, fgx, bgx; /* color pats */
+static char ansi_buf[10] = { 0, }; +static int ansi_buf_size = 0; +static int ansi_colors_need_revert = 0; + static const int video_font_draw_table8[] = { 0x00000000, 0x000000ff, 0x0000ff00, 0x0000ffff, 0x00ff0000, 0x00ff00ff, 0x00ffff00, 0x00ffffff, @@ -845,7 +849,7 @@ static void console_cr(void) console_col = 0; }
-void video_putc(const char c) +static void parse_putc(const char c) { static int nl = 1;
@@ -888,6 +892,205 @@ void video_putc(const char c) CURSOR_SET; }
+void video_putc(const char c) +{ +#ifdef CONFIG_CFB_CONSOLE_ANSI + int i; + + if (c == 27) { + for (i = 0; i < ansi_buf_size; ++i) + parse_putc(ansi_buf[i]); + ansi_buf[0] = 27; + ansi_buf_size = 1; + return; + } + + if (ansi_buf_size > 0) { + /* + 0 - ESC + 1 - [ + 2 - num1 + 3 - .. + 4 - ; + 5 - num2 + 6 - .. + 7 - cchar + */ + int next = 0; + + int flush = 0; + int fail = 0; + + int num1 = 0; + int num2 = 0; + int cchar = 0; + + ansi_buf[ansi_buf_size++] = c; + + if (ansi_buf_size >= sizeof (ansi_buf)) + fail = 1; + + for (i = 0; i < ansi_buf_size; ++i) { + if (fail) + break; + + switch (next) { + case 0: + if (ansi_buf[i] == 27) + next = 1; + else + fail = 1; + break; + + case 1: + if (ansi_buf[i] == '[') + next = 2; + else + fail = 1; + break; + + case 2: + if (ansi_buf[i] >= '0' && ansi_buf[i] <= '9') { + num1 = ansi_buf[i]-'0'; + next = 3; + } else { + --i; + num1 = 1; + next = 4; + } + break; + + case 3: + if (ansi_buf[i] >= '0' && ansi_buf[i] <= '9') { + num1 *= 10; + num1 += ansi_buf[i]-'0'; + } else { + --i; + next = 4; + } + break; + + case 4: + if (ansi_buf[i] != ';') { + --i; + next = 7; + } else + next = 5; + break; + + case 5: + if (ansi_buf[i] >= '0' && ansi_buf[i] <= '9') { + num2 = ansi_buf[i]-'0'; + next = 6; + } else + fail = 1; + break; + + case 6: + if (ansi_buf[i] >= '0' && ansi_buf[i] <= '9') { + num2 *= 10; + num2 += ansi_buf[i]-'0'; + } else { + --i; + next = 7; + } + break; + + case 7: + if ((ansi_buf[i] >= 'A' && ansi_buf[i] <= 'H') || ansi_buf[i] == 'J' || ansi_buf[i] == 'K' || ansi_buf[i] == 'm') { + cchar = ansi_buf[i]; + flush = 1; + } else + fail = 1; + break; + } + } + + if (fail) + { + for (i = 0; i < ansi_buf_size; ++i) + parse_putc(ansi_buf[i]); + ansi_buf_size = 0; + return; + } + + if (flush) + { + CURSOR_OFF; + ansi_buf_size = 0; + switch (cchar) { + case 'A': + /* move cursor num1 rows up */ + console_cursor_up(num1); + break; + case 'B': + /* move cursor num1 rows down */ + console_cursor_down(num1); + break; + case 'C': + /* move cursor num1 columns forward */ + console_cursor_right(num1); + break; + case 'D': + /* move cursor num1 columns back */ + console_cursor_left(num1); + break; + case 'E': + /* move cursor num1 rows up at begin of row */ + console_previewsline(num1); + break; + case 'F': + /* move cursor num1 rows down at begin of row */ + console_newline(num1); + break; + case 'G': + /* move cursor to column num1 */ + console_cursor_set_position(-1, num1-1); + break; + case 'H': + /* move cursor to row num1, column num2 */ + console_cursor_set_position(num1-1, num2-1); + break; + case 'J': + /* clear console and move cursor to 0, 0 */ + console_clear(); + console_cursor_set_position(0, 0); + break; + case 'K': + /* clear line */ + if (num1 == 0) + console_clear_line(console_row, console_col, CONSOLE_COLS-1); + else if (num1 == 1) + console_clear_line(console_row, 0, console_col); + else + console_clear_line(console_row, 0, CONSOLE_COLS-1); + break; + case 'm': + if (num1 == 0) { /* reset swapped colors */ + if (ansi_colors_need_revert) { + console_swap_colors(); + ansi_colors_need_revert = 0; + } + } else if (num1 == 7) { /* swap colors (only once) */ + if (!ansi_colors_need_revert) { + console_swap_colors(); + ansi_colors_need_revert = 1; + } + } + break; + } + CURSOR_SET; + } + } + else + { + parse_putc(c); + } +#else + parse_putc(c); +#endif +} + void video_puts(const char *s) { int count = strlen(s);

On Saturday 17 December 2011 12:03:12 Pali Rohár wrote:
- This patch add support for cursor move and reverse colors via ANSI
espace codes in cfb_console driver * ANSI escape codes can be enabled/disabled via CONFIG_CFB_CONSOLE_ANSI
your changelog needs to be line wrapped
case 7:
if ((ansi_buf[i] >= 'A' && ansi_buf[i] <= 'H') ||
ansi_buf[i] == 'J'
|| ansi_buf[i] == 'K' || ansi_buf[i] == 'm') { + cchar
= ansi_buf[i];
this line is way too long -mike

From: Marcel Mol marcel@mesa.nl
* Command can be enabled by CONFIG_CMD_CLR
Signed-off-by: Pali Rohár pali.rohar@gmail.com --- common/Makefile | 1 + common/cmd_clr.c | 38 ++++++++++++++++++++++++++++++++++++++ include/config_cmd_all.h | 1 + 3 files changed, 40 insertions(+), 0 deletions(-) create mode 100644 common/cmd_clr.c
diff --git a/common/Makefile b/common/Makefile index 2d9ae8c..0552f19 100644 --- a/common/Makefile +++ b/common/Makefile @@ -69,6 +69,7 @@ COBJS-$(CONFIG_CMD_BEDBUG) += bedbug.o cmd_bedbug.o COBJS-$(CONFIG_CMD_BMP) += cmd_bmp.o COBJS-$(CONFIG_CMD_BOOTLDR) += cmd_bootldr.o COBJS-$(CONFIG_CMD_CACHE) += cmd_cache.o +COBJS-$(CONFIG_CMD_CLR) += cmd_clr.o COBJS-$(CONFIG_CMD_CONSOLE) += cmd_console.o COBJS-$(CONFIG_CMD_CPLBINFO) += cmd_cplbinfo.o COBJS-$(CONFIG_DATAFLASH_MMC_SELECT) += cmd_dataflash_mmc_mux.o diff --git a/common/cmd_clr.c b/common/cmd_clr.c new file mode 100644 index 0000000..5077bbb --- /dev/null +++ b/common/cmd_clr.c @@ -0,0 +1,38 @@ +/* + * Copyright 2011 + * Marcel Mol, MESA Consulting, marcel@mesa.nl + * + * 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 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 + */ + +#include <common.h> +#include <command.h> + +int do_clr(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) +{ + printf(ANSI_CLEAR_CONSOLE); + return 0; +} + +U_BOOT_CMD( + clr, CONFIG_SYS_MAXARGS, 1, do_clr, + "clr", + "\n" + " - clear screen and move cursor to top of screen" +); diff --git a/include/config_cmd_all.h b/include/config_cmd_all.h index 9716f9c..f3c49ed 100644 --- a/include/config_cmd_all.h +++ b/include/config_cmd_all.h @@ -23,6 +23,7 @@ #define CONFIG_CMD_BSP /* Board Specific functions */ #define CONFIG_CMD_CACHE /* icache, dcache */ #define CONFIG_CMD_CDP /* Cisco Discovery Protocol */ +#define CONFIG_CMD_CLR /* ANSI clear screen command */ #define CONFIG_CMD_CONSOLE /* coninfo */ #define CONFIG_CMD_DATE /* support for RTC, date/time...*/ #define CONFIG_CMD_DHCP /* DHCP Support */

On Saturday 17 December 2011 12:03:13 Pali Rohár wrote:
--- /dev/null +++ b/common/cmd_clr.c
+int do_clr(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
static
- printf(ANSI_CLEAR_CONSOLE);
puts()
+U_BOOT_CMD(
- clr, CONFIG_SYS_MAXARGS, 1, do_clr,
- "clr",
- "\n"
- " - clear screen and move cursor to top of screen"
+);
"clr" is unusual. name it "clear" instead. that's what all the standard *nix systems use after all. -mike

On Sunday 18 December 2011 13:56:12 Mike Frysinger wrote:
On Saturday 17 December 2011 12:03:13 Pali Rohár wrote:
--- /dev/null +++ b/common/cmd_clr.c
+int do_clr(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
static
- printf(ANSI_CLEAR_CONSOLE);
puts()
puts(s) will output s + '\n'. And we do not want newline after clear screen.
+U_BOOT_CMD(
- clr, CONFIG_SYS_MAXARGS, 1, do_clr,
- "clr",
- "\n"
- " - clear screen and move cursor to top of screen"
+);
"clr" is unusual. name it "clear" instead. that's what all the standard *nix systems use after all. -mike
ok, I will rename clr to clear.

On Sunday 18 December 2011 14:20:35 Pali Rohár wrote:
On Sunday 18 December 2011 13:56:12 Mike Frysinger wrote:
On Saturday 17 December 2011 12:03:13 Pali Rohár wrote:
--- /dev/null +++ b/common/cmd_clr.c
+int do_clr(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
static
- printf(ANSI_CLEAR_CONSOLE);
puts()
puts(s) will output s + '\n'. And we do not want newline after clear screen.
no it won't. u-boot's puts() is diff from the POSIX puts(). -mike

* If defined CONFIG_MENUCMD and CONFIG_MENUKEY to 0 run env "menu_cmd" if key any pressed * If defined CONFIG_MENUCMD and other CONFIG_MENUKEY run env "menu_cmd" if key pressed is save as CONFIG_MENUKEY * If defined CONFIG_MENUCMD and not CONFIG_MENUKEY run env "menu_cmd" always * If not defined CONFIG_MENUCMD do nothing * CONFIG_MENUKEY working only if defined CONFIG_MENUCMD and CONFIG_BOOTDELAY >= 0
Signed-off-by: Pali Rohár pali.rohar@gmail.com --- common/main.c | 32 +++++++++++++++++++++----------- 1 files changed, 21 insertions(+), 11 deletions(-)
diff --git a/common/main.c b/common/main.c index 5531130..fc80317 100644 --- a/common/main.c +++ b/common/main.c @@ -82,6 +82,19 @@ int do_mdm_init = 0; extern void mdm_init(void); /* defined in board.c */ #endif
+#if defined (CONFIG_MENUKEY) && ! defined (CONFIG_MENUCMD) && ( ! defined(CONFIG_BOOTDELAY) || CONFIG_BOOTDELAY < 0 ) +#error CONFIG_MENUKEY is defined, but not CONFIG_MENUCMD and/or CONFIG_BOOTDELAY >= 0 +#error define CONFIG_MENUCMD and CONFIG_BOOTDELAY too +#endif + +#ifdef CONFIG_MENUCMD +# ifdef CONFIG_MENUKEY +static int menucmd = 0; +# else +static int menucmd = 1; +# endif +#endif + /*************************************************************************** * Watch for 'delay' seconds for autoboot stop or autoboot delay string. * returns: 0 - no key string, allow autoboot 1 - got key string, abort @@ -201,10 +214,6 @@ int abortboot(int bootdelay)
# else /* !defined(CONFIG_AUTOBOOT_KEYED) */
-#ifdef CONFIG_MENUKEY -static int menukey = 0; -#endif - #ifndef CONFIG_MENU static inline #endif @@ -241,8 +250,9 @@ int abortboot(int bootdelay) if (tstc()) { /* we got a key press */ abort = 1; /* don't auto boot */ bootdelay = 0; /* no more delay */ -# ifdef CONFIG_MENUKEY - menukey = getc(); +# if defined (CONFIG_MENUCMD) && defined (CONFIG_MENUKEY) + if (CONFIG_MENUKEY == 0 || CONFIG_MENUKEY == getc()) + menucmd = 1; # else (void) getc(); /* consume input */ # endif @@ -292,6 +302,7 @@ int run_command2(const char *cmd, int flag)
void main_loop (void) { + char *s; #ifndef CONFIG_SYS_HUSH_PARSER static char lastcommand[CONFIG_SYS_CBSIZE] = { 0, }; int len; @@ -300,7 +311,6 @@ void main_loop (void) #endif
#if defined(CONFIG_BOOTDELAY) && (CONFIG_BOOTDELAY >= 0) - char *s; int bootdelay; #endif #ifdef CONFIG_PREBOOT @@ -405,15 +415,15 @@ void main_loop (void) disable_ctrlc(prev); /* restore Control C checking */ # endif } +#endif /* CONFIG_BOOTDELAY */
-# ifdef CONFIG_MENUKEY - if (menukey == CONFIG_MENUKEY) { +#ifdef CONFIG_MENUCMD + if (menucmd == 1) { s = getenv("menucmd"); if (s) run_command2(s, 0); } -#endif /* CONFIG_MENUKEY */ -#endif /* CONFIG_BOOTDELAY */ +#endif
/* * Main Loop for Monitor Command Processing

* if defined run env "premonitor" before Main Loop for Monitor Command Processing
Signed-off-by: Pali Rohár pali.rohar@gmail.com --- common/env_common.c | 3 +++ common/main.c | 10 ++++++++++ 2 files changed, 13 insertions(+), 0 deletions(-)
diff --git a/common/env_common.c b/common/env_common.c index 8a71096..1ef8ecc 100644 --- a/common/env_common.c +++ b/common/env_common.c @@ -92,6 +92,9 @@ const uchar default_environment[] = { #ifdef CONFIG_PREBOOT "preboot=" CONFIG_PREBOOT "\0" #endif +#ifdef CONFIG_PREMONITOR + "premonitor=" CONFIG_PREMONITOR "\0" +#endif #ifdef CONFIG_ROOTPATH "rootpath=" CONFIG_ROOTPATH "\0" #endif diff --git a/common/main.c b/common/main.c index fc80317..3dd9fc7 100644 --- a/common/main.c +++ b/common/main.c @@ -425,6 +425,16 @@ void main_loop (void) } #endif
+#ifdef CONFIG_PREMONITOR + if ((s = getenv ("premonitor")) != NULL) { +# ifndef CONFIG_SYS_HUSH_PARSER + run_command (s, 0); +# else + parse_string_outer(s, FLAG_PARSE_SEMICOLON | FLAG_EXIT_FROM_LOOP); +# endif + } +#endif /* CONFIG_PREMONITOR */ + /* * Main Loop for Monitor Command Processing */

On Saturday 17 December 2011 12:03:15 Pali Rohár wrote:
--- a/common/env_common.c +++ b/common/env_common.c
+#ifdef CONFIG_PREMONITOR
- "premonitor=" CONFIG_PREMONITOR "\0"
+#endif
--- a/common/main.c +++ b/common/main.c
+#ifdef CONFIG_PREMONITOR
- if ((s = getenv ("premonitor")) != NULL) {
i don't these should be the same define. one is to control the default env var value only. i would just drop the check in main.c.
+# ifndef CONFIG_SYS_HUSH_PARSER
run_command (s, 0);
no space before the "(" -mike

On Sunday 18 December 2011 14:05:17 Mike Frysinger wrote:
On Saturday 17 December 2011 12:03:15 Pali Rohár wrote:
--- a/common/env_common.c +++ b/common/env_common.c
+#ifdef CONFIG_PREMONITOR
- "premonitor=" CONFIG_PREMONITOR "\0"
+#endif
--- a/common/main.c +++ b/common/main.c
+#ifdef CONFIG_PREMONITOR
- if ((s = getenv ("premonitor")) != NULL) {
i don't these should be the same define. one is to control the default env var value only. i would just drop the check in main.c.
+# ifndef CONFIG_SYS_HUSH_PARSER
run_command (s, 0);
no space before the "(" -mike
So do you think that I should delete changes in env_common.c and add to main.c only this code?
+#ifdef CONFIG_PREMONITOR + run_command2(CONFIG_PREMONITOR, 0); +#endif

On Sunday 18 December 2011 14:37:12 Pali Rohár wrote:
On Sunday 18 December 2011 14:05:17 Mike Frysinger wrote:
On Saturday 17 December 2011 12:03:15 Pali Rohár wrote:
--- a/common/env_common.c +++ b/common/env_common.c
+#ifdef CONFIG_PREMONITOR
- "premonitor=" CONFIG_PREMONITOR "\0"
+#endif
--- a/common/main.c +++ b/common/main.c
+#ifdef CONFIG_PREMONITOR
- if ((s = getenv ("premonitor")) != NULL) {
i don't these should be the same define. one is to control the default env var value only. i would just drop the check in main.c.
So do you think that I should delete changes in env_common.c and add to main.c only this code?
i mean keep the code in env_common.c, and delete the "#ifdef CONFIG_PREMONITOR" line from main.c -mike

On Sunday 18 December 2011 15:08:30 Mike Frysinger wrote:
On Sunday 18 December 2011 14:37:12 Pali Rohár wrote:
On Sunday 18 December 2011 14:05:17 Mike Frysinger wrote:
On Saturday 17 December 2011 12:03:15 Pali Rohár wrote:
--- a/common/env_common.c +++ b/common/env_common.c
+#ifdef CONFIG_PREMONITOR
- "premonitor=" CONFIG_PREMONITOR "\0"
+#endif
--- a/common/main.c +++ b/common/main.c
+#ifdef CONFIG_PREMONITOR
- if ((s = getenv ("premonitor")) != NULL) {
i don't these should be the same define. one is to control the default env var value only. i would just drop the check in main.c.
So do you think that I should delete changes in env_common.c and add to main.c only this code?
i mean keep the code in env_common.c, and delete the "#ifdef CONFIG_PREMONITOR" line from main.c -mike
Ok.

This board definition results in a u-boot.bin which can be chainloaded from NOLO in qemu or on a real N900. It does very little hardware config because NOLO has already configured the board. Only needed is enabling internal eMMC memory via twl4030 regulator which is not enabled by NOLO.
NOLO is expecting a kernel image and will treat any image it finds in onenand as such. This u-boot is intended to be flashed to the N900 like a kernel. In order to transparently boot the original kernel, it will be appended to u-boot.bin at 0x40000. NOLO will load the entire image into memory and execute u-boot, which saves the ATAGs set by NOLO. Then the bootscripts will attempt to load uImage or boot.scr from a fat or ext2 filesystem in external SD card or internal eMMC memory. If this fails or keyboard is closed the appended kernel image will be booted using the stored ATAGs (see boot order).
There is support for hardware watchdog. It is started by NOLO so u-boot must kick watchdog to prevent reboot device (but not very often, max every 2 seconds). There is also support for framebuffer display output with ANSI espace codes and the N900 HW keyboard input. USB tty works but is disabled because it prevents the current Maemo kernel from booting.
Based on previous work by: Alistair Buxton a.j.buxton@gmail.com
Default boot order:
* 0. if keyboard is closed boot automatically NOLO kernel image * 1. try boot from external SD card * 2. try boot from internal eMMC memory * 3. try boot from attached NOLO kernel image
Boot from SD or eMMC in this order:
* find boot.scr on first fat partition * find uImage on first fat parition * same order for 2. - 4. fat partition
* find boot.scr on first ext2 partition * find uImage on first ext2 parition * same order for 2. - 4. ext2 partition
Available additional commands/variables:
* run sercon - Use serial port for control * run usbcon - Use usbtty for control * run vgacon - Use framebuffer and HW keyboard for control (default) * run emmcboot - Boot from external SD card (see boot order) * run immcboot - Boot from internal eMMC memory (see boot order) * run noloboot - Boot NOLO kernel image (attached to U-Boot binary) * run scriptload - Load boot script: mmc ${mmcnum} (0 - external, 1 - internal), partition number ${mmcpart} (1 - 4), parition type ${mmctype} (fat, ext2), file name ${mmcfile} * run scriptboot - Run loaded boot script (see scriptload) * run uimageload - Load kernel image: mmc ${mmcnum} (0 - external, 1 - internal), partition number ${mmcpart} (1 - 4), parition type ${mmctype} (fat, ext2), file name ${mmcfile} * run uimageboot - Boot kernel image (see uimageload)
Signed-off-by: Pali Rohár pali.rohar@gmail.com --- board/nokia/rx51/Makefile | 50 +++++ board/nokia/rx51/rx51.c | 427 ++++++++++++++++++++++++++++++++++++++++++ board/nokia/rx51/rx51.h | 372 ++++++++++++++++++++++++++++++++++++ boards.cfg | 1 + include/configs/nokia_rx51.h | 317 +++++++++++++++++++++++++++++++ 5 files changed, 1167 insertions(+), 0 deletions(-) create mode 100644 board/nokia/rx51/Makefile create mode 100644 board/nokia/rx51/rx51.c create mode 100644 board/nokia/rx51/rx51.h create mode 100644 include/configs/nokia_rx51.h
diff --git a/board/nokia/rx51/Makefile b/board/nokia/rx51/Makefile new file mode 100644 index 0000000..92a0c9a --- /dev/null +++ b/board/nokia/rx51/Makefile @@ -0,0 +1,50 @@ +# +# (C) Copyright 2000, 2001, 2002 +# Wolfgang Denk, DENX Software Engineering, wd@denx.de. +# +# 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 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 +# + +include $(TOPDIR)/config.mk + +LIB = $(obj)lib$(BOARD).o + +COBJS-y := $(BOARD).o + +COBJS := $(sort $(COBJS-y)) +SRCS := $(COBJS:.o=.c) +OBJS := $(addprefix $(obj),$(COBJS)) + +$(LIB): $(obj).depend $(OBJS) + $(call cmd_link_o_target, $(OBJS)) + +clean: + rm -f $(OBJS) + +distclean: clean + rm -f $(LIB) core *.bak $(obj).depend + +######################################################################### + +# defines $(obj).depend target +include $(SRCTREE)/rules.mk + +sinclude $(obj).depend + +######################################################################### diff --git a/board/nokia/rx51/rx51.c b/board/nokia/rx51/rx51.c new file mode 100644 index 0000000..016156e --- /dev/null +++ b/board/nokia/rx51/rx51.c @@ -0,0 +1,427 @@ +/* + * (C) Copyright 2011 + * Pali Rohár pali.rohar@gmail.com + * + * (C) Copyright 2010 + * Alistair Buxton a.j.buxton@gmail.com + * + * Derived from Beagle Board and 3430 SDP code: + * (C) Copyright 2004-2008 + * Texas Instruments, <www.ti.com> + * + * Author : + * Sunil Kumar sunilsaini05@gmail.com + * Shashi Ranjan shashiranjanmca05@gmail.com + * + * Richard Woodruff r-woodruff2@ti.com + * Syed Mohammed Khasim khasim@ti.com + * + * 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 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 + */ + +#include <common.h> +#include <twl4030.h> +#include <i2c.h> +#include <video_fb.h> +#include <asm/io.h> +#include <asm/bitops.h> +#include <asm/gpio.h> +#include <asm/mach-types.h> +#include <asm/arch/mux.h> +#include <asm/arch/sys_proto.h> +#include <asm/arch/mmc_host_def.h> + +#include "rx51.h" + +#define stringify(s) tostring(s) +#define tostring(s) #s + +DECLARE_GLOBAL_DATA_PTR; + +GraphicDevice gdev; + +extern u32 rx51_atagaddr; /* atag address */ +extern u32 rx51_kernaddr; /* attached kernel address */ + +const omap3_sysinfo sysinfo = { + DDR_STACKED, + "Nokia RX-51", + "" +}; + +/* + * Routine: save_boot_params (called after reset from start.S) + * Description: Save atag address and attached kernel address. + * Move u-boot to address CONFIG_SYS_TEXT_BASE + */ +asm( +"startaddr:\n" /* address where should be u-boot after relocation */ +" .word " stringify(CONFIG_SYS_TEXT_BASE) "\n" +"relocaddr:\n" /* address of this relocaddr section after relocation */ +" .word .\n" /* dot - address of this section (calculated at compile time, so same as after relocation) */ +".global rx51_atagaddr\n" +"rx51_atagaddr:\n" +"atagaddr:\n" /* stored atag address (r2) */ +" .word 0x0\n" +".global rx51_kernaddr\n" +"rx51_kernaddr:\n" +"kernaddr:\n" /* stored attached kernel address (u-boot + 0x40000) */ +" .word 0x80048000\n" +".global save_boot_params\n" +"save_boot_params:\n" /* function save_boot_params, called after reset */ + /* r2 - address of atag (set by NOLO) */ +" adr r0, relocaddr\n" /* r0 - address of section relocaddr */ +" ldr r1, relocaddr\n" /* r1 - address where should be this relocaddr section after relocation */ +" sub r0, r0, r1\n" /* r1 - calculated offset for relocation */ +" ldr r1, startaddr\n" /* r1 - address where u-boot should be after relocation */ +" add r0, r0, r1\n" /* r0 - address where is u-boot (address after relocation + offset) */ + +" cmp r0, r1\n" +" bne reloc\n" /* start relocation if u-boot is not loaded at correct address CONFIG_SYS_TEXT_BASE */ +" bx lr\n" /* else return back to reset section (relocation is not needed) */ + +"reloc:\n" +" str r2, atagaddr\n" /* store atag address to memory */ +" add r2, r0, #0x40000\n" /* r2 - address where is attached kernel (u-boot address + kernel offset 0x40000) - also end address of u-boot */ +" str r2, kernaddr\n" /* store kernel address to memory */ + +"loop:\n" +" ldmia r0!, {r3 - r10}\n" /* copy from source address (r0) */ +" stmia r1!, {r3 - r10}\n" /* copy to destination address (r1) */ +" cmp r0, r2\n" +" bne loop\n" /* until end of source address (r2) */ + +" ldr r2, atagaddr\n" /* revert back address of atag to r2 */ +" ldr pc, startaddr\n" /* jump to start section (where should be u-boot after relocation) and restart u-boot */ +); + +/* + * Routine: board_init + * Description: Early hardware init. + */ +int board_init(void) +{ + gpmc_init(); /* in SRAM or SDRAM, finish GPMC */ + /* board id for Linux */ + gd->bd->bi_arch_number = MACH_TYPE_NOKIA_RX51; + /* boot param addr */ + gd->bd->bi_boot_params = (OMAP34XX_SDRC_CS0 + 0x100); + + return 0; +} + +/* + * Routine: video_hw_init + * Description: Set up the GraphicDevice depending on sys_boot. + */ +void *video_hw_init(void) +{ + /* fill in Graphic Device */ + gdev.frameAdrs = 0x8f9c0000; + gdev.winSizeX = 800; + gdev.winSizeY = 480; + gdev.gdfBytesPP = 2; + gdev.gdfIndex = GDF_16BIT_565RGB; + memset((void *)gdev.frameAdrs, 0, 0xbb800); + return (void *) &gdev; +} + +/* + * Routine: twl4030_regulator_set_mode + * Description: Set twl4030 regulator mode over i2c powerbus. + */ +static void twl4030_regulator_set_mode(u8 id, u8 mode) +{ + u16 msg = MSG_SINGULAR(DEV_GRP_P1, id, mode); + twl4030_i2c_write_u8(TWL4030_CHIP_PM_MASTER, msg >> 8, TWL4030_PM_MASTER_PB_WORD_MSB); + twl4030_i2c_write_u8(TWL4030_CHIP_PM_MASTER, msg & 0xff, TWL4030_PM_MASTER_PB_WORD_LSB); +} + +/* + * Routine: misc_init_r + * Description: Configure board specific parts. + */ +int misc_init_r(void) +{ + unsigned int slide_sw; + char buf[12]; + + sprintf(buf, "%#x", rx51_kernaddr); + setenv("init_kernaddr", buf); + sprintf(buf, "%#x", rx51_atagaddr); + setenv("init_atagaddr", buf); + + /* initialize twl4030 power managment */ + twl4030_power_init(); + + /* set VSIM to 1.8V */ + twl4030_pmrecv_vsel_cfg(TWL4030_PM_RECEIVER_VSIM_DEDICATED, + TWL4030_PM_RECEIVER_VSIM_VSEL_18, + TWL4030_PM_RECEIVER_VSIM_DEV_GRP, + TWL4030_PM_RECEIVER_DEV_GRP_P1); + + /* enable I2C access to powerbus (needed for twl4030 regulator) */ + twl4030_i2c_write_u8(TWL4030_CHIP_PM_MASTER, 0x02, TWL4030_PM_MASTER_PB_CFG); + + /* set VAUX3, VSIM and VMMC1 state to active - enable eMMC memory */ + twl4030_regulator_set_mode(RES_VAUX3, RES_STATE_ACTIVE); + twl4030_regulator_set_mode(RES_VSIM, RES_STATE_ACTIVE); + twl4030_regulator_set_mode(RES_VMMC1, RES_STATE_ACTIVE); + + /* set environment variable slide_sw if keyboard slide is open/close */ + gpio_direction_input(71); + slide_sw = gpio_get_value(71); + gpio_free(71); + setenv("slide_sw", slide_sw ? "close" : "open"); + + dieid_num_r(); + + return 0; +} + +/* + * Routine: set_muxconf_regs + * Description: Setting up the configuration Mux registers specific to the + * hardware. Many pins need to be moved from protect to primary + * mode. + */ +void set_muxconf_regs(void) +{ + MUX_RX51(); +} + +static unsigned long int twl_wd_time = 0; /* last time of watchdog reset */ +static volatile unsigned long int twl_i2c_lock; + +/* + * Routine: hw_watchdog_reset + * Description: Reset timeout of twl4030 watchdog. + */ +void hw_watchdog_reset(void) +{ + u8 timeout = 0; + + /* do not reset watchdog too often - max every 4s */ + if ( get_timer(twl_wd_time) < 4 * CONFIG_SYS_HZ ) + return; + + /* localy lock twl4030 i2c bus */ + if ( test_and_set_bit(0, &twl_i2c_lock) ) + return; + + /* read actual watchdog timeout */ + twl4030_i2c_read_u8(TWL4030_CHIP_PM_RECEIVER, &timeout, TWL4030_PM_RECEIVER_WATCHDOG_CFG); + + /* timeout 0 means watchdog is disabled */ + /* reset watchdog timeout to 31s (maximum) */ + if ( timeout != 0 ) + twl4030_i2c_write_u8(TWL4030_CHIP_PM_RECEIVER, 31, TWL4030_PM_RECEIVER_WATCHDOG_CFG); + + /* store last watchdog reset time */ + twl_wd_time = get_timer(0); + + /* localy unlock twl4030 i2c bus */ + test_and_clear_bit(0, &twl_i2c_lock); +} + +/* + * TWL4030 keypad handler for cfb_console + */ + +static const char keymap[] = { + /* normal */ + 'q', 'o', 'p', ',', '\b', 0, 'a', 's', + 'w', 'd', 'f', 'g', 'h', 'j', 'k', 'l', + 'e', '.', 0, '\r', 0, 'z', 'x', 'c', + 'r', 'v', 'b', 'n', 'm', ' ', ' ', 0, + 't', 0, 0, 0, 0, 0, 0, 0, + 'y', 0, 0, 0, 0, 0, 0, 0, + 'u', 0, 0, 0, 0, 0, 0, 0, + 'i', 5, 6, 0, 0, 0, 0, 0, + /* fn */ + '1', '9', '0', '=', '\b', 0, '*', '+', + '2', '#', '-', '_', '(', ')', '&', '!', + '3', '?', '^', '\r', 0, 156, '$', 238, + '4', '/', '\', '"', ''', '@', 0, '<', + '5', '|', '>', 0, 0, 0, 0, 0, + '6', 0, 0, 0, 0, 0, 0, 0, + '7', 0, 0, 0, 0, 0, 0, 0, + '8', 16, 17, 0, 0, 0, 0, 0, +}; + +static u8 keys[8]; +static u8 old_keys[8] = {0, 0, 0, 0, 0, 0, 0, 0}; +#define KEYBUF_SIZE 32 +static u8 keybuf[KEYBUF_SIZE]; +static u8 keybuf_head = 0; +static u8 keybuf_tail = 0; + +/* + * Routine: rx51_kp_init + * Description: Initialize HW keyboard. + */ +int rx51_kp_init(void) +{ + int ret = 0; + u8 ctrl; + ret = twl4030_i2c_read_u8(TWL4030_CHIP_KEYPAD, &ctrl, + TWL4030_KEYPAD_KEYP_CTRL_REG); + + if (!ret) { + /* turn on keyboard and use hardware scanning */ + ctrl |= TWL4030_KEYPAD_CTRL_KBD_ON; + ctrl |= TWL4030_KEYPAD_CTRL_SOFT_NRST; + ctrl |= TWL4030_KEYPAD_CTRL_SOFTMODEN; + ret |= twl4030_i2c_write_u8(TWL4030_CHIP_KEYPAD, ctrl, + TWL4030_KEYPAD_KEYP_CTRL_REG); + /* enable key event status */ + ret |= twl4030_i2c_write_u8(TWL4030_CHIP_KEYPAD, 0xfe, + TWL4030_KEYPAD_KEYP_IMR1); + /* enable interrupt generation on rising and falling */ + /* this is a workaround for qemu twl4030 emulation */ + ret |= twl4030_i2c_write_u8(TWL4030_CHIP_KEYPAD, 0x57, + TWL4030_KEYPAD_KEYP_EDR); + /* enable ISR clear on read */ + ret |= twl4030_i2c_write_u8(TWL4030_CHIP_KEYPAD, 0x05, + TWL4030_KEYPAD_KEYP_SIH_CTRL); + } + return ret; +} + +static void rx51_kp_fill(u8 k, u8 mods) +{ + if (!(mods & 2) && (k == 18 || k == 31 || k == 33 || k == 34)) { /* cursor keys, without fn */ + keybuf[keybuf_tail++] = '\e'; + keybuf_tail %= KEYBUF_SIZE; + keybuf[keybuf_tail++] = '['; + keybuf_tail %= KEYBUF_SIZE; + keybuf[keybuf_tail++] = '1'; + if (k == 18) /* up */ + keybuf[keybuf_tail++] = 'A'; + else if (k == 31) /* left */ + keybuf[keybuf_tail++] = 'D'; + else if (k == 33) /* down */ + keybuf[keybuf_tail++] = 'B'; + else if (k == 34) /* right */ + keybuf[keybuf_tail++] = 'C'; + keybuf_tail %= KEYBUF_SIZE; + return; + } + + if (mods & 2) { /* fn */ + k = keymap[k+64]; + } else { + k = keymap[k]; + if (mods & 1) { /* ctrl */ + if (k >= 'a' && k <= 'z') + k -= 'a' - 1; + } + if (mods & 4) { /* shift */ + if (k >= 'a' && k <= 'z') + k += 'A' - 'a'; + else if (k == '.') + k = ':'; + else if (k == ',') + k = ';'; + } + } + keybuf[keybuf_tail++] = k; + keybuf_tail %= KEYBUF_SIZE; +} + +/* + * Routine: rx51_kp_tstc + * Description: Test if key was pressed (from buffer). + */ +int rx51_kp_tstc(void) +{ + u8 c, r, dk, i; + u8 intr; + u8 mods; + + /* localy lock twl4030 i2c bus */ + if ( test_and_set_bit(0, &twl_i2c_lock) ) + return 0; + + /* twl4030 remembers up to 2 events */ + for (i = 0; i < 2; i++) { + + /* check interrupt register for events */ + twl4030_i2c_read_u8(TWL4030_CHIP_KEYPAD, &intr, + TWL4030_KEYPAD_KEYP_ISR1+(2*i)); + + if (intr&1) { /* got an event */ + + /* read the key state */ + i2c_read(TWL4030_CHIP_KEYPAD, + TWL4030_KEYPAD_FULL_CODE_7_0, 1, keys, 8); + + /* cut out modifier keys from the keystate */ + mods = keys[4] >> 4; + keys[4] &= 0x0f; + + for (c = 0; c < 8; c++) { + + /* get newly pressed keys only */ + dk = ((keys[c] ^ old_keys[c])&keys[c]); + old_keys[c] = keys[c]; + + /* fill the keybuf */ + for (r = 0; r < 8; r++) { + if (dk&1) + rx51_kp_fill((c*8)+r, mods); + dk = dk >> 1; + } + + } + + } + + } + + /* localy unlock twl4030 i2c bus */ + test_and_clear_bit(0, &twl_i2c_lock); + + return (KEYBUF_SIZE + keybuf_tail - keybuf_head)%KEYBUF_SIZE; +} + +/* + * Routine: rx51_kp_getc + * Description: Get last pressed key (from buffer). + */ +int rx51_kp_getc(void) +{ + keybuf_head %= KEYBUF_SIZE; + while (!rx51_kp_tstc()) { + udelay(1); + hw_watchdog_reset(); + } + return keybuf[keybuf_head++]; +} + +/* + * Routine: board_mmc_init + * Description: Initialize mmc devices. + */ +int board_mmc_init(bd_t *bis) +{ + omap_mmc_init(0); + omap_mmc_init(1); + return 0; +} diff --git a/board/nokia/rx51/rx51.h b/board/nokia/rx51/rx51.h new file mode 100644 index 0000000..b553cd6 --- /dev/null +++ b/board/nokia/rx51/rx51.h @@ -0,0 +1,372 @@ +/* + * (C) Copyright 2008 + * Dirk Behme dirk.behme@gmail.com + * + * 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 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 _RX51_H_ +#define _RX51_H_ + +/* + * IEN - Input Enable + * IDIS - Input Disable + * PTD - Pull type Down + * PTU - Pull type Up + * DIS - Pull type selection is inactive + * EN - Pull type selection is active + * M0 - Mode 0 + * The commented string gives the final mux configuration for that pin + */ +#define MUX_RX51() \ + /*SDRC*/\ + MUX_VAL(CP(SDRC_D0), (IEN | PTD | DIS | M0)) /*SDRC_D0*/\ + MUX_VAL(CP(SDRC_D1), (IEN | PTD | DIS | M0)) /*SDRC_D1*/\ + MUX_VAL(CP(SDRC_D2), (IEN | PTD | DIS | M0)) /*SDRC_D2*/\ + MUX_VAL(CP(SDRC_D3), (IEN | PTD | DIS | M0)) /*SDRC_D3*/\ + MUX_VAL(CP(SDRC_D4), (IEN | PTD | DIS | M0)) /*SDRC_D4*/\ + MUX_VAL(CP(SDRC_D5), (IEN | PTD | DIS | M0)) /*SDRC_D5*/\ + MUX_VAL(CP(SDRC_D6), (IEN | PTD | DIS | M0)) /*SDRC_D6*/\ + MUX_VAL(CP(SDRC_D7), (IEN | PTD | DIS | M0)) /*SDRC_D7*/\ + MUX_VAL(CP(SDRC_D8), (IEN | PTD | DIS | M0)) /*SDRC_D8*/\ + MUX_VAL(CP(SDRC_D9), (IEN | PTD | DIS | M0)) /*SDRC_D9*/\ + MUX_VAL(CP(SDRC_D10), (IEN | PTD | DIS | M0)) /*SDRC_D10*/\ + MUX_VAL(CP(SDRC_D11), (IEN | PTD | DIS | M0)) /*SDRC_D11*/\ + MUX_VAL(CP(SDRC_D12), (IEN | PTD | DIS | M0)) /*SDRC_D12*/\ + MUX_VAL(CP(SDRC_D13), (IEN | PTD | DIS | M0)) /*SDRC_D13*/\ + MUX_VAL(CP(SDRC_D14), (IEN | PTD | DIS | M0)) /*SDRC_D14*/\ + MUX_VAL(CP(SDRC_D15), (IEN | PTD | DIS | M0)) /*SDRC_D15*/\ + MUX_VAL(CP(SDRC_D16), (IEN | PTD | DIS | M0)) /*SDRC_D16*/\ + MUX_VAL(CP(SDRC_D17), (IEN | PTD | DIS | M0)) /*SDRC_D17*/\ + MUX_VAL(CP(SDRC_D18), (IEN | PTD | DIS | M0)) /*SDRC_D18*/\ + MUX_VAL(CP(SDRC_D19), (IEN | PTD | DIS | M0)) /*SDRC_D19*/\ + MUX_VAL(CP(SDRC_D20), (IEN | PTD | DIS | M0)) /*SDRC_D20*/\ + MUX_VAL(CP(SDRC_D21), (IEN | PTD | DIS | M0)) /*SDRC_D21*/\ + MUX_VAL(CP(SDRC_D22), (IEN | PTD | DIS | M0)) /*SDRC_D22*/\ + MUX_VAL(CP(SDRC_D23), (IEN | PTD | DIS | M0)) /*SDRC_D23*/\ + MUX_VAL(CP(SDRC_D24), (IEN | PTD | DIS | M0)) /*SDRC_D24*/\ + MUX_VAL(CP(SDRC_D25), (IEN | PTD | DIS | M0)) /*SDRC_D25*/\ + MUX_VAL(CP(SDRC_D26), (IEN | PTD | DIS | M0)) /*SDRC_D26*/\ + MUX_VAL(CP(SDRC_D27), (IEN | PTD | DIS | M0)) /*SDRC_D27*/\ + MUX_VAL(CP(SDRC_D28), (IEN | PTD | DIS | M0)) /*SDRC_D28*/\ + MUX_VAL(CP(SDRC_D29), (IEN | PTD | DIS | M0)) /*SDRC_D29*/\ + MUX_VAL(CP(SDRC_D30), (IEN | PTD | DIS | M0)) /*SDRC_D30*/\ + MUX_VAL(CP(SDRC_D31), (IEN | PTD | DIS | M0)) /*SDRC_D31*/\ + MUX_VAL(CP(SDRC_CLK), (IEN | PTD | DIS | M0)) /*SDRC_CLK*/\ + MUX_VAL(CP(SDRC_DQS0), (IEN | PTD | DIS | M0)) /*SDRC_DQS0*/\ + MUX_VAL(CP(SDRC_DQS1), (IEN | PTD | DIS | M0)) /*SDRC_DQS1*/\ + MUX_VAL(CP(SDRC_DQS2), (IEN | PTD | DIS | M0)) /*SDRC_DQS2*/\ + MUX_VAL(CP(SDRC_DQS3), (IEN | PTD | DIS | M0)) /*SDRC_DQS3*/\ + /*GPMC*/\ + MUX_VAL(CP(GPMC_A1), (IDIS | PTD | DIS | M0)) /*GPMC_A1*/\ + MUX_VAL(CP(GPMC_A2), (IDIS | PTD | DIS | M0)) /*GPMC_A2*/\ + MUX_VAL(CP(GPMC_A3), (IDIS | PTD | DIS | M0)) /*GPMC_A3*/\ + MUX_VAL(CP(GPMC_A4), (IDIS | PTD | DIS | M0)) /*GPMC_A4*/\ + MUX_VAL(CP(GPMC_A5), (IDIS | PTD | DIS | M0)) /*GPMC_A5*/\ + MUX_VAL(CP(GPMC_A6), (IDIS | PTD | DIS | M0)) /*GPMC_A6*/\ + MUX_VAL(CP(GPMC_A7), (IDIS | PTD | DIS | M0)) /*GPMC_A7*/\ + MUX_VAL(CP(GPMC_A8), (IDIS | PTD | DIS | M0)) /*GPMC_A8*/\ + MUX_VAL(CP(GPMC_A9), (IDIS | PTD | DIS | M0)) /*GPMC_A9*/\ + MUX_VAL(CP(GPMC_A10), (IDIS | PTD | DIS | M0)) /*GPMC_A10*/\ + MUX_VAL(CP(GPMC_D0), (IEN | PTD | DIS | M0)) /*GPMC_D0*/\ + MUX_VAL(CP(GPMC_D1), (IEN | PTD | DIS | M0)) /*GPMC_D1*/\ + MUX_VAL(CP(GPMC_D2), (IEN | PTD | DIS | M0)) /*GPMC_D2*/\ + MUX_VAL(CP(GPMC_D3), (IEN | PTD | DIS | M0)) /*GPMC_D3*/\ + MUX_VAL(CP(GPMC_D4), (IEN | PTD | DIS | M0)) /*GPMC_D4*/\ + MUX_VAL(CP(GPMC_D5), (IEN | PTD | DIS | M0)) /*GPMC_D5*/\ + MUX_VAL(CP(GPMC_D6), (IEN | PTD | DIS | M0)) /*GPMC_D6*/\ + MUX_VAL(CP(GPMC_D7), (IEN | PTD | DIS | M0)) /*GPMC_D7*/\ + MUX_VAL(CP(GPMC_D8), (IEN | PTD | DIS | M0)) /*GPMC_D8*/\ + MUX_VAL(CP(GPMC_D9), (IEN | PTD | DIS | M0)) /*GPMC_D9*/\ + MUX_VAL(CP(GPMC_D10), (IEN | PTD | DIS | M0)) /*GPMC_D10*/\ + MUX_VAL(CP(GPMC_D11), (IEN | PTD | DIS | M0)) /*GPMC_D11*/\ + MUX_VAL(CP(GPMC_D12), (IEN | PTD | DIS | M0)) /*GPMC_D12*/\ + MUX_VAL(CP(GPMC_D13), (IEN | PTD | DIS | M0)) /*GPMC_D13*/\ + MUX_VAL(CP(GPMC_D14), (IEN | PTD | DIS | M0)) /*GPMC_D14*/\ + MUX_VAL(CP(GPMC_D15), (IEN | PTD | DIS | M0)) /*GPMC_D15*/\ + MUX_VAL(CP(GPMC_NCS0), (IDIS | PTU | EN | M0)) /*GPMC_nCS0*/\ + MUX_VAL(CP(GPMC_NCS1), (IDIS | PTU | EN | M0)) /*GPMC_nCS1*/\ + MUX_VAL(CP(GPMC_NCS2), (IDIS | PTU | EN | M0)) /*GPMC_nCS2*/\ + MUX_VAL(CP(GPMC_NCS3), (IDIS | PTU | EN | M0)) /*GPMC_nCS3*/\ + MUX_VAL(CP(GPMC_NCS4), (IDIS | PTU | EN | M0)) /*GPMC_nCS4*/\ + MUX_VAL(CP(GPMC_NCS5), (IDIS | PTD | DIS | M0)) /*GPMC_nCS5*/\ + MUX_VAL(CP(GPMC_NCS6), (IEN | PTD | DIS | M1)) /*SYS_nDMA_REQ2*/\ + MUX_VAL(CP(GPMC_NCS7), (IEN | PTU | EN | M1)) /*SYS_nDMA_REQ3*/\ + MUX_VAL(CP(GPMC_NBE1), (IEN | PTD | DIS | M0)) /*GPMC_nBE1*/\ + MUX_VAL(CP(GPMC_WAIT2), (IEN | PTU | EN | M0)) /*GPMC_WAIT2*/\ + MUX_VAL(CP(GPMC_WAIT3), (IEN | PTU | EN | M0)) /*GPMC_WAIT3*/\ + MUX_VAL(CP(GPMC_CLK), (IDIS | PTD | DIS | M0)) /*GPMC_CLK*/\ + MUX_VAL(CP(GPMC_NADV_ALE), (IDIS | PTD | DIS | M0)) /*GPMC_nADV_ALE*/\ + MUX_VAL(CP(GPMC_NOE), (IDIS | PTD | DIS | M0)) /*GPMC_nOE*/\ + MUX_VAL(CP(GPMC_NWE), (IDIS | PTD | DIS | M0)) /*GPMC_nWE*/\ + MUX_VAL(CP(GPMC_NBE0_CLE), (IDIS | PTD | DIS | M0)) /*GPMC_nBE0_CLE*/\ + MUX_VAL(CP(GPMC_NWP), (IEN | PTD | DIS | M0)) /*GPMC_nWP*/\ + MUX_VAL(CP(GPMC_WAIT0), (IEN | PTU | EN | M0)) /*GPMC_WAIT0*/\ + MUX_VAL(CP(GPMC_WAIT1), (IEN | PTU | EN | M0)) /*GPMC_WAIT1*/\ + /*DSS*/\ + MUX_VAL(CP(DSS_PCLK), (IDIS | PTD | DIS | M0)) /*DSS_PCLK*/\ + MUX_VAL(CP(DSS_HSYNC), (IDIS | PTD | DIS | M0)) /*DSS_HSYNC*/\ + MUX_VAL(CP(DSS_VSYNC), (IDIS | PTD | DIS | M0)) /*DSS_VSYNC*/\ + MUX_VAL(CP(DSS_ACBIAS), (IDIS | PTD | DIS | M0)) /*DSS_ACBIAS*/\ + MUX_VAL(CP(DSS_DATA0), (IDIS | PTD | DIS | M0)) /*DSS_DATA0*/\ + MUX_VAL(CP(DSS_DATA1), (IDIS | PTD | DIS | M0)) /*DSS_DATA1*/\ + MUX_VAL(CP(DSS_DATA2), (IDIS | PTD | DIS | M0)) /*DSS_DATA2*/\ + MUX_VAL(CP(DSS_DATA3), (IDIS | PTD | DIS | M0)) /*DSS_DATA3*/\ + MUX_VAL(CP(DSS_DATA4), (IDIS | PTD | DIS | M0)) /*DSS_DATA4*/\ + MUX_VAL(CP(DSS_DATA5), (IDIS | PTD | DIS | M0)) /*DSS_DATA5*/\ + MUX_VAL(CP(DSS_DATA6), (IDIS | PTD | DIS | M0)) /*DSS_DATA6*/\ + MUX_VAL(CP(DSS_DATA7), (IDIS | PTD | DIS | M0)) /*DSS_DATA7*/\ + MUX_VAL(CP(DSS_DATA8), (IDIS | PTD | DIS | M0)) /*DSS_DATA8*/\ + MUX_VAL(CP(DSS_DATA9), (IDIS | PTD | DIS | M0)) /*DSS_DATA9*/\ + MUX_VAL(CP(DSS_DATA10), (IDIS | PTD | DIS | M0)) /*DSS_DATA10*/\ + MUX_VAL(CP(DSS_DATA11), (IDIS | PTD | DIS | M0)) /*DSS_DATA11*/\ + MUX_VAL(CP(DSS_DATA12), (IDIS | PTD | DIS | M0)) /*DSS_DATA12*/\ + MUX_VAL(CP(DSS_DATA13), (IDIS | PTD | DIS | M0)) /*DSS_DATA13*/\ + MUX_VAL(CP(DSS_DATA14), (IDIS | PTD | DIS | M0)) /*DSS_DATA14*/\ + MUX_VAL(CP(DSS_DATA15), (IDIS | PTD | DIS | M0)) /*DSS_DATA15*/\ + MUX_VAL(CP(DSS_DATA16), (IDIS | PTD | DIS | M0)) /*DSS_DATA16*/\ + MUX_VAL(CP(DSS_DATA17), (IDIS | PTD | DIS | M0)) /*DSS_DATA17*/\ + MUX_VAL(CP(DSS_DATA18), (IDIS | PTD | DIS | M0)) /*DSS_DATA18*/\ + MUX_VAL(CP(DSS_DATA19), (IDIS | PTD | DIS | M0)) /*DSS_DATA19*/\ + MUX_VAL(CP(DSS_DATA20), (IDIS | PTD | DIS | M0)) /*DSS_DATA20*/\ + MUX_VAL(CP(DSS_DATA21), (IDIS | PTD | DIS | M0)) /*DSS_DATA21*/\ + MUX_VAL(CP(DSS_DATA22), (IDIS | PTD | DIS | M0)) /*DSS_DATA22*/\ + MUX_VAL(CP(DSS_DATA23), (IDIS | PTD | DIS | M0)) /*DSS_DATA23*/\ + /*CAMERA*/\ + MUX_VAL(CP(CAM_HS), (IEN | PTU | EN | M0)) /*CAM_HS */\ + MUX_VAL(CP(CAM_VS), (IEN | PTU | EN | M0)) /*CAM_VS */\ + MUX_VAL(CP(CAM_XCLKA), (IDIS | PTD | DIS | M0)) /*CAM_XCLKA*/\ + MUX_VAL(CP(CAM_PCLK), (IEN | PTU | EN | M0)) /*CAM_PCLK*/\ + MUX_VAL(CP(CAM_FLD), (IDIS | PTD | DIS | M4)) /*GPIO_98*/\ + MUX_VAL(CP(CAM_D0), (IEN | PTD | DIS | M0)) /*CAM_D0*/\ + MUX_VAL(CP(CAM_D1), (IEN | PTD | DIS | M0)) /*CAM_D1*/\ + MUX_VAL(CP(CAM_D2), (IEN | PTD | DIS | M0)) /*CAM_D2*/\ + MUX_VAL(CP(CAM_D3), (IEN | PTD | DIS | M0)) /*CAM_D3*/\ + MUX_VAL(CP(CAM_D4), (IEN | PTD | DIS | M0)) /*CAM_D4*/\ + MUX_VAL(CP(CAM_D5), (IEN | PTD | DIS | M0)) /*CAM_D5*/\ + MUX_VAL(CP(CAM_D6), (IEN | PTD | DIS | M0)) /*CAM_D6*/\ + MUX_VAL(CP(CAM_D7), (IEN | PTD | DIS | M0)) /*CAM_D7*/\ + MUX_VAL(CP(CAM_D8), (IEN | PTD | DIS | M0)) /*CAM_D8*/\ + MUX_VAL(CP(CAM_D9), (IEN | PTD | DIS | M0)) /*CAM_D9*/\ + MUX_VAL(CP(CAM_D10), (IEN | PTD | DIS | M0)) /*CAM_D10*/\ + MUX_VAL(CP(CAM_D11), (IEN | PTD | DIS | M0)) /*CAM_D11*/\ + MUX_VAL(CP(CAM_XCLKB), (IDIS | PTD | DIS | M0)) /*CAM_XCLKB*/\ + MUX_VAL(CP(CAM_WEN), (IEN | PTD | DIS | M4)) /*GPIO_167*/\ + MUX_VAL(CP(CAM_STROBE), (IDIS | PTD | DIS | M0)) /*CAM_STROBE*/\ + MUX_VAL(CP(CSI2_DX0), (IEN | PTD | DIS | M0)) /*CSI2_DX0*/\ + MUX_VAL(CP(CSI2_DY0), (IEN | PTD | DIS | M0)) /*CSI2_DY0*/\ + MUX_VAL(CP(CSI2_DX1), (IEN | PTD | DIS | M0)) /*CSI2_DX1*/\ + MUX_VAL(CP(CSI2_DY1), (IEN | PTD | DIS | M0)) /*CSI2_DY1*/\ + /*Audio Interface */\ + MUX_VAL(CP(MCBSP2_FSX), (IEN | PTD | DIS | M0)) /*McBSP2_FSX*/\ + MUX_VAL(CP(MCBSP2_CLKX), (IEN | PTD | DIS | M0)) /*McBSP2_CLKX*/\ + MUX_VAL(CP(MCBSP2_DR), (IEN | PTD | DIS | M0)) /*McBSP2_DR*/\ + MUX_VAL(CP(MCBSP2_DX), (IDIS | PTD | DIS | M0)) /*McBSP2_DX*/\ + /*Expansion card */\ + MUX_VAL(CP(MMC1_CLK), (IDIS | PTU | EN | M0)) /*MMC1_CLK*/\ + MUX_VAL(CP(MMC1_CMD), (IEN | PTU | EN | M0)) /*MMC1_CMD*/\ + MUX_VAL(CP(MMC1_DAT0), (IEN | PTU | EN | M0)) /*MMC1_DAT0*/\ + MUX_VAL(CP(MMC1_DAT1), (IEN | PTU | EN | M0)) /*MMC1_DAT1*/\ + MUX_VAL(CP(MMC1_DAT2), (IEN | PTU | EN | M0)) /*MMC1_DAT2*/\ + MUX_VAL(CP(MMC1_DAT3), (IEN | PTU | EN | M0)) /*MMC1_DAT3*/\ + MUX_VAL(CP(MMC1_DAT4), (IEN | PTU | EN | M0)) /*MMC1_DAT4*/\ + MUX_VAL(CP(MMC1_DAT5), (IEN | PTU | EN | M0)) /*MMC1_DAT5*/\ + MUX_VAL(CP(MMC1_DAT6), (IEN | PTU | EN | M0)) /*MMC1_DAT6*/\ + MUX_VAL(CP(MMC1_DAT7), (IEN | PTU | EN | M0)) /*MMC1_DAT7*/\ + /*Wireless LAN */\ + MUX_VAL(CP(MMC2_CLK), (IEN | PTU | EN | M4)) /*GPIO_130*/\ + MUX_VAL(CP(MMC2_CMD), (IEN | PTU | EN | M4)) /*GPIO_131*/\ + MUX_VAL(CP(MMC2_DAT0), (IEN | PTU | EN | M4)) /*GPIO_132*/\ + MUX_VAL(CP(MMC2_DAT1), (IEN | PTU | EN | M4)) /*GPIO_133*/\ + MUX_VAL(CP(MMC2_DAT2), (IEN | PTU | EN | M4)) /*GPIO_134*/\ + MUX_VAL(CP(MMC2_DAT3), (IEN | PTU | EN | M4)) /*GPIO_135*/\ + MUX_VAL(CP(MMC2_DAT4), (IEN | PTU | EN | M4)) /*GPIO_136*/\ + MUX_VAL(CP(MMC2_DAT5), (IEN | PTU | EN | M4)) /*GPIO_137*/\ + MUX_VAL(CP(MMC2_DAT6), (IEN | PTU | EN | M4)) /*GPIO_138*/\ + MUX_VAL(CP(MMC2_DAT7), (IEN | PTU | EN | M4)) /*GPIO_139*/\ + /*Bluetooth*/\ + MUX_VAL(CP(MCBSP3_DX), (IEN | PTD | DIS | M1)) /*UART2_CTS*/\ + MUX_VAL(CP(MCBSP3_DR), (IDIS | PTD | DIS | M1)) /*UART2_RTS*/\ + MUX_VAL(CP(MCBSP3_CLKX), (IDIS | PTD | DIS | M1)) /*UART2_TX*/\ + MUX_VAL(CP(MCBSP3_FSX), (IEN | PTD | DIS | M1)) /*UART2_RX*/\ + MUX_VAL(CP(UART2_CTS), (IEN | PTD | DIS | M4)) /*GPIO_144*/\ + MUX_VAL(CP(UART2_RTS), (IEN | PTD | DIS | M4)) /*GPIO_145*/\ + MUX_VAL(CP(UART2_TX), (IEN | PTD | DIS | M4)) /*GPIO_146*/\ + MUX_VAL(CP(UART2_RX), (IEN | PTD | DIS | M4)) /*GPIO_147*/\ + /*Modem Interface */\ + MUX_VAL(CP(UART1_TX), (IDIS | PTD | DIS | M0)) /*UART1_TX*/\ + MUX_VAL(CP(UART1_RTS), (IDIS | PTD | DIS | M4)) /*GPIO_149*/ \ + MUX_VAL(CP(UART1_CTS), (IDIS | PTD | DIS | M4)) /*GPIO_150*/ \ + MUX_VAL(CP(UART1_RX), (IEN | PTD | DIS | M0)) /*UART1_RX*/\ + MUX_VAL(CP(MCBSP4_CLKX), (IEN | PTD | DIS | M1)) /*SSI1_DAT_RX*/\ + MUX_VAL(CP(MCBSP4_DR), (IEN | PTD | DIS | M1)) /*SSI1_FLAG_RX*/\ + MUX_VAL(CP(MCBSP4_DX), (IEN | PTD | DIS | M1)) /*SSI1_RDY_RX*/\ + MUX_VAL(CP(MCBSP4_FSX), (IEN | PTD | DIS | M1)) /*SSI1_WAKE*/\ + MUX_VAL(CP(MCBSP1_CLKR), (IDIS | PTD | DIS | M4)) /*GPIO_156*/\ + MUX_VAL(CP(MCBSP1_FSR), (IDIS | PTU | EN | M4)) /*GPIO_157*/\ + MUX_VAL(CP(MCBSP1_DX), (IDIS | PTD | DIS | M4)) /*GPIO_158*/\ + MUX_VAL(CP(MCBSP1_DR), (IDIS | PTD | DIS | M4)) /*GPIO_159*/\ + MUX_VAL(CP(MCBSP_CLKS), (IEN | PTU | DIS | M0)) /*McBSP_CLKS*/\ + MUX_VAL(CP(MCBSP1_FSX), (IDIS | PTD | DIS | M4)) /*GPIO_161*/\ + MUX_VAL(CP(MCBSP1_CLKX), (IDIS | PTD | DIS | M4)) /*GPIO_162*/\ + /*Serial Interface*/\ + MUX_VAL(CP(UART3_CTS_RCTX), (IEN | PTD | EN | M0)) /*UART3_CTS_RCTX*/\ + MUX_VAL(CP(UART3_RTS_SD), (IDIS | PTD | DIS | M0)) /*UART3_RTS_SD */\ + MUX_VAL(CP(UART3_RX_IRRX), (IEN | PTD | DIS | M0)) /*UART3_RX_IRRX*/\ + MUX_VAL(CP(UART3_TX_IRTX), (IDIS | PTD | DIS | M0)) /*UART3_TX_IRTX*/\ + MUX_VAL(CP(HSUSB0_CLK), (IEN | PTD | DIS | M0)) /*HSUSB0_CLK*/\ + MUX_VAL(CP(HSUSB0_STP), (IDIS | PTU | EN | M0)) /*HSUSB0_STP*/\ + MUX_VAL(CP(HSUSB0_DIR), (IEN | PTD | DIS | M0)) /*HSUSB0_DIR*/\ + MUX_VAL(CP(HSUSB0_NXT), (IEN | PTD | DIS | M0)) /*HSUSB0_NXT*/\ + MUX_VAL(CP(HSUSB0_DATA0), (IEN | PTD | DIS | M0)) /*HSUSB0_DATA0*/\ + MUX_VAL(CP(HSUSB0_DATA1), (IEN | PTD | DIS | M0)) /*HSUSB0_DATA1*/\ + MUX_VAL(CP(HSUSB0_DATA2), (IEN | PTD | DIS | M0)) /*HSUSB0_DATA2*/\ + MUX_VAL(CP(HSUSB0_DATA3), (IEN | PTD | DIS | M0)) /*HSUSB0_DATA3*/\ + MUX_VAL(CP(HSUSB0_DATA4), (IEN | PTD | DIS | M0)) /*HSUSB0_DATA4*/\ + MUX_VAL(CP(HSUSB0_DATA5), (IEN | PTD | DIS | M0)) /*HSUSB0_DATA5*/\ + MUX_VAL(CP(HSUSB0_DATA6), (IEN | PTD | DIS | M0)) /*HSUSB0_DATA6*/\ + MUX_VAL(CP(HSUSB0_DATA7), (IEN | PTD | DIS | M0)) /*HSUSB0_DATA7*/\ + MUX_VAL(CP(I2C1_SCL), (IEN | PTU | EN | M0)) /*I2C1_SCL*/\ + MUX_VAL(CP(I2C1_SDA), (IEN | PTU | EN | M0)) /*I2C1_SDA*/\ + MUX_VAL(CP(I2C2_SCL), (IEN | PTU | EN | M4)) /*GPIO_168*/\ + MUX_VAL(CP(I2C2_SDA), (IEN | PTU | EN | M4)) /*GPIO_183*/\ + MUX_VAL(CP(I2C3_SCL), (IEN | PTU | EN | M0)) /*I2C3_SCL*/\ + MUX_VAL(CP(I2C3_SDA), (IEN | PTU | EN | M0)) /*I2C3_SDA*/\ + MUX_VAL(CP(I2C4_SCL), (IEN | PTU | EN | M0)) /*I2C4_SCL*/\ + MUX_VAL(CP(I2C4_SDA), (IEN | PTU | EN | M0)) /*I2C4_SDA*/\ + MUX_VAL(CP(HDQ_SIO), (IDIS | PTU | EN | M4)) /*GPIO_170*/\ + MUX_VAL(CP(MCSPI1_CLK), (IEN | PTU | EN | M4)) /*GPIO_171*/\ + MUX_VAL(CP(MCSPI1_SIMO), (IEN | PTU | EN | M4)) /*GPIO_172*/\ + MUX_VAL(CP(MCSPI1_SOMI), (IEN | PTD | DIS | M0)) /*McSPI1_SOMI*/\ + MUX_VAL(CP(MCSPI1_CS0), (IEN | PTD | EN | M0)) /*McSPI1_CS0*/\ + MUX_VAL(CP(MCSPI1_CS1), (IDIS | PTD | EN | M0)) /*McSPI1_CS1*/\ + MUX_VAL(CP(MCSPI1_CS2), (IDIS | PTD | DIS | M4)) /*GPIO_176*/\ + /* USB EHCI (port 2) */\ + MUX_VAL(CP(MCSPI1_CS3), (IEN | PTU | DIS | M3)) /*HSUSB2_DATA2*/\ + MUX_VAL(CP(MCSPI2_CLK), (IEN | PTU | DIS | M3)) /*HSUSB2_DATA7*/\ + MUX_VAL(CP(MCSPI2_SIMO), (IEN | PTU | DIS | M3)) /*HSUSB2_DATA4*/\ + MUX_VAL(CP(MCSPI2_SOMI), (IEN | PTU | DIS | M3)) /*HSUSB2_DATA5*/\ + MUX_VAL(CP(MCSPI2_CS0), (IEN | PTU | DIS | M3)) /*HSUSB2_DATA6*/\ + MUX_VAL(CP(MCSPI2_CS1), (IEN | PTU | DIS | M3)) /*HSUSB2_DATA3*/\ + MUX_VAL(CP(ETK_D10_ES2), (IDIS | PTU | DIS | M3)) /*HSUSB2_CLK*/\ + MUX_VAL(CP(ETK_D11_ES2), (IDIS | PTU | DIS | M3)) /*HSUSB2_STP*/\ + MUX_VAL(CP(ETK_D12_ES2), (IEN | PTU | DIS | M3)) /*HSUSB2_DIR*/\ + MUX_VAL(CP(ETK_D13_ES2), (IEN | PTU | DIS | M3)) /*HSUSB2_NXT*/\ + MUX_VAL(CP(ETK_D14_ES2), (IEN | PTU | DIS | M3)) /*HSUSB2_DATA0*/\ + MUX_VAL(CP(ETK_D15_ES2), (IEN | PTU | DIS | M3)) /*HSUSB2_DATA1*/\ + /*Control and debug */\ + MUX_VAL(CP(SYS_32K), (IEN | PTD | DIS | M0)) /*SYS_32K*/\ + MUX_VAL(CP(SYS_CLKREQ), (IEN | PTD | DIS | M0)) /*SYS_CLKREQ*/\ + MUX_VAL(CP(SYS_NIRQ), (IEN | PTU | EN | M0)) /*SYS_nIRQ*/\ + MUX_VAL(CP(SYS_BOOT0), (IEN | PTD | DIS | M4)) /*GPIO_2*/\ + MUX_VAL(CP(SYS_BOOT1), (IEN | PTD | DIS | M4)) /*GPIO_3*/\ + MUX_VAL(CP(SYS_BOOT2), (IEN | PTD | DIS | M4)) /*GPIO_4 - MMC1_WP*/\ + MUX_VAL(CP(SYS_BOOT3), (IEN | PTD | DIS | M4)) /*GPIO_5*/\ + MUX_VAL(CP(SYS_BOOT4), (IEN | PTD | DIS | M4)) /*GPIO_6*/\ + MUX_VAL(CP(SYS_BOOT5), (IEN | PTD | DIS | M4)) /*GPIO_7*/\ + MUX_VAL(CP(SYS_BOOT6), (IDIS | PTD | DIS | M4)) /*GPIO_8*/ \ + MUX_VAL(CP(SYS_OFF_MODE), (IEN | PTD | DIS | M0)) /*SYS_OFF_MODE*/\ + MUX_VAL(CP(SYS_CLKOUT1), (IEN | PTD | DIS | M0)) /*SYS_CLKOUT1*/\ + MUX_VAL(CP(SYS_CLKOUT2), (IEN | PTU | EN | M4)) /*GPIO_186*/\ + MUX_VAL(CP(ETK_CLK_ES2), (IDIS | PTU | EN | M3)) /*HSUSB1_STP*/\ + MUX_VAL(CP(ETK_CTL_ES2), (IDIS | PTU | DIS | M3)) /*HSUSB1_CLK*/\ + MUX_VAL(CP(ETK_D0_ES2), (IEN | PTU | DIS | M3)) /*HSUSB1_DATA0*/\ + MUX_VAL(CP(ETK_D1_ES2), (IEN | PTU | DIS | M3)) /*HSUSB1_DATA1*/\ + MUX_VAL(CP(ETK_D2_ES2), (IEN | PTU | DIS | M3)) /*HSUSB1_DATA2*/\ + MUX_VAL(CP(ETK_D3_ES2), (IEN | PTU | DIS | M3)) /*HSUSB1_DATA7*/\ + MUX_VAL(CP(ETK_D4_ES2), (IEN | PTU | DIS | M3)) /*HSUSB1_DATA4*/\ + MUX_VAL(CP(ETK_D5_ES2), (IEN | PTU | DIS | M3)) /*HSUSB1_DATA5*/\ + MUX_VAL(CP(ETK_D6_ES2), (IEN | PTU | DIS | M3)) /*HSUSB1_DATA6*/\ + MUX_VAL(CP(ETK_D7_ES2), (IEN | PTU | DIS | M3)) /*HSUSB1_DATA3*/\ + MUX_VAL(CP(ETK_D8_ES2), (IEN | PTU | DIS | M3)) /*HSUSB1_DIR*/\ + MUX_VAL(CP(ETK_D9_ES2), (IEN | PTU | DIS | M3)) /*HSUSB1_NXT*/\ + MUX_VAL(CP(D2D_MCAD1), (IEN | PTD | EN | M0)) /*d2d_mcad1*/\ + MUX_VAL(CP(D2D_MCAD2), (IEN | PTD | EN | M0)) /*d2d_mcad2*/\ + MUX_VAL(CP(D2D_MCAD3), (IEN | PTD | EN | M0)) /*d2d_mcad3*/\ + MUX_VAL(CP(D2D_MCAD4), (IEN | PTD | EN | M0)) /*d2d_mcad4*/\ + MUX_VAL(CP(D2D_MCAD5), (IEN | PTD | EN | M0)) /*d2d_mcad5*/\ + MUX_VAL(CP(D2D_MCAD6), (IEN | PTD | EN | M0)) /*d2d_mcad6*/\ + MUX_VAL(CP(D2D_MCAD7), (IEN | PTD | EN | M0)) /*d2d_mcad7*/\ + MUX_VAL(CP(D2D_MCAD8), (IEN | PTD | EN | M0)) /*d2d_mcad8*/\ + MUX_VAL(CP(D2D_MCAD9), (IEN | PTD | EN | M0)) /*d2d_mcad9*/\ + MUX_VAL(CP(D2D_MCAD10), (IEN | PTD | EN | M0)) /*d2d_mcad10*/\ + MUX_VAL(CP(D2D_MCAD11), (IEN | PTD | EN | M0)) /*d2d_mcad11*/\ + MUX_VAL(CP(D2D_MCAD12), (IEN | PTD | EN | M0)) /*d2d_mcad12*/\ + MUX_VAL(CP(D2D_MCAD13), (IEN | PTD | EN | M0)) /*d2d_mcad13*/\ + MUX_VAL(CP(D2D_MCAD14), (IEN | PTD | EN | M0)) /*d2d_mcad14*/\ + MUX_VAL(CP(D2D_MCAD15), (IEN | PTD | EN | M0)) /*d2d_mcad15*/\ + MUX_VAL(CP(D2D_MCAD16), (IEN | PTD | EN | M0)) /*d2d_mcad16*/\ + MUX_VAL(CP(D2D_MCAD17), (IEN | PTD | EN | M0)) /*d2d_mcad17*/\ + MUX_VAL(CP(D2D_MCAD18), (IEN | PTD | EN | M0)) /*d2d_mcad18*/\ + MUX_VAL(CP(D2D_MCAD19), (IEN | PTD | EN | M0)) /*d2d_mcad19*/\ + MUX_VAL(CP(D2D_MCAD20), (IEN | PTD | EN | M0)) /*d2d_mcad20*/\ + MUX_VAL(CP(D2D_MCAD21), (IEN | PTD | EN | M0)) /*d2d_mcad21*/\ + MUX_VAL(CP(D2D_MCAD22), (IEN | PTD | EN | M0)) /*d2d_mcad22*/\ + MUX_VAL(CP(D2D_MCAD23), (IEN | PTD | EN | M0)) /*d2d_mcad23*/\ + MUX_VAL(CP(D2D_MCAD24), (IEN | PTD | EN | M0)) /*d2d_mcad24*/\ + MUX_VAL(CP(D2D_MCAD25), (IEN | PTD | EN | M0)) /*d2d_mcad25*/\ + MUX_VAL(CP(D2D_MCAD26), (IEN | PTD | EN | M0)) /*d2d_mcad26*/\ + MUX_VAL(CP(D2D_MCAD27), (IEN | PTD | EN | M0)) /*d2d_mcad27*/\ + MUX_VAL(CP(D2D_MCAD28), (IEN | PTD | EN | M0)) /*d2d_mcad28*/\ + MUX_VAL(CP(D2D_MCAD29), (IEN | PTD | EN | M0)) /*d2d_mcad29*/\ + MUX_VAL(CP(D2D_MCAD30), (IEN | PTD | EN | M0)) /*d2d_mcad30*/\ + MUX_VAL(CP(D2D_MCAD31), (IEN | PTD | EN | M0)) /*d2d_mcad31*/\ + MUX_VAL(CP(D2D_MCAD32), (IEN | PTD | EN | M0)) /*d2d_mcad32*/\ + MUX_VAL(CP(D2D_MCAD33), (IEN | PTD | EN | M0)) /*d2d_mcad33*/\ + MUX_VAL(CP(D2D_MCAD34), (IEN | PTD | EN | M0)) /*d2d_mcad34*/\ + MUX_VAL(CP(D2D_MCAD35), (IEN | PTD | EN | M0)) /*d2d_mcad35*/\ + MUX_VAL(CP(D2D_MCAD36), (IEN | PTD | EN | M0)) /*d2d_mcad36*/\ + MUX_VAL(CP(D2D_CLK26MI), (IEN | PTD | DIS | M0)) /*d2d_clk26mi*/\ + MUX_VAL(CP(D2D_NRESPWRON), (IEN | PTD | EN | M0)) /*d2d_nrespwron*/\ + MUX_VAL(CP(D2D_NRESWARM), (IEN | PTU | EN | M0)) /*d2d_nreswarm */\ + MUX_VAL(CP(D2D_ARM9NIRQ), (IEN | PTD | DIS | M0)) /*d2d_arm9nirq */\ + MUX_VAL(CP(D2D_UMA2P6FIQ), (IEN | PTD | DIS | M0)) /*d2d_uma2p6fiq*/\ + MUX_VAL(CP(D2D_SPINT), (IEN | PTD | EN | M0)) /*d2d_spint*/\ + MUX_VAL(CP(D2D_FRINT), (IEN | PTD | EN | M0)) /*d2d_frint*/\ + MUX_VAL(CP(D2D_DMAREQ0), (IEN | PTD | DIS | M0)) /*d2d_dmareq0*/\ + MUX_VAL(CP(D2D_DMAREQ1), (IEN | PTD | DIS | M0)) /*d2d_dmareq1*/\ + MUX_VAL(CP(D2D_DMAREQ2), (IEN | PTD | DIS | M0)) /*d2d_dmareq2*/\ + MUX_VAL(CP(D2D_DMAREQ3), (IEN | PTD | DIS | M0)) /*d2d_dmareq3*/\ + MUX_VAL(CP(D2D_N3GTRST), (IEN | PTD | DIS | M0)) /*d2d_n3gtrst*/\ + MUX_VAL(CP(D2D_N3GTDI), (IEN | PTD | DIS | M0)) /*d2d_n3gtdi*/\ + MUX_VAL(CP(D2D_N3GTDO), (IEN | PTD | DIS | M0)) /*d2d_n3gtdo*/\ + MUX_VAL(CP(D2D_N3GTMS), (IEN | PTD | DIS | M0)) /*d2d_n3gtms*/\ + MUX_VAL(CP(D2D_N3GTCK), (IEN | PTD | DIS | M0)) /*d2d_n3gtck*/\ + MUX_VAL(CP(D2D_N3GRTCK), (IEN | PTD | DIS | M0)) /*d2d_n3grtck*/\ + MUX_VAL(CP(D2D_MSTDBY), (IEN | PTU | EN | M0)) /*d2d_mstdby*/\ + MUX_VAL(CP(D2D_SWAKEUP), (IEN | PTD | EN | M0)) /*d2d_swakeup*/\ + MUX_VAL(CP(D2D_IDLEREQ), (IEN | PTD | DIS | M0)) /*d2d_idlereq*/\ + MUX_VAL(CP(D2D_IDLEACK), (IEN | PTU | EN | M0)) /*d2d_idleack*/\ + MUX_VAL(CP(D2D_MWRITE), (IEN | PTD | DIS | M0)) /*d2d_mwrite*/\ + MUX_VAL(CP(D2D_SWRITE), (IEN | PTD | DIS | M0)) /*d2d_swrite*/\ + MUX_VAL(CP(D2D_MREAD), (IEN | PTD | DIS | M0)) /*d2d_mread*/\ + MUX_VAL(CP(D2D_SREAD), (IEN | PTD | DIS | M0)) /*d2d_sread*/\ + MUX_VAL(CP(D2D_MBUSFLAG), (IEN | PTD | DIS | M0)) /*d2d_mbusflag*/\ + MUX_VAL(CP(D2D_SBUSFLAG), (IEN | PTD | DIS | M0)) /*d2d_sbusflag*/\ + MUX_VAL(CP(SDRC_CKE0), (IDIS | PTU | EN | M0)) /*sdrc_cke0*/\ + MUX_VAL(CP(SDRC_CKE1), (IDIS | PTU | EN | M0)) /*sdrc_cke1*/ + +#define MUX_RX51_C() \ + MUX_VAL(CP(MCBSP3_DX), (IEN | PTD | DIS | M4)) /*GPIO_140*/\ + MUX_VAL(CP(MCBSP3_DR), (IEN | PTD | DIS | M4)) /*GPIO_142*/\ + MUX_VAL(CP(MCBSP3_CLKX), (IEN | PTD | DIS | M4)) /*GPIO_141*/\ + MUX_VAL(CP(UART2_CTS), (IEN | PTU | EN | M0)) /*UART2_CTS*/\ + MUX_VAL(CP(UART2_RTS), (IDIS | PTD | DIS | M0)) /*UART2_RTS*/\ + MUX_VAL(CP(UART2_TX), (IDIS | PTD | DIS | M0)) /*UART2_TX*/ + +#endif diff --git a/boards.cfg b/boards.cfg index 1e5b3e0..be3b57f 100644 --- a/boards.cfg +++ b/boards.cfg @@ -210,6 +210,7 @@ omap3_evm_quick_mmc arm armv7 evm ti omap3_evm_quick_nand arm armv7 evm ti omap3 omap3_sdp3430 arm armv7 sdp3430 ti omap3 devkit8000 arm armv7 devkit8000 timll omap3 +nokia_rx51 arm armv7 rx51 nokia omap3 omap4_panda arm armv7 panda ti omap4 omap4_sdp4430 arm armv7 sdp4430 ti omap4 omap5_evm arm armv7 omap5_evm ti omap5 diff --git a/include/configs/nokia_rx51.h b/include/configs/nokia_rx51.h new file mode 100644 index 0000000..bb77d5c --- /dev/null +++ b/include/configs/nokia_rx51.h @@ -0,0 +1,317 @@ +/* + * (C) Copyright 2011 + * Pali Rohár pali.rohar@gmail.com + * + * (C) Copyright 2010 + * Alistair Buxton a.j.buxton@gmail.com + * + * Derived from Beagle Board code: + * (C) Copyright 2006-2008 + * Texas Instruments. + * Richard Woodruff r-woodruff2@ti.com + * Syed Mohammed Khasim x0khasim@ti.com + * + * Configuration settings for the Nokia RX-51 aka N900. + * + * 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 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 __CONFIG_H +#define __CONFIG_H + +/* + * High Level Configuration Options + */ + +#define CONFIG_ARMV7 /* This is an ARM V7 CPU core */ +#define CONFIG_OMAP /* in a TI OMAP core */ +#define CONFIG_OMAP34XX /* which is a 34XX */ +#define CONFIG_OMAP3430 /* which is in a 3430 */ +#define CONFIG_CHAINLOADER /* Loaded by NOLO */ +#define CONFIG_L2_OFF /* kernel won't boot if l2 enabled (old u-boot tried but failed to enable it, due to a bug.) */ + +/* It doesn't really matter what we set this to. NOLO will load u-boot.bin + * in a random place anyway, and we have to copy. + */ +#define CONFIG_SYS_TEXT_BASE 0x80008000 + +#define CONFIG_SDRC /* The chip has SDRC controller */ + +#include <asm/arch/cpu.h> /* get chip and board defs */ +#include <asm/arch/omap3.h> + +/* + * Display CPU and Board information + */ +#define CONFIG_DISPLAY_CPUINFO +#define CONFIG_DISPLAY_BOARDINFO + +/* Clock Defines */ +#define V_OSCK 26000000 /* Clock output from T2 */ +#define V_SCLK (V_OSCK >> 1) + +#undef CONFIG_USE_IRQ /* no support for IRQs */ +#define CONFIG_MISC_INIT_R +#define CONFIG_SKIP_LOWLEVEL_INIT /* NOLO set everything up */ + +#define CONFIG_CMDLINE_TAG /* enable passing kernel command line string */ +#define CONFIG_INITRD_TAG /* enable passing initrd */ + +/* + * Size of malloc() pool + */ +#define CONFIG_ENV_SIZE (128 << 10) /* 128 KiB Sector */ +#define CONFIG_SYS_MALLOC_LEN (CONFIG_ENV_SIZE + (128 << 10)) + +/* + * Hardware drivers + */ + +/* + * NS16550 Configuration + */ +#define V_NS16550_CLK 48000000 /* 48MHz (APLL96/2) */ + +#define CONFIG_SYS_NS16550 +#define CONFIG_SYS_NS16550_SERIAL +#define CONFIG_SYS_NS16550_REG_SIZE (-4) +#define CONFIG_SYS_NS16550_CLK V_NS16550_CLK + +/* + * select serial console configuration + */ +#define CONFIG_CONS_INDEX 3 +#define CONFIG_SYS_NS16550_COM3 OMAP34XX_UART3 +#define CONFIG_SERIAL3 3 /* UART3 on RX-51 */ + +/* allow to overwrite serial and ethaddr */ +#define CONFIG_ENV_OVERWRITE +#define CONFIG_BAUDRATE 115200 +#define CONFIG_SYS_BAUDRATE_TABLE {4800, 9600, 19200, 38400, 57600,115200} +#define CONFIG_MMC +#define CONFIG_GENERIC_MMC +#define CONFIG_OMAP_HSMMC +#define CONFIG_DOS_PARTITION + +/* DDR - I use Micron DDR */ +#define CONFIG_OMAP3_MICRON_DDR + +/* USB - broken */ +#define CONFIG_MUSB_UDC +#define CONFIG_USB_OMAP3 +#define CONFIG_TWL4030_USB + +/* USB device configuration - broken */ +#define CONFIG_USB_DEVICE +/* FIXME: usbtty breaks maemo pr1.2 kernel booting +#define CONFIG_USB_TTY +*/ +#define CONFIG_SYS_CONSOLE_IS_IN_ENV + +/* commands to include */ +#include <config_cmd_default.h> + +#define CONFIG_CMD_EXT2 /* EXT2 Support */ +#define CONFIG_CMD_FAT /* FAT support */ + +#define CONFIG_CMD_I2C /* I2C serial bus support */ +#define CONFIG_CMD_MMC /* MMC support */ +#undef CONFIG_CMD_ONENAND /* NAND support */ + +#define CONFIG_CMD_CLR /* ANSI terminal clear screen command */ + +#undef CONFIG_CMD_FLASH /* flinfo, erase, protect */ +#undef CONFIG_CMD_FPGA /* FPGA configuration Support */ +#undef CONFIG_CMD_IMI /* iminfo */ +#undef CONFIG_CMD_IMLS /* List all found images */ +#undef CONFIG_CMD_NET /* bootp, tftpboot, rarpboot */ +#undef CONFIG_CMD_NFS /* NFS support */ + +#define CONFIG_SYS_NO_FLASH +#define CONFIG_HARD_I2C +#define CONFIG_SYS_I2C_SPEED 100000 +#define CONFIG_SYS_I2C_SLAVE 1 +#define CONFIG_SYS_I2C_BUS 0 +#define CONFIG_SYS_I2C_BUS_SELECT 1 +#define CONFIG_DRIVER_OMAP34XX_I2C 1 + +/* + * TWL4030 + */ +#define CONFIG_TWL4030_POWER +#define CONFIG_TWL4030_LED +#define CONFIG_TWL4030_KEYPAD + +/* Watchdog support */ +#define CONFIG_HW_WATCHDOG + +/* + * Framebuffer + */ +/* Video console */ +#define CONFIG_VIDEO +#define CONFIG_CFB_CONSOLE +#define CONFIG_CFB_CONSOLE_ANSI /* Enable ANSI escape codes in framebuffer */ +#define CONFIG_VIDEO_LOGO +#define VIDEO_FB_16BPP_PIXEL_SWAP +#define VIDEO_FB_16BPP_WORD_SWAP +#define CONFIG_VIDEO_SW_CURSOR +#define CONFIG_SPLASH_SCREEN + +/* functions for cfb_console */ +#define VIDEO_KBD_INIT_FCT rx51_kp_init() +#define VIDEO_TSTC_FCT rx51_kp_tstc +#define VIDEO_GETC_FCT rx51_kp_getc +#ifndef __ASSEMBLY__ +int rx51_kp_init(void); +int rx51_kp_tstc(void); +int rx51_kp_getc(void); +#endif + +/* Environment information */ +#define CONFIG_BOOTDELAY 3 + +#define CONFIG_EXTRA_ENV_SETTINGS \ + "usbtty=cdc_acm\0" \ + "stdin=vga\0" \ + "stdout=vga\0" \ + "stderr=vga\0" \ + "setcon=setenv stdin ${con};" \ + "setenv stdout ${con};" \ + "setenv stderr ${con}\0" \ + "sercon=setenv con serial; run setcon\0" \ + "usbcon=setenv con usbtty; run setcon\0" \ + "vgacon=setenv con vga; run setcon\0" \ + "switchmmc=mmc dev ${mmcnum}\0" \ + "loadaddr=0x82000000\0" \ + "scriptload=${mmctype}load mmc ${mmcnum}:${mmcpart} ${loadaddr} ${mmcfile}\0" \ + "scriptboot=echo Running ${mmcfile} from mmc ${mmcnum}:${mmcpart} ...;" \ + "source ${loadaddr}\0" \ + "uimageload=${mmctype}load mmc ${mmcnum}:${mmcpart} ${loadaddr} ${mmcfile}\0" \ + "uimageboot=echo Booting ${mmcfile} from mmc ${mmcnum}:${mmcpart} ...;" \ + "bootm ${loadaddr}\0" \ + "noloboot=echo Booting NOLO supplied kernel ...;" \ + "setenv atagaddr ${init_atagaddr};" \ + "bootm ${init_kernaddr}\0" \ + "trymmcpart=setenv mmcfile boot.scr; run trymmcscript;" \ + "setenv mmcfile uImage; run trymmcuimage\0" \ + "trymmcload=setenv mmcpart 1; run trymmcpart;" \ + "setenv mmcpart 2; run trymmcpart;" \ + "setenv mmcpart 3; run trymmcpart;" \ + "setenv mmcpart 4; run trymmcpart\0" \ + "trymmcboot=if run switchmmc; then " \ + "setenv mmctype fat;" \ + "run trymmcload;" \ + "setenv mmctype ext2;" \ + "run trymmcload;" \ + "fi\0" \ + "trymmcscript=if run switchmmc; then " \ + "if run scriptload; then " \ + "run scriptboot;" \ + "fi;" \ + "fi\0" \ + "trymmcuimage=if run switchmmc; then " \ + "if run uimageload; then " \ + "run uimageboot;" \ + "fi;" \ + "fi\0" \ + "immcboot=setenv mmcnum 1; run trymmcboot\0" \ + "emmcboot=setenv mmcnum 0; run trymmcboot\0" + +#define CONFIG_PREBOOT \ + "if test $slide_sw != open; then run noloboot; fi;" + +#define CONFIG_PREMONITOR \ + "echo Extra commands:;" \ + "echo run sercon - Use serial port for control.;" \ + "echo run usbcon - Use usbtty for control.;" \ + "echo run vgacon - Use framebuffer/keyboard.;" \ + "echo run emmcboot - Boot from SD card slot.;" \ + "echo run immcboot - Boot internal eMMC memory.;" \ + "echo run noloboot - Boot kernel loaded by NOLO.;" \ + "echo" + +#define CONFIG_BOOTCOMMAND \ + "run emmcboot;" \ + "run immcboot;" \ + "run noloboot;" \ + "echo" + +#define CONFIG_AUTO_COMPLETE +/* + * Miscellaneous configurable options + */ +#define CONFIG_SYS_LONGHELP /* undef to save memory */ +#define CONFIG_SYS_HUSH_PARSER /* use "hush" command parser */ +#define CONFIG_SYS_PROMPT_HUSH_PS2 "> " +#define CONFIG_SYS_PROMPT "Nokia RX-51 # " +#define CONFIG_SYS_CBSIZE 256 /* Console I/O Buffer Size */ +/* Print Buffer Size */ +#define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT) + 16) +#define CONFIG_SYS_MAXARGS 16 /* max number of command args */ +/* Boot Argument Buffer Size */ +#define CONFIG_SYS_BARGSIZE (CONFIG_SYS_CBSIZE) + +#define CONFIG_SYS_MEMTEST_START (OMAP34XX_SDRC_CS0) /* memtest works on */ +#define CONFIG_SYS_MEMTEST_END (OMAP34XX_SDRC_CS0 + 0x01F00000) /* 31MB */ + +#define CONFIG_SYS_LOAD_ADDR (OMAP34XX_SDRC_CS0) /* default load address */ + +/* + * OMAP3 has 12 GP timers, they can be driven by the system clock + * (12/13/16.8/19.2/38.4MHz) or by 32KHz clock. We use 13MHz (V_SCLK). + * This rate is divided by a local divisor. + */ +#define CONFIG_SYS_TIMERBASE (OMAP34XX_GPT2) +#define CONFIG_SYS_PTV 2 /* Divisor: 2^(PTV+1) => 8 */ +#define CONFIG_SYS_HZ 1000 + +/*----------------------------------------------------------------------- + * Stack sizes + * + * The stack sizes are set up in start.S using the settings below + */ +#define CONFIG_STACKSIZE (128 << 10) /* regular stack 128 KiB */ +#ifdef CONFIG_USE_IRQ +#define CONFIG_STACKSIZE_IRQ (4 << 10) /* IRQ stack 4 KiB */ +#define CONFIG_STACKSIZE_FIQ (4 << 10) /* FIQ stack 4 KiB */ +#endif + +/*----------------------------------------------------------------------- + * Physical Memory Map + */ +#define CONFIG_NR_DRAM_BANKS 2 /* CS1 may or may not be populated */ +#define PHYS_SDRAM_1 OMAP34XX_SDRC_CS0 +#define PHYS_SDRAM_2 OMAP34XX_SDRC_CS1 + +/* SDRAM Bank Allocation method */ +#define SDRC_R_B_C 1 + +/*----------------------------------------------------------------------- + * FLASH and environment organization + */ + +#define CONFIG_ENV_IS_NOWHERE + +#define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM_1 +#define CONFIG_SYS_INIT_RAM_ADDR 0x4020f800 +#define CONFIG_SYS_INIT_RAM_SIZE 0x800 +#define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE) + +#endif /* __CONFIG_H */

On Saturday 17 December 2011 12:03:16 Pali Rohár wrote:
--- /dev/null +++ b/board/nokia/rx51/Makefile
+clean:
- rm -f $(OBJS)
+distclean: clean
- rm -f $(LIB) core *.bak $(obj).depend
these are unused. delete these targets.
this file def needs checkpatch.pl run on it ... many long lines -mike

* Configuration is done via env variables bootmenu_delay and bootmenu_<num>:
bootmenu_delay=<delay> bootmenu_<num>="<title>=<commands>" (title and commands are separated by first char '=')
<delay> is delay in seconds of autobooting first entry <num> is boot menu entry, starting from zero <title> is text shown in boot screen <commands> are commands which will be executed when menu entry will be selected
* First argument of bootmenu command override bootmenu_delay env * If env bootmenu_delay or bootmenu argument is not specified, 10 seconds for delay will be used * If delay is 0, no entry will be show on screen, screen will not be cleared and first entry will be called * If delay is less then 0, no autoboot delay will be used * Boot Menu will stop finding next menu entry if last was not defined * Boot Menu always add menu entry "U-Boot console" at end of all entries
* Example using:
setenv bootmenu_0 Boot first kernel=bootm 0x82000000 # Set first menu entry setenv bootmenu_1 Boot second kernel=bootm 0x83000000 # Set second menu entry setenv bootmenu_2 Reset board=reset # Set third menu entry setenv bootmenu_3 U-Boot boot order=boot # Set four menu entry (default u-boot boot script) setenv bootmenu_4 # Empty string is end of all bootmenu entries bootmenu 20 # Run bootmenu with autoboot delay 20s
Signed-off-by: Pali Rohár pali.rohar@gmail.com --- common/Makefile | 1 + common/cmd_bootmenu.c | 355 ++++++++++++++++++++++++++++++++++++++++++++++ include/config_cmd_all.h | 1 + 3 files changed, 357 insertions(+), 0 deletions(-) create mode 100644 common/cmd_bootmenu.c
diff --git a/common/Makefile b/common/Makefile index 0552f19..4e08431 100644 --- a/common/Makefile +++ b/common/Makefile @@ -67,6 +67,7 @@ COBJS-$(CONFIG_CMD_SOURCE) += cmd_source.o COBJS-$(CONFIG_CMD_BDI) += cmd_bdinfo.o COBJS-$(CONFIG_CMD_BEDBUG) += bedbug.o cmd_bedbug.o COBJS-$(CONFIG_CMD_BMP) += cmd_bmp.o +COBJS-$(CONFIG_CMD_BOOTMENU) += cmd_bootmenu.o COBJS-$(CONFIG_CMD_BOOTLDR) += cmd_bootldr.o COBJS-$(CONFIG_CMD_CACHE) += cmd_cache.o COBJS-$(CONFIG_CMD_CLR) += cmd_clr.o diff --git a/common/cmd_bootmenu.c b/common/cmd_bootmenu.c new file mode 100644 index 0000000..28f5da7 --- /dev/null +++ b/common/cmd_bootmenu.c @@ -0,0 +1,355 @@ +/* + * (C) Copyright 2011 Pali Rohár pali.rohar@gmail.com + * + * 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 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 + */ + +#include <common.h> +#include <command.h> +#include <watchdog.h> +#include <linux/string.h> + +#ifdef CONFIG_SYS_HUSH_PARSER +#include <hush.h> +#endif + +static char * get_option(int n) { + + char name[] = "bootmenu_\0\0"; + + if ( n < 0 || n > 99 ) + return NULL; + + sprintf(name+9, "%d", n); + + return getenv(name); + +} + +static char * get_end_of_title(char * str) { + + if ( ! str ) + return NULL; + + return strchr(str, '='); + +} + +static int print_title(char * begin, char * end) { + + if ( ! begin || ! end || end < begin ) + return 1; + + while ( begin != end ) + putc(*(begin++)); + + return 0; + +} + +static int print_entry(int n, int reverse) { + + char * str = get_option(n); + char * end = get_end_of_title(str); + + if ( ! end ) + return 1; + + printf(ANSI_CURSOR_POSITION, n+4, 1); + + if ( reverse ) + printf(ANSI_COLOR_REVERSE); + + printf(" "); + print_title(str, end); + printf(ANSI_CLEAR_LINE_TO_END); + + if ( reverse ) + printf(ANSI_COLOR_RESET); + + return 0; + +} + +static int print_menu(int active) { + + int n = 0; + + printf(ANSI_CURSOR_POSITION, 1, 1); + printf(ANSI_CLEAR_LINE); + printf(ANSI_CURSOR_POSITION, 2, 1); + printf(" *** U-Boot BOOT MENU ***"); + printf(ANSI_CLEAR_LINE_TO_END); + printf(ANSI_CURSOR_POSITION, 3, 1); + printf(ANSI_CLEAR_LINE); + + while ( 1 ) { + + int ret = print_entry(n, n == active ? 1 : 0); + + if ( ret == 1 ) + break; + + ++n; + + } + + printf(ANSI_CURSOR_POSITION, n+4, 1); + + if ( n == active ) + printf(ANSI_COLOR_REVERSE); + + printf(" U-Boot console"); + printf(ANSI_CLEAR_LINE_TO_END); + + if ( n == active ) + printf(ANSI_COLOR_RESET); + + printf(ANSI_CURSOR_POSITION, n+5, 1); + printf(ANSI_CLEAR_LINE); + printf(ANSI_CURSOR_POSITION, n+6, 1); + printf(" Press UP/DOWN to move, ENTER to select"); + printf(ANSI_CLEAR_LINE_TO_END); + printf(ANSI_CURSOR_POSITION, n+7, 1); + printf(ANSI_CLEAR_LINE); + + return n; + +} + +int do_bootmenu(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { + + int active = 0; + int abort = 0; + int key = 0; /* 0 - NONE, 1 - UP, 2 - DOWN, 3 - SELECT */ + int esc = 0; + int count = 0; + int delay = 10; + int instant = 0; + char * delay_str = NULL; + + if ( argc >= 2 ) + delay_str = argv[1]; + + if ( ! delay_str ) + delay_str = getenv("bootmenu_delay"); + + if ( delay_str ) + delay = (int)simple_strtol(delay_str, NULL, 10); + + if ( delay == 0 ) { + + /* prevent setting U-Boot console as first menu entry */ + if ( get_end_of_title(get_option(0)) ) + count = 1; + + instant = 1; + + } + + if ( delay < 0 ) + abort = 1; + + if ( ! instant ) { + + printf(ANSI_CLEAR_CONSOLE); + printf(ANSI_CURSOR_POSITION, 1, 1); + + } + + while ( 1 ) { + + if ( abort || delay > 0 ) + count = print_menu(active); + + if ( ! abort ) { + + if ( delay > 0 ) + printf(" Hit any key to stop autoboot: %2d ", delay); + + while ( delay > 0 ) { + + int i; + + for ( i = 0; i < 100; ++i ) { + + if ( tstc() ) { + + abort = 1; + key = getc(); + + if ( key == '\e' ) { + esc = 1; + key = 0; + } else if ( key == '\r' ) + key = 3; + else + key = 0; + + break; + + } + + WATCHDOG_RESET(); + udelay(10000); + + } + + if ( abort ) + break; + + --delay; + printf("\b\b\b%2d ", delay); + + } + + if ( delay <= 0 ) + key = 3; + + } else { + + while ( ! tstc() ) { + + WATCHDOG_RESET(); + udelay(10000); + + } + + key = getc(); + + if ( esc == 0 ) { + + if ( key == '\e' ) { + esc = 1; + key = 0; + } + + } else if ( esc == 1 ) { + + if ( key == '[' ) { + esc = 2; + key = 0; + } else + esc = 0; + + } else if ( esc == 2 || esc == 3 ) { + + if ( esc == 2 && key == '1' ) { + esc = 3; + key = 0; + } else + esc = 0; + + if ( key == 'A' ) + key = 1; + else if ( key == 'B' ) + key = 2; + else + key = 0; + + } + + if ( key == '\r' ) + key = 3; + + } + + if ( key == 1 ) { + + if ( active > 0 ) + --active; + + } else if ( key == 2 ) { + + if ( active < count ) + ++active; + + } else if ( key == 3 ) { + + char * str; + char * end; + + putc('\n'); + + if ( ! instant ) { + + printf(ANSI_CLEAR_CONSOLE); + printf(ANSI_CURSOR_POSITION, 1, 1); + + } + + WATCHDOG_RESET(); + + /* last entry is always U-Boot console */ + if ( active == count ) { + + printf("Starting U-Boot console\n\n"); + return 0; + + } + + str = get_option(active); + end = get_end_of_title(str); + + if ( ! end ) { + + printf("Invalid Boot Menu entry %d\nStarting U-Boot console\n\n", active); + return 0; + + } + + if ( ! end[1] ) { + + printf("Invalid Boot Menu entry %d: ", active); + print_title(str, end); + printf("\nStarting U-Boot console\n\n"); + return 0; + + } + + printf("Booting Boot Menu entry %d: ", active); + print_title(str, end); + printf(" ...\n\n"); + +# ifndef CONFIG_SYS_HUSH_PARSER + run_command(end+1, 0); +# else + parse_string_outer(end+1, FLAG_PARSE_SEMICOLON | FLAG_EXIT_FROM_LOOP); +# endif + + printf("\nFailed booting Boot Menu entry %d: ", active); + print_title(str, end); + printf("\nStarting U-Boot console\n\n"); + return 0; + + } + + } + + /* never happends */ + return 1; + +} + +U_BOOT_CMD( + bootmenu, 2, 1, do_bootmenu, + "ANSI terminal bootmenu", + "[delay]\n" + " - show ANSI terminal bootmenu with autoboot delay (default 10s)" +); diff --git a/include/config_cmd_all.h b/include/config_cmd_all.h index f3c49ed..6482ba8 100644 --- a/include/config_cmd_all.h +++ b/include/config_cmd_all.h @@ -20,6 +20,7 @@ #define CONFIG_CMD_BEDBUG /* Include BedBug Debugger */ #define CONFIG_CMD_BMP /* BMP support */ #define CONFIG_CMD_BOOTD /* bootd */ +#define CONFIG_CMD_BOOTMENU /* ANSI terminal Boot Menu */ #define CONFIG_CMD_BSP /* Board Specific functions */ #define CONFIG_CMD_CACHE /* icache, dcache */ #define CONFIG_CMD_CDP /* Cisco Discovery Protocol */

this needs checkpatch for sure
seems like this doesn't use the existing common/menu.c code ... shouldn't it ? -mike

On Sunday 18 December 2011 14:07:37 Mike Frysinger wrote:
this needs checkpatch for sure
seems like this doesn't use the existing common/menu.c code ... shouldn't it ? -mike
No my ANSI terminal bootmenu does not use common/menu.c (4 months ago, there was no menu.c file)

On Sunday 18 December 2011 14:12:38 Pali Rohár wrote:
On Sunday 18 December 2011 14:07:37 Mike Frysinger wrote:
this needs checkpatch for sure
seems like this doesn't use the existing common/menu.c code ... shouldn't it ?
No my ANSI terminal bootmenu does not use common/menu.c (4 months ago, there was no menu.c file)
so you'll be updating the patchseries to utilize common code that now exists ? -mike

On Sunday 18 December 2011 15:07:25 Mike Frysinger wrote:
On Sunday 18 December 2011 14:12:38 Pali Rohár wrote:
On Sunday 18 December 2011 14:07:37 Mike Frysinger wrote:
this needs checkpatch for sure
seems like this doesn't use the existing common/menu.c code ... shouldn't it ?
No my ANSI terminal bootmenu does not use common/menu.c (4 months ago, there was no menu.c file)
so you'll be updating the patchseries to utilize common code that now exists ? -mike
What is implemented in that file common/menu.c? It here any info/doc?

On Sunday 18 December 2011 15:16:21 Pali Rohár wrote:
On Sunday 18 December 2011 15:07:25 Mike Frysinger wrote:
On Sunday 18 December 2011 14:12:38 Pali Rohár wrote:
On Sunday 18 December 2011 14:07:37 Mike Frysinger wrote:
this needs checkpatch for sure
seems like this doesn't use the existing common/menu.c code ... shouldn't it ?
No my ANSI terminal bootmenu does not use common/menu.c (4 months ago, there was no menu.c file)
so you'll be updating the patchseries to utilize common code that now exists ?
What is implemented in that file common/menu.c? It here any info/doc?
doc/README.menu
if there are features you have/want that this code base doesn't support, the answer would be to enhance/extend rather than drop in an entirely new/parallel codebase. i know this is more work for you, but long term, the latter would be much more work for everyone. -mike

* default bootmenu contains: NOLO kernel, internal eMMC memory, external SD card, u-boot boot order * when keyboard is closed always boot NOLO kernel * when keyborad is open in CONFIG_PREBOOT try load bootmenu.scr from first FAT partition of internal eMMC memory (know as MyDocs) which (should) overwrite default bootmenu
Signed-off-by: Pali Rohár pali.rohar@gmail.com --- include/configs/nokia_rx51.h | 21 +++++++++++++++++---- 1 files changed, 17 insertions(+), 4 deletions(-)
diff --git a/include/configs/nokia_rx51.h b/include/configs/nokia_rx51.h index bb77d5c..ddb4ea4 100644 --- a/include/configs/nokia_rx51.h +++ b/include/configs/nokia_rx51.h @@ -134,6 +134,7 @@ #define CONFIG_CMD_MMC /* MMC support */ #undef CONFIG_CMD_ONENAND /* NAND support */
+#define CONFIG_CMD_BOOTMENU /* ANSI terminal Boot Menu */ #define CONFIG_CMD_CLR /* ANSI terminal clear screen command */
#undef CONFIG_CMD_FLASH /* flinfo, erase, protect */ @@ -185,8 +186,6 @@ int rx51_kp_getc(void); #endif
/* Environment information */ -#define CONFIG_BOOTDELAY 3 - #define CONFIG_EXTRA_ENV_SETTINGS \ "usbtty=cdc_acm\0" \ "stdin=vga\0" \ @@ -232,10 +231,21 @@ int rx51_kp_getc(void); "fi;" \ "fi\0" \ "immcboot=setenv mmcnum 1; run trymmcboot\0" \ - "emmcboot=setenv mmcnum 0; run trymmcboot\0" + "emmcboot=setenv mmcnum 0; run trymmcboot\0" \ + "menucmd=bootmenu\0" \ + "bootmenu_0=Internal flash=run noloboot\0" \ + "bootmenu_1=Internal eMMC=run immcboot\0" \ + "bootmenu_2=External SD card=run emmcboot\0" \ + "bootmenu_3=U-Boot boot order=boot\0" \ + "bootmenu_delay=3\0"
#define CONFIG_PREBOOT \ - "if test $slide_sw != open; then run noloboot; fi;" + "if test $slide_sw = open; then " \ + "setenv mmcnum 1; setenv mmcpart 1; setenv mmctype fat; setenv mmcfile bootmenu.scr;" \ + "run trymmcscript;" \ + "else " \ + "setenv bootmenu_delay 0;" \ + "fi"
#define CONFIG_PREMONITOR \ "echo Extra commands:;" \ @@ -253,7 +263,10 @@ int rx51_kp_getc(void); "run noloboot;" \ "echo"
+#define CONFIG_MENUCMD + #define CONFIG_AUTO_COMPLETE + /* * Miscellaneous configurable options */

Dear Pali =?ISO-8859-1?Q?Roh=E1r?=,
In message 2772527.Czs1Sl5aoH@pali-elitebook you wrote:
I'm sending new patch series, which add Nokia RX-51 support to U-Boot. This patches are based on master commit 06e42c6e2ce269667daecd6229d0b7c81383 8203 and now U-Boot working on Nokia RX-51.
This patch series generates a ton of checkpatch warnings. Please run your code through checkpatch, and make sure to read the respective hits at http://www.denx.de/wiki/U-Boot/Patches ; then clean up the code and resubmit.
Um, and while doing so, please make sure NOT to send all this stuff base64 encoded. Thanks.
WARNING: space prohibited between function name and open parenthesis '(' #130: FILE: arch/arm/lib/bootm.c:128: + s = getenv ("atagaddr");
WARNING: consider using kstrto* in preference to simple_strtoul #132: FILE: arch/arm/lib/bootm.c:130: + bd->bi_boot_params = simple_strtoul(s, NULL, 16);
WARNING: space prohibited between function name and open parenthesis '(' #137: FILE: arch/arm/lib/bootm.c:135: + params = tag_next (params);
WARNING: space prohibited between function name and open parenthesis '(' #145: FILE: arch/arm/lib/bootm.c:142: + setup_start_tag (bd);
WARNING: space prohibited between function name and open parenthesis '(' #162: FILE: arch/arm/lib/bootm.c:167: +#if defined (CONFIG_SETUP_MEMORY_TAGS) || \
WARNING: please, no spaces at the start of a line #163: FILE: arch/arm/lib/bootm.c:168: + defined (CONFIG_CMDLINE_TAG) || $
WARNING: space prohibited between function name and open parenthesis '(' #163: FILE: arch/arm/lib/bootm.c:168: + defined (CONFIG_CMDLINE_TAG) || \
WARNING: please, no spaces at the start of a line #164: FILE: arch/arm/lib/bootm.c:169: + defined (CONFIG_INITRD_TAG) || $
WARNING: space prohibited between function name and open parenthesis '(' #164: FILE: arch/arm/lib/bootm.c:169: + defined (CONFIG_INITRD_TAG) || \
WARNING: please, no spaces at the start of a line #165: FILE: arch/arm/lib/bootm.c:170: + defined (CONFIG_SERIAL_TAG) || $
WARNING: space prohibited between function name and open parenthesis '(' #165: FILE: arch/arm/lib/bootm.c:170: + defined (CONFIG_SERIAL_TAG) || \
WARNING: please, no spaces at the start of a line #166: FILE: arch/arm/lib/bootm.c:171: + defined (CONFIG_REVISION_TAG)$
WARNING: space prohibited between function name and open parenthesis '(' #166: FILE: arch/arm/lib/bootm.c:171: + defined (CONFIG_REVISION_TAG)
total: 0 errors, 13 warnings, 53 lines checked
/home/wd/Mail/U-Boot/12777 has style problems, please review.
If any of these errors are false positives, please report them to the maintainer, see CHECKPATCH in MAINTAINERS. ERROR: space prohibited after that open parenthesis '(' #194: FILE: include/twl4030.h:238: + ( (devgrp) << 13 | 1 << 12 | (grp) << 9 | (type2) << 7 \
total: 1 errors, 0 warnings, 110 lines checked
/home/wd/Mail/U-Boot/12778 has style problems, please review.
If any of these errors are false positives, please report them to the maintainer, see CHECKPATCH in MAINTAINERS. total: 0 errors, 0 warnings, 24 lines checked
/home/wd/Mail/U-Boot/12779 has no obvious style problems and is ready for submission. WARNING: line over 80 characters #117: FILE: common/main.c:1028: + case '\e': /* ANSI escape char */
WARNING: line over 80 characters #145: FILE: common/main.c:1056: + /* Ignore ANSI escape sequences generated by keyboard */
ERROR: space prohibited after that open parenthesis '(' #147: FILE: common/main.c:1058: + if ( c >= 'A' && c <= 'D' ) {
ERROR: space prohibited before that close parenthesis ')' #147: FILE: common/main.c:1058: + if ( c >= 'A' && c <= 'D' ) {
WARNING: line over 80 characters #156: FILE: common/main.c:1067: + } else if (esc == 3 && n < CONFIG_SYS_CBSIZE-4) {
total: 2 errors, 3 warnings, 62 lines checked
/home/wd/Mail/U-Boot/12780 has style problems, please review.
If any of these errors are false positives, please report them to the maintainer, see CHECKPATCH in MAINTAINERS. total: 0 errors, 0 warnings, 8 lines checked
/home/wd/Mail/U-Boot/12781 has no obvious style problems and is ready for submission. WARNING: line over 80 characters #129: FILE: drivers/video/cfb_console.c:712: + video_hw_rectfill(VIDEO_PIXEL_SIZE, /* bytes per pixel */
WARNING: line over 80 characters #130: FILE: drivers/video/cfb_console.c:713: + VIDEO_FONT_WIDTH * begin, /* dest pos x */ /* FIXME: correct? */
WARNING: line over 80 characters #131: FILE: drivers/video/cfb_console.c:714: + video_logo_height + CONSOLE_ROW_SIZE * line, /* dest pos y */ /* FIXME: correct? */
WARNING: line over 80 characters #132: FILE: drivers/video/cfb_console.c:715: + VIDEO_FONT_WIDTH * ( end - begin ), /* frame width */ /* FIXME: correct? */
ERROR: space prohibited after that open parenthesis '(' #132: FILE: drivers/video/cfb_console.c:715: + VIDEO_FONT_WIDTH * ( end - begin ), /* frame width */ /* FIXME: correct? */
ERROR: space prohibited before that close parenthesis ')' #132: FILE: drivers/video/cfb_console.c:715: + VIDEO_FONT_WIDTH * ( end - begin ), /* frame width */ /* FIXME: correct? */
WARNING: line over 80 characters #133: FILE: drivers/video/cfb_console.c:716: + VIDEO_FONT_HEIGHT, /* frame height */
WARNING: line over 80 characters #134: FILE: drivers/video/cfb_console.c:717: + bgx /* fill color */
ERROR: space prohibited after that open parenthesis '(' #138: FILE: drivers/video/cfb_console.c:721: + if ( begin == 0 && end == CONSOLE_COLS )
ERROR: space prohibited before that close parenthesis ')' #138: FILE: drivers/video/cfb_console.c:721: + if ( begin == 0 && end == CONSOLE_COLS )
WARNING: line over 80 characters #139: FILE: drivers/video/cfb_console.c:722: + memsetl(CONSOLE_ROW_FIRST + CONSOLE_ROW_SIZE * line, /* offset of row */
WARNING: line over 80 characters #140: FILE: drivers/video/cfb_console.c:723: + CONSOLE_ROW_SIZE >> 2, /* length of row */
WARNING: line over 80 characters #141: FILE: drivers/video/cfb_console.c:724: + bgx /* fill color */
ERROR: space prohibited after that open parenthesis '(' #144: FILE: drivers/video/cfb_console.c:727: + for ( i = 0; i < VIDEO_FONT_HEIGHT; ++i )
ERROR: space prohibited before that close parenthesis ')' #144: FILE: drivers/video/cfb_console.c:727: + for ( i = 0; i < VIDEO_FONT_HEIGHT; ++i )
WARNING: line over 80 characters #145: FILE: drivers/video/cfb_console.c:728: + memsetl(CONSOLE_ROW_FIRST + CONSOLE_ROW_SIZE * line + /* offset of row */
WARNING: line over 80 characters #146: FILE: drivers/video/cfb_console.c:729: + VIDEO_FONT_WIDTH * VIDEO_PIXEL_SIZE * begin + /* offset of col */
WARNING: line over 80 characters #147: FILE: drivers/video/cfb_console.c:730: + i * VIDEO_LINE_LEN, /* col offset of i-th line */
WARNING: line over 80 characters #148: FILE: drivers/video/cfb_console.c:731: + (VIDEO_FONT_WIDTH * VIDEO_PIXEL_SIZE * ( end - begin + 1)) >> 2, /* length to end of line */
ERROR: space prohibited after that open parenthesis '(' #148: FILE: drivers/video/cfb_console.c:731: + (VIDEO_FONT_WIDTH * VIDEO_PIXEL_SIZE * ( end - begin + 1)) >> 2, /* length to end of line */
WARNING: line over 80 characters #149: FILE: drivers/video/cfb_console.c:732: + bgx /* fill color */
total: 7 errors, 14 warnings, 68 lines checked
/home/wd/Mail/U-Boot/12782 has style problems, please review.
If any of these errors are false positives, please report them to the maintainer, see CHECKPATCH in MAINTAINERS. total: 0 errors, 0 warnings, 98 lines checked
/home/wd/Mail/U-Boot/12783 has no obvious style problems and is ready for submission. ERROR: do not initialise statics to 0 or NULL #112: FILE: drivers/video/cfb_console.c:381: +static int ansi_buf_size = 0;
ERROR: do not initialise statics to 0 or NULL #113: FILE: drivers/video/cfb_console.c:382: +static int ansi_colors_need_revert = 0;
WARNING: space prohibited between function name and open parenthesis '(' #166: FILE: drivers/video/cfb_console.c:930: + if (ansi_buf_size >= sizeof (ansi_buf))
WARNING: line over 80 characters #236: FILE: drivers/video/cfb_console.c:1000: + if ((ansi_buf[i] >= 'A' && ansi_buf[i] <= 'H') || ansi_buf[i] == 'J' || ansi_buf[i] == 'K' || ansi_buf[i] == 'm') {
ERROR: that open brace { should be on the previous line #245: FILE: drivers/video/cfb_console.c:1009: + if (fail) + {
ERROR: that open brace { should be on the previous line #253: FILE: drivers/video/cfb_console.c:1017: + if (flush) + {
WARNING: line over 80 characters #298: FILE: drivers/video/cfb_console.c:1062: + console_clear_line(console_row, console_col, CONSOLE_COLS-1);
WARNING: line over 80 characters #300: FILE: drivers/video/cfb_console.c:1064: + console_clear_line(console_row, 0, console_col);
WARNING: line over 80 characters #302: FILE: drivers/video/cfb_console.c:1066: + console_clear_line(console_row, 0, CONSOLE_COLS-1);
WARNING: line over 80 characters #310: FILE: drivers/video/cfb_console.c:1074: + } else if (num1 == 7) { /* swap colors (only once) */
ERROR: that open brace { should be on the previous line #321: FILE: drivers/video/cfb_console.c:1085: + else + {
ERROR: else should follow close brace '}' #321: FILE: drivers/video/cfb_console.c:1085: + } + else
total: 6 errors, 6 warnings, 223 lines checked
/home/wd/Mail/U-Boot/12784 has style problems, please review.
If any of these errors are false positives, please report them to the maintainer, see CHECKPATCH in MAINTAINERS. total: 0 errors, 0 warnings, 14 lines checked
/home/wd/Mail/U-Boot/12785 has no obvious style problems and is ready for submission. total: 0 errors, 0 warnings, 52 lines checked
/home/wd/Mail/U-Boot/12786 has no obvious style problems and is ready for submission. WARNING: line over 80 characters #113: FILE: common/main.c:85: +#if defined (CONFIG_MENUKEY) && ! defined (CONFIG_MENUCMD) && ( ! defined(CONFIG_BOOTDELAY) || CONFIG_BOOTDELAY < 0 )
WARNING: space prohibited between function name and open parenthesis '(' #113: FILE: common/main.c:85: +#if defined (CONFIG_MENUKEY) && ! defined (CONFIG_MENUCMD) && ( ! defined(CONFIG_BOOTDELAY) || CONFIG_BOOTDELAY < 0 )
WARNING: space prohibited between function name and open parenthesis '(' #113: FILE: common/main.c:85: +#if defined (CONFIG_MENUKEY) && ! defined (CONFIG_MENUCMD) && ( ! defined(CONFIG_BOOTDELAY) || CONFIG_BOOTDELAY < 0 )
ERROR: space prohibited after that '!' (ctx:WxW) #113: FILE: common/main.c:85: +#if defined (CONFIG_MENUKEY) && ! defined (CONFIG_MENUCMD) && ( ! defined(CONFIG_BOOTDELAY) || CONFIG_BOOTDELAY < 0 ) ^
ERROR: space prohibited after that '!' (ctx:WxW) #113: FILE: common/main.c:85: +#if defined (CONFIG_MENUKEY) && ! defined (CONFIG_MENUCMD) && ( ! defined(CONFIG_BOOTDELAY) || CONFIG_BOOTDELAY < 0 ) ^
ERROR: space prohibited after that open parenthesis '(' #113: FILE: common/main.c:85: +#if defined (CONFIG_MENUKEY) && ! defined (CONFIG_MENUCMD) && ( ! defined(CONFIG_BOOTDELAY) || CONFIG_BOOTDELAY < 0 )
ERROR: space prohibited before that close parenthesis ')' #113: FILE: common/main.c:85: +#if defined (CONFIG_MENUKEY) && ! defined (CONFIG_MENUCMD) && ( ! defined(CONFIG_BOOTDELAY) || CONFIG_BOOTDELAY < 0 )
WARNING: line over 80 characters #114: FILE: common/main.c:86: +#error CONFIG_MENUKEY is defined, but not CONFIG_MENUCMD and/or CONFIG_BOOTDELAY >= 0
ERROR: do not initialise statics to 0 or NULL #120: FILE: common/main.c:92: +static int menucmd = 0;
WARNING: space prohibited between function name and open parenthesis '(' #146: FILE: common/main.c:253: +# if defined (CONFIG_MENUCMD) && defined (CONFIG_MENUKEY)
WARNING: space prohibited between function name and open parenthesis '(' #146: FILE: common/main.c:253: +# if defined (CONFIG_MENUCMD) && defined (CONFIG_MENUKEY)
WARNING: line over 80 characters #147: FILE: common/main.c:254: + if (CONFIG_MENUKEY == 0 || CONFIG_MENUKEY == getc())
total: 5 errors, 7 warnings, 73 lines checked
/home/wd/Mail/U-Boot/12787 has style problems, please review.
If any of these errors are false positives, please report them to the maintainer, see CHECKPATCH in MAINTAINERS. WARNING: space prohibited between function name and open parenthesis '(' #125: FILE: common/main.c:429: + if ((s = getenv ("premonitor")) != NULL) {
ERROR: do not use assignment in if condition #125: FILE: common/main.c:429: + if ((s = getenv ("premonitor")) != NULL) {
WARNING: space prohibited between function name and open parenthesis '(' #127: FILE: common/main.c:431: + run_command (s, 0);
WARNING: line over 80 characters #129: FILE: common/main.c:433: + parse_string_outer(s, FLAG_PARSE_SEMICOLON | FLAG_EXIT_FROM_LOOP);
total: 1 errors, 3 warnings, 25 lines checked
/home/wd/Mail/U-Boot/12788 has style problems, please review.
If any of these errors are false positives, please report them to the maintainer, see CHECKPATCH in MAINTAINERS. WARNING: externs should be avoided in .c files #282: FILE: board/nokia/rx51/rx51.c:59: +extern u32 rx51_atagaddr; /* atag address */
WARNING: externs should be avoided in .c files #283: FILE: board/nokia/rx51/rx51.c:60: +extern u32 rx51_kernaddr; /* attached kernel address */
WARNING: line over 80 characters #297: FILE: board/nokia/rx51/rx51.c:74: +"startaddr:\n" /* address where should be u-boot after relocation */
WARNING: line over 80 characters #299: FILE: board/nokia/rx51/rx51.c:76: +"relocaddr:\n" /* address of this relocaddr section after relocation */
WARNING: line over 80 characters #300: FILE: board/nokia/rx51/rx51.c:77: +" .word .\n" /* dot - address of this section (calculated at compile time, so same as after relocation) */
WARNING: line over 80 characters #307: FILE: board/nokia/rx51/rx51.c:84: +"kernaddr:\n" /* stored attached kernel address (u-boot + 0x40000) */
WARNING: line over 80 characters #310: FILE: board/nokia/rx51/rx51.c:87: +"save_boot_params:\n" /* function save_boot_params, called after reset */
WARNING: line over 80 characters #313: FILE: board/nokia/rx51/rx51.c:90: +" ldr r1, relocaddr\n" /* r1 - address where should be this relocaddr section after relocation */
WARNING: line over 80 characters #314: FILE: board/nokia/rx51/rx51.c:91: +" sub r0, r0, r1\n" /* r1 - calculated offset for relocation */
WARNING: line over 80 characters #315: FILE: board/nokia/rx51/rx51.c:92: +" ldr r1, startaddr\n" /* r1 - address where u-boot should be after relocation */
WARNING: line over 80 characters #316: FILE: board/nokia/rx51/rx51.c:93: +" add r0, r0, r1\n" /* r0 - address where is u-boot (address after relocation + offset) */
WARNING: line over 80 characters #319: FILE: board/nokia/rx51/rx51.c:96: +" bne reloc\n" /* start relocation if u-boot is not loaded at correct address CONFIG_SYS_TEXT_BASE */
WARNING: line over 80 characters #320: FILE: board/nokia/rx51/rx51.c:97: +" bx lr\n" /* else return back to reset section (relocation is not needed) */
WARNING: line over 80 characters #324: FILE: board/nokia/rx51/rx51.c:101: +" add r2, r0, #0x40000\n" /* r2 - address where is attached kernel (u-boot address + kernel offset 0x40000) - also end address of u-boot */
WARNING: line over 80 characters #334: FILE: board/nokia/rx51/rx51.c:111: +" ldr pc, startaddr\n" /* jump to start section (where should be u-boot after relocation) and restart u-boot */
WARNING: line over 80 characters #375: FILE: board/nokia/rx51/rx51.c:152: + twl4030_i2c_write_u8(TWL4030_CHIP_PM_MASTER, msg >> 8, TWL4030_PM_MASTER_PB_WORD_MSB);
WARNING: line over 80 characters #376: FILE: board/nokia/rx51/rx51.c:153: + twl4030_i2c_write_u8(TWL4030_CHIP_PM_MASTER, msg & 0xff, TWL4030_PM_MASTER_PB_WORD_LSB);
WARNING: line over 80 characters #403: FILE: board/nokia/rx51/rx51.c:180: + twl4030_i2c_write_u8(TWL4030_CHIP_PM_MASTER, 0x02, TWL4030_PM_MASTER_PB_CFG);
ERROR: do not initialise statics to 0 or NULL #432: FILE: board/nokia/rx51/rx51.c:209: +static unsigned long int twl_wd_time = 0; /* last time of watchdog reset */
WARNING: Use of volatile is usually wrong: see Documentation/volatile-considered-harmful.txt #433: FILE: board/nokia/rx51/rx51.c:210: +static volatile unsigned long int twl_i2c_lock;
ERROR: space prohibited after that open parenthesis '(' #444: FILE: board/nokia/rx51/rx51.c:221: + if ( get_timer(twl_wd_time) < 4 * CONFIG_SYS_HZ )
ERROR: space prohibited before that close parenthesis ')' #444: FILE: board/nokia/rx51/rx51.c:221: + if ( get_timer(twl_wd_time) < 4 * CONFIG_SYS_HZ )
ERROR: space prohibited after that open parenthesis '(' #448: FILE: board/nokia/rx51/rx51.c:225: + if ( test_and_set_bit(0, &twl_i2c_lock) )
ERROR: space prohibited before that close parenthesis ')' #448: FILE: board/nokia/rx51/rx51.c:225: + if ( test_and_set_bit(0, &twl_i2c_lock) )
WARNING: line over 80 characters #452: FILE: board/nokia/rx51/rx51.c:229: + twl4030_i2c_read_u8(TWL4030_CHIP_PM_RECEIVER, &timeout, TWL4030_PM_RECEIVER_WATCHDOG_CFG);
ERROR: space prohibited after that open parenthesis '(' #456: FILE: board/nokia/rx51/rx51.c:233: + if ( timeout != 0 )
ERROR: space prohibited before that close parenthesis ')' #456: FILE: board/nokia/rx51/rx51.c:233: + if ( timeout != 0 )
WARNING: line over 80 characters #457: FILE: board/nokia/rx51/rx51.c:234: + twl4030_i2c_write_u8(TWL4030_CHIP_PM_RECEIVER, 31, TWL4030_PM_RECEIVER_WATCHDOG_CFG);
ERROR: do not initialise statics to 0 or NULL #495: FILE: board/nokia/rx51/rx51.c:272: +static u8 keybuf_head = 0;
ERROR: do not initialise statics to 0 or NULL #496: FILE: board/nokia/rx51/rx51.c:273: +static u8 keybuf_tail = 0;
WARNING: line over 80 characters #532: FILE: board/nokia/rx51/rx51.c:309: + if (!(mods & 2) && (k == 18 || k == 31 || k == 33 || k == 34)) { /* cursor keys, without fn */
ERROR: space prohibited after that open parenthesis '(' #582: FILE: board/nokia/rx51/rx51.c:359: + if ( test_and_set_bit(0, &twl_i2c_lock) )
ERROR: space prohibited before that close parenthesis ')' #582: FILE: board/nokia/rx51/rx51.c:359: + if ( test_and_set_bit(0, &twl_i2c_lock) )
WARNING: line over 80 characters #764: FILE: board/nokia/rx51/rx51.h:108: + MUX_VAL(CP(GPMC_NCS6), (IEN | PTD | DIS | M1)) /*SYS_nDMA_REQ2*/\
WARNING: line over 80 characters #765: FILE: board/nokia/rx51/rx51.h:109: + MUX_VAL(CP(GPMC_NCS7), (IEN | PTU | EN | M1)) /*SYS_nDMA_REQ3*/\
WARNING: line over 80 characters #770: FILE: board/nokia/rx51/rx51.h:114: + MUX_VAL(CP(GPMC_NADV_ALE), (IDIS | PTD | DIS | M0)) /*GPMC_nADV_ALE*/\
WARNING: line over 80 characters #773: FILE: board/nokia/rx51/rx51.h:117: + MUX_VAL(CP(GPMC_NBE0_CLE), (IDIS | PTD | DIS | M0)) /*GPMC_nBE0_CLE*/\
WARNING: line over 80 characters #833: FILE: board/nokia/rx51/rx51.h:177: + MUX_VAL(CP(MCBSP2_CLKX), (IEN | PTD | DIS | M0)) /*McBSP2_CLKX*/\
WARNING: line over 80 characters #872: FILE: board/nokia/rx51/rx51.h:216: + MUX_VAL(CP(MCBSP4_CLKX), (IEN | PTD | DIS | M1)) /*SSI1_DAT_RX*/\
WARNING: line over 80 characters #873: FILE: board/nokia/rx51/rx51.h:217: + MUX_VAL(CP(MCBSP4_DR), (IEN | PTD | DIS | M1)) /*SSI1_FLAG_RX*/\
WARNING: line over 80 characters #874: FILE: board/nokia/rx51/rx51.h:218: + MUX_VAL(CP(MCBSP4_DX), (IEN | PTD | DIS | M1)) /*SSI1_RDY_RX*/\
WARNING: line over 80 characters #884: FILE: board/nokia/rx51/rx51.h:228: + MUX_VAL(CP(UART3_CTS_RCTX), (IEN | PTD | EN | M0)) /*UART3_CTS_RCTX*/\
WARNING: line over 80 characters #885: FILE: board/nokia/rx51/rx51.h:229: + MUX_VAL(CP(UART3_RTS_SD), (IDIS | PTD | DIS | M0)) /*UART3_RTS_SD */\
WARNING: line over 80 characters #886: FILE: board/nokia/rx51/rx51.h:230: + MUX_VAL(CP(UART3_RX_IRRX), (IEN | PTD | DIS | M0)) /*UART3_RX_IRRX*/\
WARNING: line over 80 characters #887: FILE: board/nokia/rx51/rx51.h:231: + MUX_VAL(CP(UART3_TX_IRTX), (IDIS | PTD | DIS | M0)) /*UART3_TX_IRTX*/\
WARNING: line over 80 characters #892: FILE: board/nokia/rx51/rx51.h:236: + MUX_VAL(CP(HSUSB0_DATA0), (IEN | PTD | DIS | M0)) /*HSUSB0_DATA0*/\
WARNING: line over 80 characters #893: FILE: board/nokia/rx51/rx51.h:237: + MUX_VAL(CP(HSUSB0_DATA1), (IEN | PTD | DIS | M0)) /*HSUSB0_DATA1*/\
WARNING: line over 80 characters #894: FILE: board/nokia/rx51/rx51.h:238: + MUX_VAL(CP(HSUSB0_DATA2), (IEN | PTD | DIS | M0)) /*HSUSB0_DATA2*/\
WARNING: line over 80 characters #895: FILE: board/nokia/rx51/rx51.h:239: + MUX_VAL(CP(HSUSB0_DATA3), (IEN | PTD | DIS | M0)) /*HSUSB0_DATA3*/\
WARNING: line over 80 characters #896: FILE: board/nokia/rx51/rx51.h:240: + MUX_VAL(CP(HSUSB0_DATA4), (IEN | PTD | DIS | M0)) /*HSUSB0_DATA4*/\
WARNING: line over 80 characters #897: FILE: board/nokia/rx51/rx51.h:241: + MUX_VAL(CP(HSUSB0_DATA5), (IEN | PTD | DIS | M0)) /*HSUSB0_DATA5*/\
WARNING: line over 80 characters #898: FILE: board/nokia/rx51/rx51.h:242: + MUX_VAL(CP(HSUSB0_DATA6), (IEN | PTD | DIS | M0)) /*HSUSB0_DATA6*/\
WARNING: line over 80 characters #899: FILE: board/nokia/rx51/rx51.h:243: + MUX_VAL(CP(HSUSB0_DATA7), (IEN | PTD | DIS | M0)) /*HSUSB0_DATA7*/\
WARNING: line over 80 characters #911: FILE: board/nokia/rx51/rx51.h:255: + MUX_VAL(CP(MCSPI1_SOMI), (IEN | PTD | DIS | M0)) /*McSPI1_SOMI*/\
WARNING: line over 80 characters #916: FILE: board/nokia/rx51/rx51.h:260: + MUX_VAL(CP(MCSPI1_CS3), (IEN | PTU | DIS | M3)) /*HSUSB2_DATA2*/\
WARNING: line over 80 characters #917: FILE: board/nokia/rx51/rx51.h:261: + MUX_VAL(CP(MCSPI2_CLK), (IEN | PTU | DIS | M3)) /*HSUSB2_DATA7*/\
WARNING: line over 80 characters #918: FILE: board/nokia/rx51/rx51.h:262: + MUX_VAL(CP(MCSPI2_SIMO), (IEN | PTU | DIS | M3)) /*HSUSB2_DATA4*/\
WARNING: line over 80 characters #919: FILE: board/nokia/rx51/rx51.h:263: + MUX_VAL(CP(MCSPI2_SOMI), (IEN | PTU | DIS | M3)) /*HSUSB2_DATA5*/\
WARNING: line over 80 characters #920: FILE: board/nokia/rx51/rx51.h:264: + MUX_VAL(CP(MCSPI2_CS0), (IEN | PTU | DIS | M3)) /*HSUSB2_DATA6*/\
WARNING: line over 80 characters #921: FILE: board/nokia/rx51/rx51.h:265: + MUX_VAL(CP(MCSPI2_CS1), (IEN | PTU | DIS | M3)) /*HSUSB2_DATA3*/\
WARNING: line over 80 characters #926: FILE: board/nokia/rx51/rx51.h:270: + MUX_VAL(CP(ETK_D14_ES2), (IEN | PTU | DIS | M3)) /*HSUSB2_DATA0*/\
WARNING: line over 80 characters #927: FILE: board/nokia/rx51/rx51.h:271: + MUX_VAL(CP(ETK_D15_ES2), (IEN | PTU | DIS | M3)) /*HSUSB2_DATA1*/\
WARNING: line over 80 characters #934: FILE: board/nokia/rx51/rx51.h:278: + MUX_VAL(CP(SYS_BOOT2), (IEN | PTD | DIS | M4)) /*GPIO_4 - MMC1_WP*/\
WARNING: line over 80 characters #939: FILE: board/nokia/rx51/rx51.h:283: + MUX_VAL(CP(SYS_OFF_MODE), (IEN | PTD | DIS | M0)) /*SYS_OFF_MODE*/\
WARNING: line over 80 characters #940: FILE: board/nokia/rx51/rx51.h:284: + MUX_VAL(CP(SYS_CLKOUT1), (IEN | PTD | DIS | M0)) /*SYS_CLKOUT1*/\
WARNING: line over 80 characters #944: FILE: board/nokia/rx51/rx51.h:288: + MUX_VAL(CP(ETK_D0_ES2), (IEN | PTU | DIS | M3)) /*HSUSB1_DATA0*/\
WARNING: line over 80 characters #945: FILE: board/nokia/rx51/rx51.h:289: + MUX_VAL(CP(ETK_D1_ES2), (IEN | PTU | DIS | M3)) /*HSUSB1_DATA1*/\
WARNING: line over 80 characters #946: FILE: board/nokia/rx51/rx51.h:290: + MUX_VAL(CP(ETK_D2_ES2), (IEN | PTU | DIS | M3)) /*HSUSB1_DATA2*/\
WARNING: line over 80 characters #947: FILE: board/nokia/rx51/rx51.h:291: + MUX_VAL(CP(ETK_D3_ES2), (IEN | PTU | DIS | M3)) /*HSUSB1_DATA7*/\
WARNING: line over 80 characters #948: FILE: board/nokia/rx51/rx51.h:292: + MUX_VAL(CP(ETK_D4_ES2), (IEN | PTU | DIS | M3)) /*HSUSB1_DATA4*/\
WARNING: line over 80 characters #949: FILE: board/nokia/rx51/rx51.h:293: + MUX_VAL(CP(ETK_D5_ES2), (IEN | PTU | DIS | M3)) /*HSUSB1_DATA5*/\
WARNING: line over 80 characters #950: FILE: board/nokia/rx51/rx51.h:294: + MUX_VAL(CP(ETK_D6_ES2), (IEN | PTU | DIS | M3)) /*HSUSB1_DATA6*/\
WARNING: line over 80 characters #951: FILE: board/nokia/rx51/rx51.h:295: + MUX_VAL(CP(ETK_D7_ES2), (IEN | PTU | DIS | M3)) /*HSUSB1_DATA3*/\
WARNING: line over 80 characters #990: FILE: board/nokia/rx51/rx51.h:334: + MUX_VAL(CP(D2D_CLK26MI), (IEN | PTD | DIS | M0)) /*d2d_clk26mi*/\
WARNING: line over 80 characters #991: FILE: board/nokia/rx51/rx51.h:335: + MUX_VAL(CP(D2D_NRESPWRON), (IEN | PTD | EN | M0)) /*d2d_nrespwron*/\
WARNING: line over 80 characters #992: FILE: board/nokia/rx51/rx51.h:336: + MUX_VAL(CP(D2D_NRESWARM), (IEN | PTU | EN | M0)) /*d2d_nreswarm */\
WARNING: line over 80 characters #993: FILE: board/nokia/rx51/rx51.h:337: + MUX_VAL(CP(D2D_ARM9NIRQ), (IEN | PTD | DIS | M0)) /*d2d_arm9nirq */\
WARNING: line over 80 characters #994: FILE: board/nokia/rx51/rx51.h:338: + MUX_VAL(CP(D2D_UMA2P6FIQ), (IEN | PTD | DIS | M0)) /*d2d_uma2p6fiq*/\
WARNING: line over 80 characters #997: FILE: board/nokia/rx51/rx51.h:341: + MUX_VAL(CP(D2D_DMAREQ0), (IEN | PTD | DIS | M0)) /*d2d_dmareq0*/\
WARNING: line over 80 characters #998: FILE: board/nokia/rx51/rx51.h:342: + MUX_VAL(CP(D2D_DMAREQ1), (IEN | PTD | DIS | M0)) /*d2d_dmareq1*/\
WARNING: line over 80 characters #999: FILE: board/nokia/rx51/rx51.h:343: + MUX_VAL(CP(D2D_DMAREQ2), (IEN | PTD | DIS | M0)) /*d2d_dmareq2*/\
WARNING: line over 80 characters #1000: FILE: board/nokia/rx51/rx51.h:344: + MUX_VAL(CP(D2D_DMAREQ3), (IEN | PTD | DIS | M0)) /*d2d_dmareq3*/\
WARNING: line over 80 characters #1001: FILE: board/nokia/rx51/rx51.h:345: + MUX_VAL(CP(D2D_N3GTRST), (IEN | PTD | DIS | M0)) /*d2d_n3gtrst*/\
WARNING: line over 80 characters #1006: FILE: board/nokia/rx51/rx51.h:350: + MUX_VAL(CP(D2D_N3GRTCK), (IEN | PTD | DIS | M0)) /*d2d_n3grtck*/\
WARNING: line over 80 characters #1008: FILE: board/nokia/rx51/rx51.h:352: + MUX_VAL(CP(D2D_SWAKEUP), (IEN | PTD | EN | M0)) /*d2d_swakeup*/\
WARNING: line over 80 characters #1009: FILE: board/nokia/rx51/rx51.h:353: + MUX_VAL(CP(D2D_IDLEREQ), (IEN | PTD | DIS | M0)) /*d2d_idlereq*/\
WARNING: line over 80 characters #1010: FILE: board/nokia/rx51/rx51.h:354: + MUX_VAL(CP(D2D_IDLEACK), (IEN | PTU | EN | M0)) /*d2d_idleack*/\
WARNING: line over 80 characters #1015: FILE: board/nokia/rx51/rx51.h:359: + MUX_VAL(CP(D2D_MBUSFLAG), (IEN | PTD | DIS | M0)) /*d2d_mbusflag*/\
WARNING: line over 80 characters #1016: FILE: board/nokia/rx51/rx51.h:360: + MUX_VAL(CP(D2D_SBUSFLAG), (IEN | PTD | DIS | M0)) /*d2d_sbusflag*/\
WARNING: line over 80 characters #1088: FILE: include/configs/nokia_rx51.h:42: +#define CONFIG_ARMV7 /* This is an ARM V7 CPU core */
WARNING: line over 80 characters #1089: FILE: include/configs/nokia_rx51.h:43: +#define CONFIG_OMAP /* in a TI OMAP core */
WARNING: line over 80 characters #1090: FILE: include/configs/nokia_rx51.h:44: +#define CONFIG_OMAP34XX /* which is a 34XX */
WARNING: line over 80 characters #1091: FILE: include/configs/nokia_rx51.h:45: +#define CONFIG_OMAP3430 /* which is in a 3430 */
WARNING: line over 80 characters #1092: FILE: include/configs/nokia_rx51.h:46: +#define CONFIG_CHAINLOADER /* Loaded by NOLO */
WARNING: line over 80 characters #1093: FILE: include/configs/nokia_rx51.h:47: +#define CONFIG_L2_OFF /* kernel won't boot if l2 enabled (old u-boot tried but failed to enable it, due to a bug.) */
WARNING: line over 80 characters #1100: FILE: include/configs/nokia_rx51.h:54: +#define CONFIG_SDRC /* The chip has SDRC controller */
WARNING: line over 80 characters #1102: FILE: include/configs/nokia_rx51.h:56: +#include <asm/arch/cpu.h> /* get chip and board defs */
WARNING: line over 80 characters #1112: FILE: include/configs/nokia_rx51.h:66: +#define V_OSCK 26000000 /* Clock output from T2 */
WARNING: line over 80 characters #1115: FILE: include/configs/nokia_rx51.h:69: +#undef CONFIG_USE_IRQ /* no support for IRQs */
WARNING: line over 80 characters #1117: FILE: include/configs/nokia_rx51.h:71: +#define CONFIG_SKIP_LOWLEVEL_INIT /* NOLO set everything up */
WARNING: line over 80 characters #1119: FILE: include/configs/nokia_rx51.h:73: +#define CONFIG_CMDLINE_TAG /* enable passing kernel command line string */
WARNING: line over 80 characters #1120: FILE: include/configs/nokia_rx51.h:74: +#define CONFIG_INITRD_TAG /* enable passing initrd */
WARNING: line over 80 characters #1125: FILE: include/configs/nokia_rx51.h:79: +#define CONFIG_ENV_SIZE (128 << 10) /* 128 KiB Sector */
WARNING: line over 80 characters #1135: FILE: include/configs/nokia_rx51.h:89: +#define V_NS16550_CLK 48000000 /* 48MHz (APLL96/2) */
WARNING: line over 80 characters #1147: FILE: include/configs/nokia_rx51.h:101: +#define CONFIG_SERIAL3 3 /* UART3 on RX-51 */
ERROR: space required after that ',' (ctx:VxV) #1152: FILE: include/configs/nokia_rx51.h:106: +#define CONFIG_SYS_BAUDRATE_TABLE {4800, 9600, 19200, 38400, 57600,115200} ^
WARNING: line over 80 characters #1176: FILE: include/configs/nokia_rx51.h:130: +#define CONFIG_CMD_EXT2 /* EXT2 Support */
WARNING: line over 80 characters #1177: FILE: include/configs/nokia_rx51.h:131: +#define CONFIG_CMD_FAT /* FAT support */
WARNING: line over 80 characters #1179: FILE: include/configs/nokia_rx51.h:133: +#define CONFIG_CMD_I2C /* I2C serial bus support */
WARNING: line over 80 characters #1180: FILE: include/configs/nokia_rx51.h:134: +#define CONFIG_CMD_MMC /* MMC support */
WARNING: line over 80 characters #1181: FILE: include/configs/nokia_rx51.h:135: +#undef CONFIG_CMD_ONENAND /* NAND support */
WARNING: line over 80 characters #1183: FILE: include/configs/nokia_rx51.h:137: +#define CONFIG_CMD_CLR /* ANSI terminal clear screen command */
WARNING: line over 80 characters #1185: FILE: include/configs/nokia_rx51.h:139: +#undef CONFIG_CMD_FLASH /* flinfo, erase, protect */
WARNING: line over 80 characters #1186: FILE: include/configs/nokia_rx51.h:140: +#undef CONFIG_CMD_FPGA /* FPGA configuration Support */
WARNING: line over 80 characters #1188: FILE: include/configs/nokia_rx51.h:142: +#undef CONFIG_CMD_IMLS /* List all found images */
WARNING: line over 80 characters #1189: FILE: include/configs/nokia_rx51.h:143: +#undef CONFIG_CMD_NET /* bootp, tftpboot, rarpboot */
WARNING: line over 80 characters #1190: FILE: include/configs/nokia_rx51.h:144: +#undef CONFIG_CMD_NFS /* NFS support */
WARNING: line over 80 characters #1216: FILE: include/configs/nokia_rx51.h:170: +#define CONFIG_CFB_CONSOLE_ANSI /* Enable ANSI escape codes in framebuffer */
WARNING: line over 80 characters #1249: FILE: include/configs/nokia_rx51.h:203: + "scriptload=${mmctype}load mmc ${mmcnum}:${mmcpart} ${loadaddr} ${mmcfile}\0" \
WARNING: line over 80 characters #1250: FILE: include/configs/nokia_rx51.h:204: + "scriptboot=echo Running ${mmcfile} from mmc ${mmcnum}:${mmcpart} ...;" \
WARNING: line over 80 characters #1252: FILE: include/configs/nokia_rx51.h:206: + "uimageload=${mmctype}load mmc ${mmcnum}:${mmcpart} ${loadaddr} ${mmcfile}\0" \
WARNING: line over 80 characters #1253: FILE: include/configs/nokia_rx51.h:207: + "uimageboot=echo Booting ${mmcfile} from mmc ${mmcnum}:${mmcpart} ...;" \
WARNING: line over 80 characters #1306: FILE: include/configs/nokia_rx51.h:260: +#define CONFIG_SYS_LONGHELP /* undef to save memory */
WARNING: line over 80 characters #1307: FILE: include/configs/nokia_rx51.h:261: +#define CONFIG_SYS_HUSH_PARSER /* use "hush" command parser */
WARNING: line over 80 characters #1310: FILE: include/configs/nokia_rx51.h:264: +#define CONFIG_SYS_CBSIZE 256 /* Console I/O Buffer Size */
WARNING: line over 80 characters #1312: FILE: include/configs/nokia_rx51.h:266: +#define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT) + 16)
WARNING: line over 80 characters #1313: FILE: include/configs/nokia_rx51.h:267: +#define CONFIG_SYS_MAXARGS 16 /* max number of command args */
WARNING: line over 80 characters #1317: FILE: include/configs/nokia_rx51.h:271: +#define CONFIG_SYS_MEMTEST_START (OMAP34XX_SDRC_CS0) /* memtest works on */
WARNING: line over 80 characters #1318: FILE: include/configs/nokia_rx51.h:272: +#define CONFIG_SYS_MEMTEST_END (OMAP34XX_SDRC_CS0 + 0x01F00000) /* 31MB */
WARNING: line over 80 characters #1320: FILE: include/configs/nokia_rx51.h:274: +#define CONFIG_SYS_LOAD_ADDR (OMAP34XX_SDRC_CS0) /* default load address */
WARNING: line over 80 characters #1328: FILE: include/configs/nokia_rx51.h:282: +#define CONFIG_SYS_PTV 2 /* Divisor: 2^(PTV+1) => 8 */
WARNING: line over 80 characters #1336: FILE: include/configs/nokia_rx51.h:290: +#define CONFIG_STACKSIZE (128 << 10) /* regular stack 128 KiB */
WARNING: line over 80 characters #1338: FILE: include/configs/nokia_rx51.h:292: +#define CONFIG_STACKSIZE_IRQ (4 << 10) /* IRQ stack 4 KiB */
WARNING: line over 80 characters #1339: FILE: include/configs/nokia_rx51.h:293: +#define CONFIG_STACKSIZE_FIQ (4 << 10) /* FIQ stack 4 KiB */
WARNING: line over 80 characters #1345: FILE: include/configs/nokia_rx51.h:299: +#define CONFIG_NR_DRAM_BANKS 2 /* CS1 may or may not be populated */
WARNING: line over 80 characters #1361: FILE: include/configs/nokia_rx51.h:315: +#define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
total: 12 errors, 124 warnings, 1173 lines checked
/home/wd/Mail/U-Boot/12789 has style problems, please review.
If any of these errors are false positives, please report them to the maintainer, see CHECKPATCH in MAINTAINERS. ERROR: "foo * bar" should be "foo *bar" #178: FILE: common/cmd_bootmenu.c:32: +static char * get_option(int n) {
ERROR: open brace '{' following function declarations go on the next line #178: FILE: common/cmd_bootmenu.c:32: +static char * get_option(int n) {
ERROR: space prohibited after that open parenthesis '(' #182: FILE: common/cmd_bootmenu.c:36: + if ( n < 0 || n > 99 )
ERROR: space prohibited before that close parenthesis ')' #182: FILE: common/cmd_bootmenu.c:36: + if ( n < 0 || n > 99 )
ERROR: "foo * bar" should be "foo *bar" #191: FILE: common/cmd_bootmenu.c:45: +static char * get_end_of_title(char * str) {
ERROR: open brace '{' following function declarations go on the next line #191: FILE: common/cmd_bootmenu.c:45: +static char * get_end_of_title(char * str) {
ERROR: space prohibited after that '!' (ctx:WxW) #193: FILE: common/cmd_bootmenu.c:47: + if ( ! str ) ^
ERROR: space prohibited after that open parenthesis '(' #193: FILE: common/cmd_bootmenu.c:47: + if ( ! str )
ERROR: space prohibited before that close parenthesis ')' #193: FILE: common/cmd_bootmenu.c:47: + if ( ! str )
ERROR: "foo * bar" should be "foo *bar" #200: FILE: common/cmd_bootmenu.c:54: +static int print_title(char * begin, char * end) {
ERROR: open brace '{' following function declarations go on the next line #200: FILE: common/cmd_bootmenu.c:54: +static int print_title(char * begin, char * end) {
ERROR: space prohibited after that '!' (ctx:WxW) #202: FILE: common/cmd_bootmenu.c:56: + if ( ! begin || ! end || end < begin ) ^
ERROR: space prohibited after that '!' (ctx:WxW) #202: FILE: common/cmd_bootmenu.c:56: + if ( ! begin || ! end || end < begin ) ^
ERROR: space prohibited after that open parenthesis '(' #202: FILE: common/cmd_bootmenu.c:56: + if ( ! begin || ! end || end < begin )
ERROR: space prohibited before that close parenthesis ')' #202: FILE: common/cmd_bootmenu.c:56: + if ( ! begin || ! end || end < begin )
ERROR: space prohibited after that open parenthesis '(' #205: FILE: common/cmd_bootmenu.c:59: + while ( begin != end )
ERROR: space prohibited before that close parenthesis ')' #205: FILE: common/cmd_bootmenu.c:59: + while ( begin != end )
ERROR: open brace '{' following function declarations go on the next line #212: FILE: common/cmd_bootmenu.c:66: +static int print_entry(int n, int reverse) {
ERROR: "foo * bar" should be "foo *bar" #214: FILE: common/cmd_bootmenu.c:68: + char * str = get_option(n);
ERROR: "foo * bar" should be "foo *bar" #215: FILE: common/cmd_bootmenu.c:69: + char * end = get_end_of_title(str);
ERROR: space prohibited after that '!' (ctx:WxW) #217: FILE: common/cmd_bootmenu.c:71: + if ( ! end ) ^
ERROR: space prohibited after that open parenthesis '(' #217: FILE: common/cmd_bootmenu.c:71: + if ( ! end )
ERROR: space prohibited before that close parenthesis ')' #217: FILE: common/cmd_bootmenu.c:71: + if ( ! end )
ERROR: space prohibited after that open parenthesis '(' #222: FILE: common/cmd_bootmenu.c:76: + if ( reverse )
ERROR: space prohibited before that close parenthesis ')' #222: FILE: common/cmd_bootmenu.c:76: + if ( reverse )
ERROR: space prohibited after that open parenthesis '(' #229: FILE: common/cmd_bootmenu.c:83: + if ( reverse )
ERROR: space prohibited before that close parenthesis ')' #229: FILE: common/cmd_bootmenu.c:83: + if ( reverse )
ERROR: open brace '{' following function declarations go on the next line #236: FILE: common/cmd_bootmenu.c:90: +static int print_menu(int active) {
ERROR: space prohibited after that open parenthesis '(' #248: FILE: common/cmd_bootmenu.c:102: + while ( 1 ) {
ERROR: space prohibited before that close parenthesis ')' #248: FILE: common/cmd_bootmenu.c:102: + while ( 1 ) {
ERROR: space prohibited after that open parenthesis '(' #252: FILE: common/cmd_bootmenu.c:106: + if ( ret == 1 )
ERROR: space prohibited before that close parenthesis ')' #252: FILE: common/cmd_bootmenu.c:106: + if ( ret == 1 )
ERROR: space prohibited after that open parenthesis '(' #261: FILE: common/cmd_bootmenu.c:115: + if ( n == active )
ERROR: space prohibited before that close parenthesis ')' #261: FILE: common/cmd_bootmenu.c:115: + if ( n == active )
ERROR: space prohibited after that open parenthesis '(' #267: FILE: common/cmd_bootmenu.c:121: + if ( n == active )
ERROR: space prohibited before that close parenthesis ')' #267: FILE: common/cmd_bootmenu.c:121: + if ( n == active )
ERROR: open brace '{' following function declarations go on the next line #282: FILE: common/cmd_bootmenu.c:136: +int do_bootmenu(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) {
ERROR: "foo * bar" should be "foo *bar" #291: FILE: common/cmd_bootmenu.c:145: + char * delay_str = NULL;
ERROR: space prohibited after that open parenthesis '(' #293: FILE: common/cmd_bootmenu.c:147: + if ( argc >= 2 )
ERROR: space prohibited before that close parenthesis ')' #293: FILE: common/cmd_bootmenu.c:147: + if ( argc >= 2 )
ERROR: space prohibited after that '!' (ctx:WxW) #296: FILE: common/cmd_bootmenu.c:150: + if ( ! delay_str ) ^
ERROR: space prohibited after that open parenthesis '(' #296: FILE: common/cmd_bootmenu.c:150: + if ( ! delay_str )
ERROR: space prohibited before that close parenthesis ')' #296: FILE: common/cmd_bootmenu.c:150: + if ( ! delay_str )
ERROR: space prohibited after that open parenthesis '(' #299: FILE: common/cmd_bootmenu.c:153: + if ( delay_str )
ERROR: space prohibited before that close parenthesis ')' #299: FILE: common/cmd_bootmenu.c:153: + if ( delay_str )
WARNING: consider using kstrto* in preference to simple_strtol #300: FILE: common/cmd_bootmenu.c:154: + delay = (int)simple_strtol(delay_str, NULL, 10);
ERROR: space prohibited after that open parenthesis '(' #302: FILE: common/cmd_bootmenu.c:156: + if ( delay == 0 ) {
ERROR: space prohibited before that close parenthesis ')' #302: FILE: common/cmd_bootmenu.c:156: + if ( delay == 0 ) {
ERROR: space prohibited after that open parenthesis '(' #305: FILE: common/cmd_bootmenu.c:159: + if ( get_end_of_title(get_option(0)) )
ERROR: space prohibited before that close parenthesis ')' #305: FILE: common/cmd_bootmenu.c:159: + if ( get_end_of_title(get_option(0)) )
ERROR: space prohibited after that open parenthesis '(' #312: FILE: common/cmd_bootmenu.c:166: + if ( delay < 0 )
ERROR: space prohibited before that close parenthesis ')' #312: FILE: common/cmd_bootmenu.c:166: + if ( delay < 0 )
ERROR: space prohibited after that '!' (ctx:WxW) #315: FILE: common/cmd_bootmenu.c:169: + if ( ! instant ) { ^
ERROR: space prohibited after that open parenthesis '(' #315: FILE: common/cmd_bootmenu.c:169: + if ( ! instant ) {
ERROR: space prohibited before that close parenthesis ')' #315: FILE: common/cmd_bootmenu.c:169: + if ( ! instant ) {
ERROR: space prohibited after that open parenthesis '(' #322: FILE: common/cmd_bootmenu.c:176: + while ( 1 ) {
ERROR: space prohibited before that close parenthesis ')' #322: FILE: common/cmd_bootmenu.c:176: + while ( 1 ) {
ERROR: space prohibited after that open parenthesis '(' #324: FILE: common/cmd_bootmenu.c:178: + if ( abort || delay > 0 )
ERROR: space prohibited before that close parenthesis ')' #324: FILE: common/cmd_bootmenu.c:178: + if ( abort || delay > 0 )
ERROR: space prohibited after that '!' (ctx:WxW) #327: FILE: common/cmd_bootmenu.c:181: + if ( ! abort ) { ^
ERROR: space prohibited after that open parenthesis '(' #327: FILE: common/cmd_bootmenu.c:181: + if ( ! abort ) {
ERROR: space prohibited before that close parenthesis ')' #327: FILE: common/cmd_bootmenu.c:181: + if ( ! abort ) {
ERROR: space prohibited after that open parenthesis '(' #329: FILE: common/cmd_bootmenu.c:183: + if ( delay > 0 )
ERROR: space prohibited before that close parenthesis ')' #329: FILE: common/cmd_bootmenu.c:183: + if ( delay > 0 )
WARNING: line over 80 characters #330: FILE: common/cmd_bootmenu.c:184: + printf(" Hit any key to stop autoboot: %2d ", delay);
ERROR: space prohibited after that open parenthesis '(' #332: FILE: common/cmd_bootmenu.c:186: + while ( delay > 0 ) {
ERROR: space prohibited before that close parenthesis ')' #332: FILE: common/cmd_bootmenu.c:186: + while ( delay > 0 ) {
ERROR: space prohibited after that open parenthesis '(' #336: FILE: common/cmd_bootmenu.c:190: + for ( i = 0; i < 100; ++i ) {
ERROR: space prohibited before that close parenthesis ')' #336: FILE: common/cmd_bootmenu.c:190: + for ( i = 0; i < 100; ++i ) {
ERROR: space prohibited after that open parenthesis '(' #338: FILE: common/cmd_bootmenu.c:192: + if ( tstc() ) {
ERROR: space prohibited before that close parenthesis ')' #338: FILE: common/cmd_bootmenu.c:192: + if ( tstc() ) {
ERROR: space prohibited after that open parenthesis '(' #343: FILE: common/cmd_bootmenu.c:197: + if ( key == '\e' ) {
ERROR: space prohibited before that close parenthesis ')' #343: FILE: common/cmd_bootmenu.c:197: + if ( key == '\e' ) {
ERROR: space prohibited after that open parenthesis '(' #346: FILE: common/cmd_bootmenu.c:200: + } else if ( key == '\r' )
ERROR: space prohibited before that close parenthesis ')' #346: FILE: common/cmd_bootmenu.c:200: + } else if ( key == '\r' )
ERROR: space prohibited after that open parenthesis '(' #360: FILE: common/cmd_bootmenu.c:214: + if ( abort )
ERROR: space prohibited before that close parenthesis ')' #360: FILE: common/cmd_bootmenu.c:214: + if ( abort )
ERROR: space prohibited after that open parenthesis '(' #368: FILE: common/cmd_bootmenu.c:222: + if ( delay <= 0 )
ERROR: space prohibited before that close parenthesis ')' #368: FILE: common/cmd_bootmenu.c:222: + if ( delay <= 0 )
ERROR: space prohibited after that '!' (ctx:WxW) #373: FILE: common/cmd_bootmenu.c:227: + while ( ! tstc() ) { ^
ERROR: space prohibited after that open parenthesis '(' #373: FILE: common/cmd_bootmenu.c:227: + while ( ! tstc() ) {
ERROR: space prohibited before that close parenthesis ')' #373: FILE: common/cmd_bootmenu.c:227: + while ( ! tstc() ) {
ERROR: space prohibited after that open parenthesis '(' #382: FILE: common/cmd_bootmenu.c:236: + if ( esc == 0 ) {
ERROR: space prohibited before that close parenthesis ')' #382: FILE: common/cmd_bootmenu.c:236: + if ( esc == 0 ) {
ERROR: space prohibited after that open parenthesis '(' #384: FILE: common/cmd_bootmenu.c:238: + if ( key == '\e' ) {
ERROR: space prohibited before that close parenthesis ')' #384: FILE: common/cmd_bootmenu.c:238: + if ( key == '\e' ) {
ERROR: space prohibited after that open parenthesis '(' #389: FILE: common/cmd_bootmenu.c:243: + } else if ( esc == 1 ) {
ERROR: space prohibited before that close parenthesis ')' #389: FILE: common/cmd_bootmenu.c:243: + } else if ( esc == 1 ) {
ERROR: space prohibited after that open parenthesis '(' #391: FILE: common/cmd_bootmenu.c:245: + if ( key == '[' ) {
ERROR: space prohibited before that close parenthesis ')' #391: FILE: common/cmd_bootmenu.c:245: + if ( key == '[' ) {
ERROR: space prohibited after that open parenthesis '(' #397: FILE: common/cmd_bootmenu.c:251: + } else if ( esc == 2 || esc == 3 ) {
ERROR: space prohibited before that close parenthesis ')' #397: FILE: common/cmd_bootmenu.c:251: + } else if ( esc == 2 || esc == 3 ) {
ERROR: space prohibited after that open parenthesis '(' #399: FILE: common/cmd_bootmenu.c:253: + if ( esc == 2 && key == '1' ) {
ERROR: space prohibited before that close parenthesis ')' #399: FILE: common/cmd_bootmenu.c:253: + if ( esc == 2 && key == '1' ) {
ERROR: space prohibited after that open parenthesis '(' #405: FILE: common/cmd_bootmenu.c:259: + if ( key == 'A' )
ERROR: space prohibited before that close parenthesis ')' #405: FILE: common/cmd_bootmenu.c:259: + if ( key == 'A' )
ERROR: space prohibited after that open parenthesis '(' #407: FILE: common/cmd_bootmenu.c:261: + else if ( key == 'B' )
ERROR: space prohibited before that close parenthesis ')' #407: FILE: common/cmd_bootmenu.c:261: + else if ( key == 'B' )
ERROR: space prohibited after that open parenthesis '(' #414: FILE: common/cmd_bootmenu.c:268: + if ( key == '\r' )
ERROR: space prohibited before that close parenthesis ')' #414: FILE: common/cmd_bootmenu.c:268: + if ( key == '\r' )
ERROR: space prohibited after that open parenthesis '(' #419: FILE: common/cmd_bootmenu.c:273: + if ( key == 1 ) {
ERROR: space prohibited before that close parenthesis ')' #419: FILE: common/cmd_bootmenu.c:273: + if ( key == 1 ) {
ERROR: space prohibited after that open parenthesis '(' #421: FILE: common/cmd_bootmenu.c:275: + if ( active > 0 )
ERROR: space prohibited before that close parenthesis ')' #421: FILE: common/cmd_bootmenu.c:275: + if ( active > 0 )
ERROR: space prohibited after that open parenthesis '(' #424: FILE: common/cmd_bootmenu.c:278: + } else if ( key == 2 ) {
ERROR: space prohibited before that close parenthesis ')' #424: FILE: common/cmd_bootmenu.c:278: + } else if ( key == 2 ) {
ERROR: space prohibited after that open parenthesis '(' #426: FILE: common/cmd_bootmenu.c:280: + if ( active < count )
ERROR: space prohibited before that close parenthesis ')' #426: FILE: common/cmd_bootmenu.c:280: + if ( active < count )
ERROR: space prohibited after that open parenthesis '(' #429: FILE: common/cmd_bootmenu.c:283: + } else if ( key == 3 ) {
ERROR: space prohibited before that close parenthesis ')' #429: FILE: common/cmd_bootmenu.c:283: + } else if ( key == 3 ) {
ERROR: "foo * bar" should be "foo *bar" #431: FILE: common/cmd_bootmenu.c:285: + char * str;
ERROR: "foo * bar" should be "foo *bar" #432: FILE: common/cmd_bootmenu.c:286: + char * end;
ERROR: space prohibited after that '!' (ctx:WxW) #436: FILE: common/cmd_bootmenu.c:290: + if ( ! instant ) { ^
ERROR: space prohibited after that open parenthesis '(' #436: FILE: common/cmd_bootmenu.c:290: + if ( ! instant ) {
ERROR: space prohibited before that close parenthesis ')' #436: FILE: common/cmd_bootmenu.c:290: + if ( ! instant ) {
ERROR: space prohibited after that open parenthesis '(' #446: FILE: common/cmd_bootmenu.c:300: + if ( active == count ) {
ERROR: space prohibited before that close parenthesis ')' #446: FILE: common/cmd_bootmenu.c:300: + if ( active == count ) {
ERROR: space prohibited after that '!' (ctx:WxW) #456: FILE: common/cmd_bootmenu.c:310: + if ( ! end ) { ^
ERROR: space prohibited after that open parenthesis '(' #456: FILE: common/cmd_bootmenu.c:310: + if ( ! end ) {
ERROR: space prohibited before that close parenthesis ')' #456: FILE: common/cmd_bootmenu.c:310: + if ( ! end ) {
WARNING: line over 80 characters #458: FILE: common/cmd_bootmenu.c:312: + printf("Invalid Boot Menu entry %d\nStarting U-Boot console\n\n", active);
ERROR: space prohibited after that '!' (ctx:WxW) #463: FILE: common/cmd_bootmenu.c:317: + if ( ! end[1] ) { ^
ERROR: space prohibited after that open parenthesis '(' #463: FILE: common/cmd_bootmenu.c:317: + if ( ! end[1] ) {
ERROR: space prohibited before that close parenthesis ')' #463: FILE: common/cmd_bootmenu.c:317: + if ( ! end[1] ) {
WARNING: line over 80 characters #479: FILE: common/cmd_bootmenu.c:333: + parse_string_outer(end+1, FLAG_PARSE_SEMICOLON | FLAG_EXIT_FROM_LOOP);
total: 121 errors, 4 warnings, 369 lines checked
/home/wd/Mail/U-Boot/12790 has style problems, please review.
If any of these errors are false positives, please report them to the maintainer, see CHECKPATCH in MAINTAINERS. WARNING: line over 80 characters #111: FILE: include/configs/nokia_rx51.h:137: +#define CONFIG_CMD_BOOTMENU /* ANSI terminal Boot Menu */
WARNING: line over 80 characters #140: FILE: include/configs/nokia_rx51.h:244: + "setenv mmcnum 1; setenv mmcpart 1; setenv mmctype fat; setenv mmcfile bootmenu.scr;" \
total: 0 errors, 2 warnings, 48 lines checked
/home/wd/Mail/U-Boot/12791 has style problems, please review.
If any of these errors are false positives, please report them to the maintainer, see CHECKPATCH in MAINTAINERS.
Best regards,
Wolfgang Denk

On Saturday 17 December 2011 20:25:24 Wolfgang Denk wrote:
Dear Pali =?ISO-8859-1?Q?Roh=E1r?=,
In message 2772527.Czs1Sl5aoH@pali-elitebook you wrote:
I'm sending new patch series, which add Nokia RX-51 support to U-Boot. This patches are based on master commit 06e42c6e2ce269667daecd6229d0b7c81383 8203 and now U-Boot working on Nokia RX-51.
This patch series generates a ton of checkpatch warnings. Please run your code through checkpatch, and make sure to read the respective hits at http://www.denx.de/wiki/U-Boot/Patches ; then clean up the code and resubmit.
Um, and while doing so, please make sure NOT to send all this stuff base64 encoded. Thanks.
WARNING: space prohibited between function name and open parenthesis '(' #130: FILE: arch/arm/lib/bootm.c:128:
- s = getenv ("atagaddr");
see file arch/arm/lib/bootm.c - it has this code styling. so this is not error unless you want to mix more code styling in one file.
WARNING: consider using kstrto* in preference to simple_strtoul #132: FILE: arch/arm/lib/bootm.c:130:
bd->bi_boot_params = simple_strtoul(s, NULL, 16);
really? I was not able to find kstrtoul function
WARNING: space prohibited between function name and open parenthesis '(' #137: FILE: arch/arm/lib/bootm.c:135:
params = tag_next (params);
WARNING: space prohibited between function name and open parenthesis '(' #145: FILE: arch/arm/lib/bootm.c:142:
setup_start_tag (bd);
WARNING: space prohibited between function name and open parenthesis '(' #162: FILE: arch/arm/lib/bootm.c:167: +#if defined (CONFIG_SETUP_MEMORY_TAGS) || \
WARNING: please, no spaces at the start of a line #163: FILE: arch/arm/lib/bootm.c:168:
- defined (CONFIG_CMDLINE_TAG) || $
WARNING: space prohibited between function name and open parenthesis '(' #163: FILE: arch/arm/lib/bootm.c:168:
- defined (CONFIG_CMDLINE_TAG) || \
WARNING: please, no spaces at the start of a line #164: FILE: arch/arm/lib/bootm.c:169:
- defined (CONFIG_INITRD_TAG) || $
WARNING: space prohibited between function name and open parenthesis '(' #164: FILE: arch/arm/lib/bootm.c:169:
- defined (CONFIG_INITRD_TAG) || \
WARNING: please, no spaces at the start of a line #165: FILE: arch/arm/lib/bootm.c:170:
- defined (CONFIG_SERIAL_TAG) || $
WARNING: space prohibited between function name and open parenthesis '(' #165: FILE: arch/arm/lib/bootm.c:170:
- defined (CONFIG_SERIAL_TAG) || \
WARNING: please, no spaces at the start of a line #166: FILE: arch/arm/lib/bootm.c:171:
- defined (CONFIG_REVISION_TAG)$
WARNING: space prohibited between function name and open parenthesis '(' #166: FILE: arch/arm/lib/bootm.c:171:
- defined (CONFIG_REVISION_TAG)
total: 0 errors, 13 warnings, 53 lines checked
/home/wd/Mail/U-Boot/12777 has style problems, please review.
same - see my first comment
If any of these errors are false positives, please report them to the maintainer, see CHECKPATCH in MAINTAINERS. ERROR: space prohibited after that open parenthesis '(' #194: FILE: include/twl4030.h:238:
- ( (devgrp) << 13 | 1 << 12 | (grp) << 9 | (type2) << 7 \
total: 1 errors, 0 warnings, 110 lines checked
/home/wd/Mail/U-Boot/12778 has style problems, please review.
see commit message - this patch is from linux upstream and uf u-boot has same styling this should be ok too.
If any of these errors are false positives, please report them to the maintainer, see CHECKPATCH in MAINTAINERS. total: 0 errors, 0 warnings, 24 lines checked
/home/wd/Mail/U-Boot/12779 has no obvious style problems and is ready for submission. WARNING: line over 80 characters #117: FILE: common/main.c:1028:
case '\e': /* ANSI escape char */
again - same formating in file common/main.c
WARNING: line over 80 characters #145: FILE: common/main.c:1056:
/* Ignore ANSI escape sequences generated by keyboard */
ERROR: space prohibited after that open parenthesis '(' #147: FILE: common/main.c:1058:
if ( c >= 'A' && c <= 'D' ) {
ERROR: space prohibited before that close parenthesis ')' #147: FILE: common/main.c:1058:
if ( c >= 'A' && c <= 'D' ) {
Ok, this problem I fix.
WARNING: line over 80 characters #156: FILE: common/main.c:1067:
} else if (esc == 3 && n < CONFIG_SYS_CBSIZE-4) {
total: 2 errors, 3 warnings, 62 lines checked
/home/wd/Mail/U-Boot/12780 has style problems, please review.
If any of these errors are false positives, please report them to the maintainer, see CHECKPATCH in MAINTAINERS. total: 0 errors, 0 warnings, 8 lines checked
/home/wd/Mail/U-Boot/12781 has no obvious style problems and is ready for submission. WARNING: line over 80 characters #129: FILE: drivers/video/cfb_console.c:712:
- video_hw_rectfill(VIDEO_PIXEL_SIZE, /* bytes per pixel */
WARNING: line over 80 characters #130: FILE: drivers/video/cfb_console.c:713:
VIDEO_FONT_WIDTH * begin, /* dest pos x */ /* FIXME:
correct? */
WARNING: line over 80 characters #131: FILE: drivers/video/cfb_console.c:714:
video_logo_height + CONSOLE_ROW_SIZE * line, /* dest pos y */
/*
FIXME: correct? */
WARNING: line over 80 characters #132: FILE: drivers/video/cfb_console.c:715:
VIDEO_FONT_WIDTH * ( end - begin ), /* frame width */ /*
FIXME:
correct? */
ERROR: space prohibited after that open parenthesis '(' #132: FILE: drivers/video/cfb_console.c:715:
VIDEO_FONT_WIDTH * ( end - begin ), /* frame width */ /*
FIXME:
correct? */
ERROR: space prohibited before that close parenthesis ')' #132: FILE: drivers/video/cfb_console.c:715:
VIDEO_FONT_WIDTH * ( end - begin ), /* frame width */ /*
FIXME:
correct? */
WARNING: line over 80 characters #133: FILE: drivers/video/cfb_console.c:716:
VIDEO_FONT_HEIGHT, /* frame height */
WARNING: line over 80 characters #134: FILE: drivers/video/cfb_console.c:717:
bgx /* fill color */
If you want I remove above comments /* ... */
ERROR: space prohibited after that open parenthesis '(' #138: FILE: drivers/video/cfb_console.c:721:
- if ( begin == 0 && end == CONSOLE_COLS )
ERROR: space prohibited before that close parenthesis ')' #138: FILE: drivers/video/cfb_console.c:721:
- if ( begin == 0 && end == CONSOLE_COLS )
I will fix this.
WARNING: line over 80 characters #139: FILE: drivers/video/cfb_console.c:722:
memsetl(CONSOLE_ROW_FIRST + CONSOLE_ROW_SIZE * line, /* offset of row
*/
WARNING: line over 80 characters #140: FILE: drivers/video/cfb_console.c:723:
CONSOLE_ROW_SIZE >> 2, /* length of row */
WARNING: line over 80 characters #141: FILE: drivers/video/cfb_console.c:724:
bgx /* fill color */
ERROR: space prohibited after that open parenthesis '(' #144: FILE: drivers/video/cfb_console.c:727:
for ( i = 0; i < VIDEO_FONT_HEIGHT; ++i )
ERROR: space prohibited before that close parenthesis ')' #144: FILE: drivers/video/cfb_console.c:727:
for ( i = 0; i < VIDEO_FONT_HEIGHT; ++i )
Also I fix this.
WARNING: line over 80 characters #145: FILE: drivers/video/cfb_console.c:728:
memsetl(CONSOLE_ROW_FIRST + CONSOLE_ROW_SIZE * line + /* offset of
row
*/
WARNING: line over 80 characters #146: FILE: drivers/video/cfb_console.c:729:
VIDEO_FONT_WIDTH * VIDEO_PIXEL_SIZE * begin + /* offset of
col */
WARNING: line over 80 characters #147: FILE: drivers/video/cfb_console.c:730:
i * VIDEO_LINE_LEN, /* col offset of i-th line */
WARNING: line over 80 characters #148: FILE: drivers/video/cfb_console.c:731:
(VIDEO_FONT_WIDTH * VIDEO_PIXEL_SIZE * ( end - begin + 1)) >>
2, /*
length to end of line */
ERROR: space prohibited after that open parenthesis '(' #148: FILE: drivers/video/cfb_console.c:731:
(VIDEO_FONT_WIDTH * VIDEO_PIXEL_SIZE * ( end - begin + 1)) >>
2, /*
length to end of line */
WARNING: line over 80 characters #149: FILE: drivers/video/cfb_console.c:732:
bgx /* fill color */
total: 7 errors, 14 warnings, 68 lines checked
/home/wd/Mail/U-Boot/12782 has style problems, please review.
If any of these errors are false positives, please report them to the maintainer, see CHECKPATCH in MAINTAINERS. total: 0 errors, 0 warnings, 98 lines checked
/home/wd/Mail/U-Boot/12783 has no obvious style problems and is ready for submission. ERROR: do not initialise statics to 0 or NULL #112: FILE: drivers/video/cfb_console.c:381: +static int ansi_buf_size = 0;
ERROR: do not initialise statics to 0 or NULL #113: FILE: drivers/video/cfb_console.c:382: +static int ansi_colors_need_revert = 0;
what is problem with initialising to 0?
WARNING: space prohibited between function name and open parenthesis '(' #166: FILE: drivers/video/cfb_console.c:930:
if (ansi_buf_size >= sizeof (ansi_buf))
WARNING: line over 80 characters #236: FILE: drivers/video/cfb_console.c:1000:
if ((ansi_buf[i] >= 'A' && ansi_buf[i] <= 'H') || ansi_buf[i]
== 'J' ||
ansi_buf[i] == 'K' || ansi_buf[i] == 'm') {
ERROR: that open brace { should be on the previous line #245: FILE: drivers/video/cfb_console.c:1009:
if (fail)
{
ERROR: that open brace { should be on the previous line #253: FILE: drivers/video/cfb_console.c:1017:
if (flush)
{
Also I will fix above problems with braces.
WARNING: line over 80 characters #298: FILE: drivers/video/cfb_console.c:1062:
console_clear_line(console_row, console_col,
CONSOLE_COLS-1);
WARNING: line over 80 characters #300: FILE: drivers/video/cfb_console.c:1064:
console_clear_line(console_row, 0, console_col);
WARNING: line over 80 characters #302: FILE: drivers/video/cfb_console.c:1066:
console_clear_line(console_row, 0, CONSOLE_COLS-1);
WARNING: line over 80 characters #310: FILE: drivers/video/cfb_console.c:1074:
} else if (num1 == 7) { /* swap colors (only once) */
ERROR: that open brace { should be on the previous line #321: FILE: drivers/video/cfb_console.c:1085:
- else
- {
ERROR: else should follow close brace '}' #321: FILE: drivers/video/cfb_console.c:1085:
- }
- else
total: 6 errors, 6 warnings, 223 lines checked
/home/wd/Mail/U-Boot/12784 has style problems, please review.
If any of these errors are false positives, please report them to the maintainer, see CHECKPATCH in MAINTAINERS. total: 0 errors, 0 warnings, 14 lines checked
/home/wd/Mail/U-Boot/12785 has no obvious style problems and is ready for submission. total: 0 errors, 0 warnings, 52 lines checked
/home/wd/Mail/U-Boot/12786 has no obvious style problems and is ready for submission. WARNING: line over 80 characters #113: FILE: common/main.c:85: +#if defined (CONFIG_MENUKEY) && ! defined (CONFIG_MENUCMD) && ( ! defined(CONFIG_BOOTDELAY) || CONFIG_BOOTDELAY < 0 )
WARNING: space prohibited between function name and open parenthesis '(' #113: FILE: common/main.c:85: +#if defined (CONFIG_MENUKEY) && ! defined (CONFIG_MENUCMD) && ( ! defined(CONFIG_BOOTDELAY) || CONFIG_BOOTDELAY < 0 )
WARNING: space prohibited between function name and open parenthesis '(' #113: FILE: common/main.c:85: +#if defined (CONFIG_MENUKEY) && ! defined (CONFIG_MENUCMD) && ( ! defined(CONFIG_BOOTDELAY) || CONFIG_BOOTDELAY < 0 )
ERROR: space prohibited after that '!' (ctx:WxW) #113: FILE: common/main.c:85: +#if defined (CONFIG_MENUKEY) && ! defined (CONFIG_MENUCMD) && ( ! defined(CONFIG_BOOTDELAY) || CONFIG_BOOTDELAY < 0 ) ^
ERROR: space prohibited after that '!' (ctx:WxW) #113: FILE: common/main.c:85: +#if defined (CONFIG_MENUKEY) && ! defined (CONFIG_MENUCMD) && ( ! defined(CONFIG_BOOTDELAY) || CONFIG_BOOTDELAY < 0 ) ^
ERROR: space prohibited after that open parenthesis '(' #113: FILE: common/main.c:85: +#if defined (CONFIG_MENUKEY) && ! defined (CONFIG_MENUCMD) && ( ! defined(CONFIG_BOOTDELAY) || CONFIG_BOOTDELAY < 0 )
ERROR: space prohibited before that close parenthesis ')' #113: FILE: common/main.c:85: +#if defined (CONFIG_MENUKEY) && ! defined (CONFIG_MENUCMD) && ( ! defined(CONFIG_BOOTDELAY) || CONFIG_BOOTDELAY < 0 )
WARNING: line over 80 characters #114: FILE: common/main.c:86: +#error CONFIG_MENUKEY is defined, but not CONFIG_MENUCMD and/or CONFIG_BOOTDELAY >= 0
ERROR: do not initialise statics to 0 or NULL #120: FILE: common/main.c:92: +static int menucmd = 0;
WARNING: space prohibited between function name and open parenthesis '(' #146: FILE: common/main.c:253: +# if defined (CONFIG_MENUCMD) && defined (CONFIG_MENUKEY)
WARNING: space prohibited between function name and open parenthesis '(' #146: FILE: common/main.c:253: +# if defined (CONFIG_MENUCMD) && defined (CONFIG_MENUKEY)
WARNING: line over 80 characters #147: FILE: common/main.c:254:
if (CONFIG_MENUKEY == 0 || CONFIG_MENUKEY == getc())
total: 5 errors, 7 warnings, 73 lines checked
/home/wd/Mail/U-Boot/12787 has style problems, please review.
Ok, I will fix this file.
If any of these errors are false positives, please report them to the maintainer, see CHECKPATCH in MAINTAINERS. WARNING: space prohibited between function name and open parenthesis '(' #125: FILE: common/main.c:429:
- if ((s = getenv ("premonitor")) != NULL) {
ERROR: do not use assignment in if condition #125: FILE: common/main.c:429:
- if ((s = getenv ("premonitor")) != NULL) {
WARNING: space prohibited between function name and open parenthesis '(' #127: FILE: common/main.c:431:
run_command (s, 0);
WARNING: line over 80 characters #129: FILE: common/main.c:433:
parse_string_outer(s, FLAG_PARSE_SEMICOLON | FLAG_EXIT_FROM_LOOP);
total: 1 errors, 3 warnings, 25 lines checked
/home/wd/Mail/U-Boot/12788 has style problems, please review.
I will fix this too.
If any of these errors are false positives, please report them to the maintainer, see CHECKPATCH in MAINTAINERS. WARNING: externs should be avoided in .c files #282: FILE: board/nokia/rx51/rx51.c:59: +extern u32 rx51_atagaddr; /* atag address */
WARNING: externs should be avoided in .c files #283: FILE: board/nokia/rx51/rx51.c:60: +extern u32 rx51_kernaddr; /* attached kernel address */
WARNING: line over 80 characters #297: FILE: board/nokia/rx51/rx51.c:74: +"startaddr:\n" /* address where should be u-boot after
relocation */
WARNING: line over 80 characters #299: FILE: board/nokia/rx51/rx51.c:76: +"relocaddr:\n" /* address of this relocaddr section after
relocation */
WARNING: line over 80 characters #300: FILE: board/nokia/rx51/rx51.c:77: +" .word .\n" /* dot - address of this section (calculated at
compile
time, so same as after relocation) */
WARNING: line over 80 characters #307: FILE: board/nokia/rx51/rx51.c:84: +"kernaddr:\n" /* stored attached kernel address (u-boot +
0x40000) */
WARNING: line over 80 characters #310: FILE: board/nokia/rx51/rx51.c:87: +"save_boot_params:\n" /* function save_boot_params, called after
reset */
WARNING: line over 80 characters #313: FILE: board/nokia/rx51/rx51.c:90: +" ldr r1, relocaddr\n" /* r1 - address where should be this relocaddr section after relocation */
WARNING: line over 80 characters #314: FILE: board/nokia/rx51/rx51.c:91: +" sub r0, r0, r1\n" /* r1 - calculated offset for relocation */
WARNING: line over 80 characters #315: FILE: board/nokia/rx51/rx51.c:92: +" ldr r1, startaddr\n" /* r1 - address where u-boot should be after relocation */
WARNING: line over 80 characters #316: FILE: board/nokia/rx51/rx51.c:93: +" add r0, r0, r1\n" /* r0 - address where is u-boot (address after relocation + offset) */
WARNING: line over 80 characters #319: FILE: board/nokia/rx51/rx51.c:96: +" bne reloc\n" /* start relocation if u-boot is not loaded at correct address CONFIG_SYS_TEXT_BASE */
WARNING: line over 80 characters #320: FILE: board/nokia/rx51/rx51.c:97: +" bx lr\n" /* else return back to reset section (relocation is
not
needed) */
WARNING: line over 80 characters #324: FILE: board/nokia/rx51/rx51.c:101: +" add r2, r0, #0x40000\n" /* r2 - address where is attached kernel (u-
boot
address + kernel offset 0x40000) - also end address of u-boot */
WARNING: line over 80 characters #334: FILE: board/nokia/rx51/rx51.c:111: +" ldr pc, startaddr\n" /* jump to start section (where should be u-boot after relocation) and restart u-boot */
WARNING: line over 80 characters #375: FILE: board/nokia/rx51/rx51.c:152:
- twl4030_i2c_write_u8(TWL4030_CHIP_PM_MASTER, msg >> 8,
TWL4030_PM_MASTER_PB_WORD_MSB);
WARNING: line over 80 characters #376: FILE: board/nokia/rx51/rx51.c:153:
- twl4030_i2c_write_u8(TWL4030_CHIP_PM_MASTER, msg & 0xff,
TWL4030_PM_MASTER_PB_WORD_LSB);
WARNING: line over 80 characters #403: FILE: board/nokia/rx51/rx51.c:180:
- twl4030_i2c_write_u8(TWL4030_CHIP_PM_MASTER, 0x02,
TWL4030_PM_MASTER_PB_CFG);
ERROR: do not initialise statics to 0 or NULL #432: FILE: board/nokia/rx51/rx51.c:209: +static unsigned long int twl_wd_time = 0; /* last time of watchdog reset */
WARNING: Use of volatile is usually wrong: see Documentation/volatile-considered-harmful.txt #433: FILE: board/nokia/rx51/rx51.c:210: +static volatile unsigned long int twl_i2c_lock;
ERROR: space prohibited after that open parenthesis '(' #444: FILE: board/nokia/rx51/rx51.c:221:
- if ( get_timer(twl_wd_time) < 4 * CONFIG_SYS_HZ )
ERROR: space prohibited before that close parenthesis ')' #444: FILE: board/nokia/rx51/rx51.c:221:
- if ( get_timer(twl_wd_time) < 4 * CONFIG_SYS_HZ )
ERROR: space prohibited after that open parenthesis '(' #448: FILE: board/nokia/rx51/rx51.c:225:
- if ( test_and_set_bit(0, &twl_i2c_lock) )
ERROR: space prohibited before that close parenthesis ')' #448: FILE: board/nokia/rx51/rx51.c:225:
- if ( test_and_set_bit(0, &twl_i2c_lock) )
WARNING: line over 80 characters #452: FILE: board/nokia/rx51/rx51.c:229:
- twl4030_i2c_read_u8(TWL4030_CHIP_PM_RECEIVER, &timeout,
TWL4030_PM_RECEIVER_WATCHDOG_CFG);
ERROR: space prohibited after that open parenthesis '(' #456: FILE: board/nokia/rx51/rx51.c:233:
- if ( timeout != 0 )
ERROR: space prohibited before that close parenthesis ')' #456: FILE: board/nokia/rx51/rx51.c:233:
- if ( timeout != 0 )
WARNING: line over 80 characters #457: FILE: board/nokia/rx51/rx51.c:234:
twl4030_i2c_write_u8(TWL4030_CHIP_PM_RECEIVER, 31,
TWL4030_PM_RECEIVER_WATCHDOG_CFG);
ERROR: do not initialise statics to 0 or NULL #495: FILE: board/nokia/rx51/rx51.c:272: +static u8 keybuf_head = 0;
ERROR: do not initialise statics to 0 or NULL #496: FILE: board/nokia/rx51/rx51.c:273: +static u8 keybuf_tail = 0;
WARNING: line over 80 characters #532: FILE: board/nokia/rx51/rx51.c:309:
- if (!(mods & 2) && (k == 18 || k == 31 || k == 33 || k == 34)) { /* cursor
keys, without fn */
ERROR: space prohibited after that open parenthesis '(' #582: FILE: board/nokia/rx51/rx51.c:359:
- if ( test_and_set_bit(0, &twl_i2c_lock) )
ERROR: space prohibited before that close parenthesis ')' #582: FILE: board/nokia/rx51/rx51.c:359:
- if ( test_and_set_bit(0, &twl_i2c_lock) )
I will look at rx51.c file
WARNING: line over 80 characters #764: FILE: board/nokia/rx51/rx51.h:108:
- MUX_VAL(CP(GPMC_NCS6), (IEN | PTD | DIS | M1)) /*SYS_nDMA_REQ2*/\
WARNING: line over 80 characters #765: FILE: board/nokia/rx51/rx51.h:109:
- MUX_VAL(CP(GPMC_NCS7), (IEN | PTU | EN | M1)) /*SYS_nDMA_REQ3*/\
WARNING: line over 80 characters #770: FILE: board/nokia/rx51/rx51.h:114:
- MUX_VAL(CP(GPMC_NADV_ALE), (IDIS | PTD | DIS | M0)) /*GPMC_nADV_ALE*/\
WARNING: line over 80 characters #773: FILE: board/nokia/rx51/rx51.h:117:
- MUX_VAL(CP(GPMC_NBE0_CLE), (IDIS | PTD | DIS | M0)) /*GPMC_nBE0_CLE*/\
WARNING: line over 80 characters #833: FILE: board/nokia/rx51/rx51.h:177:
- MUX_VAL(CP(MCBSP2_CLKX), (IEN | PTD | DIS | M0)) /*McBSP2_CLKX*/\
WARNING: line over 80 characters #872: FILE: board/nokia/rx51/rx51.h:216:
- MUX_VAL(CP(MCBSP4_CLKX), (IEN | PTD | DIS | M1)) /*SSI1_DAT_RX*/\
WARNING: line over 80 characters #873: FILE: board/nokia/rx51/rx51.h:217:
- MUX_VAL(CP(MCBSP4_DR), (IEN | PTD | DIS | M1)) /*SSI1_FLAG_RX*/\
WARNING: line over 80 characters #874: FILE: board/nokia/rx51/rx51.h:218:
- MUX_VAL(CP(MCBSP4_DX), (IEN | PTD | DIS | M1)) /*SSI1_RDY_RX*/\
WARNING: line over 80 characters #884: FILE: board/nokia/rx51/rx51.h:228:
- MUX_VAL(CP(UART3_CTS_RCTX), (IEN | PTD | EN | M0)) /*UART3_CTS_RCTX*/\
WARNING: line over 80 characters #885: FILE: board/nokia/rx51/rx51.h:229:
- MUX_VAL(CP(UART3_RTS_SD), (IDIS | PTD | DIS | M0)) /*UART3_RTS_SD */\
WARNING: line over 80 characters #886: FILE: board/nokia/rx51/rx51.h:230:
- MUX_VAL(CP(UART3_RX_IRRX), (IEN | PTD | DIS | M0)) /*UART3_RX_IRRX*/\
WARNING: line over 80 characters #887: FILE: board/nokia/rx51/rx51.h:231:
- MUX_VAL(CP(UART3_TX_IRTX), (IDIS | PTD | DIS | M0)) /*UART3_TX_IRTX*/\
WARNING: line over 80 characters #892: FILE: board/nokia/rx51/rx51.h:236:
- MUX_VAL(CP(HSUSB0_DATA0), (IEN | PTD | DIS | M0)) /*HSUSB0_DATA0*/\
WARNING: line over 80 characters #893: FILE: board/nokia/rx51/rx51.h:237:
- MUX_VAL(CP(HSUSB0_DATA1), (IEN | PTD | DIS | M0)) /*HSUSB0_DATA1*/\
WARNING: line over 80 characters #894: FILE: board/nokia/rx51/rx51.h:238:
- MUX_VAL(CP(HSUSB0_DATA2), (IEN | PTD | DIS | M0)) /*HSUSB0_DATA2*/\
WARNING: line over 80 characters #895: FILE: board/nokia/rx51/rx51.h:239:
- MUX_VAL(CP(HSUSB0_DATA3), (IEN | PTD | DIS | M0)) /*HSUSB0_DATA3*/\
WARNING: line over 80 characters #896: FILE: board/nokia/rx51/rx51.h:240:
- MUX_VAL(CP(HSUSB0_DATA4), (IEN | PTD | DIS | M0)) /*HSUSB0_DATA4*/\
WARNING: line over 80 characters #897: FILE: board/nokia/rx51/rx51.h:241:
- MUX_VAL(CP(HSUSB0_DATA5), (IEN | PTD | DIS | M0)) /*HSUSB0_DATA5*/\
WARNING: line over 80 characters #898: FILE: board/nokia/rx51/rx51.h:242:
- MUX_VAL(CP(HSUSB0_DATA6), (IEN | PTD | DIS | M0)) /*HSUSB0_DATA6*/\
WARNING: line over 80 characters #899: FILE: board/nokia/rx51/rx51.h:243:
- MUX_VAL(CP(HSUSB0_DATA7), (IEN | PTD | DIS | M0)) /*HSUSB0_DATA7*/\
WARNING: line over 80 characters #911: FILE: board/nokia/rx51/rx51.h:255:
- MUX_VAL(CP(MCSPI1_SOMI), (IEN | PTD | DIS | M0)) /*McSPI1_SOMI*/\
WARNING: line over 80 characters #916: FILE: board/nokia/rx51/rx51.h:260:
- MUX_VAL(CP(MCSPI1_CS3), (IEN | PTU | DIS | M3)) /*HSUSB2_DATA2*/\
WARNING: line over 80 characters #917: FILE: board/nokia/rx51/rx51.h:261:
- MUX_VAL(CP(MCSPI2_CLK), (IEN | PTU | DIS | M3)) /*HSUSB2_DATA7*/\
WARNING: line over 80 characters #918: FILE: board/nokia/rx51/rx51.h:262:
- MUX_VAL(CP(MCSPI2_SIMO), (IEN | PTU | DIS | M3)) /*HSUSB2_DATA4*/\
WARNING: line over 80 characters #919: FILE: board/nokia/rx51/rx51.h:263:
- MUX_VAL(CP(MCSPI2_SOMI), (IEN | PTU | DIS | M3)) /*HSUSB2_DATA5*/\
WARNING: line over 80 characters #920: FILE: board/nokia/rx51/rx51.h:264:
- MUX_VAL(CP(MCSPI2_CS0), (IEN | PTU | DIS | M3)) /*HSUSB2_DATA6*/\
WARNING: line over 80 characters #921: FILE: board/nokia/rx51/rx51.h:265:
- MUX_VAL(CP(MCSPI2_CS1), (IEN | PTU | DIS | M3)) /*HSUSB2_DATA3*/\
WARNING: line over 80 characters #926: FILE: board/nokia/rx51/rx51.h:270:
- MUX_VAL(CP(ETK_D14_ES2), (IEN | PTU | DIS | M3)) /*HSUSB2_DATA0*/\
WARNING: line over 80 characters #927: FILE: board/nokia/rx51/rx51.h:271:
- MUX_VAL(CP(ETK_D15_ES2), (IEN | PTU | DIS | M3)) /*HSUSB2_DATA1*/\
WARNING: line over 80 characters #934: FILE: board/nokia/rx51/rx51.h:278:
- MUX_VAL(CP(SYS_BOOT2), (IEN | PTD | DIS | M4)) /*GPIO_4 - MMC1_WP*/\
WARNING: line over 80 characters #939: FILE: board/nokia/rx51/rx51.h:283:
- MUX_VAL(CP(SYS_OFF_MODE), (IEN | PTD | DIS | M0)) /*SYS_OFF_MODE*/\
WARNING: line over 80 characters #940: FILE: board/nokia/rx51/rx51.h:284:
- MUX_VAL(CP(SYS_CLKOUT1), (IEN | PTD | DIS | M0)) /*SYS_CLKOUT1*/\
WARNING: line over 80 characters #944: FILE: board/nokia/rx51/rx51.h:288:
- MUX_VAL(CP(ETK_D0_ES2), (IEN | PTU | DIS | M3)) /*HSUSB1_DATA0*/\
WARNING: line over 80 characters #945: FILE: board/nokia/rx51/rx51.h:289:
- MUX_VAL(CP(ETK_D1_ES2), (IEN | PTU | DIS | M3)) /*HSUSB1_DATA1*/\
WARNING: line over 80 characters #946: FILE: board/nokia/rx51/rx51.h:290:
- MUX_VAL(CP(ETK_D2_ES2), (IEN | PTU | DIS | M3)) /*HSUSB1_DATA2*/\
WARNING: line over 80 characters #947: FILE: board/nokia/rx51/rx51.h:291:
- MUX_VAL(CP(ETK_D3_ES2), (IEN | PTU | DIS | M3)) /*HSUSB1_DATA7*/\
WARNING: line over 80 characters #948: FILE: board/nokia/rx51/rx51.h:292:
- MUX_VAL(CP(ETK_D4_ES2), (IEN | PTU | DIS | M3)) /*HSUSB1_DATA4*/\
WARNING: line over 80 characters #949: FILE: board/nokia/rx51/rx51.h:293:
- MUX_VAL(CP(ETK_D5_ES2), (IEN | PTU | DIS | M3)) /*HSUSB1_DATA5*/\
WARNING: line over 80 characters #950: FILE: board/nokia/rx51/rx51.h:294:
- MUX_VAL(CP(ETK_D6_ES2), (IEN | PTU | DIS | M3)) /*HSUSB1_DATA6*/\
WARNING: line over 80 characters #951: FILE: board/nokia/rx51/rx51.h:295:
- MUX_VAL(CP(ETK_D7_ES2), (IEN | PTU | DIS | M3)) /*HSUSB1_DATA3*/\
WARNING: line over 80 characters #990: FILE: board/nokia/rx51/rx51.h:334:
- MUX_VAL(CP(D2D_CLK26MI), (IEN | PTD | DIS | M0)) /*d2d_clk26mi*/\
WARNING: line over 80 characters #991: FILE: board/nokia/rx51/rx51.h:335:
- MUX_VAL(CP(D2D_NRESPWRON), (IEN | PTD | EN | M0)) /*d2d_nrespwron*/\
WARNING: line over 80 characters #992: FILE: board/nokia/rx51/rx51.h:336:
- MUX_VAL(CP(D2D_NRESWARM), (IEN | PTU | EN | M0)) /*d2d_nreswarm */\
WARNING: line over 80 characters #993: FILE: board/nokia/rx51/rx51.h:337:
- MUX_VAL(CP(D2D_ARM9NIRQ), (IEN | PTD | DIS | M0)) /*d2d_arm9nirq */\
WARNING: line over 80 characters #994: FILE: board/nokia/rx51/rx51.h:338:
- MUX_VAL(CP(D2D_UMA2P6FIQ), (IEN | PTD | DIS | M0)) /*d2d_uma2p6fiq*/\
WARNING: line over 80 characters #997: FILE: board/nokia/rx51/rx51.h:341:
- MUX_VAL(CP(D2D_DMAREQ0), (IEN | PTD | DIS | M0)) /*d2d_dmareq0*/\
WARNING: line over 80 characters #998: FILE: board/nokia/rx51/rx51.h:342:
- MUX_VAL(CP(D2D_DMAREQ1), (IEN | PTD | DIS | M0)) /*d2d_dmareq1*/\
WARNING: line over 80 characters #999: FILE: board/nokia/rx51/rx51.h:343:
- MUX_VAL(CP(D2D_DMAREQ2), (IEN | PTD | DIS | M0)) /*d2d_dmareq2*/\
WARNING: line over 80 characters #1000: FILE: board/nokia/rx51/rx51.h:344:
- MUX_VAL(CP(D2D_DMAREQ3), (IEN | PTD | DIS | M0)) /*d2d_dmareq3*/\
WARNING: line over 80 characters #1001: FILE: board/nokia/rx51/rx51.h:345:
- MUX_VAL(CP(D2D_N3GTRST), (IEN | PTD | DIS | M0)) /*d2d_n3gtrst*/\
WARNING: line over 80 characters #1006: FILE: board/nokia/rx51/rx51.h:350:
- MUX_VAL(CP(D2D_N3GRTCK), (IEN | PTD | DIS | M0)) /*d2d_n3grtck*/\
WARNING: line over 80 characters #1008: FILE: board/nokia/rx51/rx51.h:352:
- MUX_VAL(CP(D2D_SWAKEUP), (IEN | PTD | EN | M0)) /*d2d_swakeup*/\
WARNING: line over 80 characters #1009: FILE: board/nokia/rx51/rx51.h:353:
- MUX_VAL(CP(D2D_IDLEREQ), (IEN | PTD | DIS | M0)) /*d2d_idlereq*/\
WARNING: line over 80 characters #1010: FILE: board/nokia/rx51/rx51.h:354:
- MUX_VAL(CP(D2D_IDLEACK), (IEN | PTU | EN | M0)) /*d2d_idleack*/\
WARNING: line over 80 characters #1015: FILE: board/nokia/rx51/rx51.h:359:
- MUX_VAL(CP(D2D_MBUSFLAG), (IEN | PTD | DIS | M0)) /*d2d_mbusflag*/\
WARNING: line over 80 characters #1016: FILE: board/nokia/rx51/rx51.h:360:
- MUX_VAL(CP(D2D_SBUSFLAG), (IEN | PTD | DIS | M0)) /*d2d_sbusflag*/\
This code was copied from beagle board.
WARNING: line over 80 characters #1088: FILE: include/configs/nokia_rx51.h:42: +#define CONFIG_ARMV7 /* This is an ARM V7 CPU core */
WARNING: line over 80 characters #1089: FILE: include/configs/nokia_rx51.h:43: +#define CONFIG_OMAP /* in a TI OMAP core */
WARNING: line over 80 characters #1090: FILE: include/configs/nokia_rx51.h:44: +#define CONFIG_OMAP34XX /* which is a 34XX */
WARNING: line over 80 characters #1091: FILE: include/configs/nokia_rx51.h:45: +#define CONFIG_OMAP3430 /* which is in a 3430 */
WARNING: line over 80 characters #1092: FILE: include/configs/nokia_rx51.h:46: +#define CONFIG_CHAINLOADER /* Loaded by NOLO */
WARNING: line over 80 characters #1093: FILE: include/configs/nokia_rx51.h:47: +#define CONFIG_L2_OFF /* kernel won't boot if l2
enabled (old u-boot
tried but failed to enable it, due to a bug.) */
WARNING: line over 80 characters #1100: FILE: include/configs/nokia_rx51.h:54: +#define CONFIG_SDRC /* The chip has SDRC controller */
WARNING: line over 80 characters #1102: FILE: include/configs/nokia_rx51.h:56: +#include <asm/arch/cpu.h> /* get chip and board defs */
WARNING: line over 80 characters #1112: FILE: include/configs/nokia_rx51.h:66: +#define V_OSCK 26000000 /* Clock output from T2 */
WARNING: line over 80 characters #1115: FILE: include/configs/nokia_rx51.h:69: +#undef CONFIG_USE_IRQ /* no support for IRQs */
WARNING: line over 80 characters #1117: FILE: include/configs/nokia_rx51.h:71: +#define CONFIG_SKIP_LOWLEVEL_INIT /* NOLO set everything up */
WARNING: line over 80 characters #1119: FILE: include/configs/nokia_rx51.h:73: +#define CONFIG_CMDLINE_TAG /* enable passing kernel
command line string
*/
WARNING: line over 80 characters #1120: FILE: include/configs/nokia_rx51.h:74: +#define CONFIG_INITRD_TAG /* enable passing initrd */
WARNING: line over 80 characters #1125: FILE: include/configs/nokia_rx51.h:79: +#define CONFIG_ENV_SIZE (128 << 10) /* 128 KiB Sector */
WARNING: line over 80 characters #1135: FILE: include/configs/nokia_rx51.h:89: +#define V_NS16550_CLK 48000000 /* 48MHz (APLL96/2) */
WARNING: line over 80 characters #1147: FILE: include/configs/nokia_rx51.h:101: +#define CONFIG_SERIAL3 3 /* UART3 on RX-51 */
ERROR: space required after that ',' (ctx:VxV) #1152: FILE: include/configs/nokia_rx51.h:106: +#define CONFIG_SYS_BAUDRATE_TABLE {4800, 9600, 19200, 38400, 57600,115200} ^
WARNING: line over 80 characters #1176: FILE: include/configs/nokia_rx51.h:130: +#define CONFIG_CMD_EXT2 /* EXT2 Support */
WARNING: line over 80 characters #1177: FILE: include/configs/nokia_rx51.h:131: +#define CONFIG_CMD_FAT /* FAT support */
WARNING: line over 80 characters #1179: FILE: include/configs/nokia_rx51.h:133: +#define CONFIG_CMD_I2C /* I2C serial bus support */
WARNING: line over 80 characters #1180: FILE: include/configs/nokia_rx51.h:134: +#define CONFIG_CMD_MMC /* MMC support */
WARNING: line over 80 characters #1181: FILE: include/configs/nokia_rx51.h:135: +#undef CONFIG_CMD_ONENAND /* NAND support */
WARNING: line over 80 characters #1183: FILE: include/configs/nokia_rx51.h:137: +#define CONFIG_CMD_CLR /* ANSI terminal clear screen
command */
WARNING: line over 80 characters #1185: FILE: include/configs/nokia_rx51.h:139: +#undef CONFIG_CMD_FLASH /* flinfo, erase, protect */
WARNING: line over 80 characters #1186: FILE: include/configs/nokia_rx51.h:140: +#undef CONFIG_CMD_FPGA /* FPGA configuration Support
*/
WARNING: line over 80 characters #1188: FILE: include/configs/nokia_rx51.h:142: +#undef CONFIG_CMD_IMLS /* List all found images */
WARNING: line over 80 characters #1189: FILE: include/configs/nokia_rx51.h:143: +#undef CONFIG_CMD_NET /* bootp, tftpboot, rarpboot
*/
WARNING: line over 80 characters #1190: FILE: include/configs/nokia_rx51.h:144: +#undef CONFIG_CMD_NFS /* NFS support */
WARNING: line over 80 characters #1216: FILE: include/configs/nokia_rx51.h:170: +#define CONFIG_CFB_CONSOLE_ANSI /* Enable ANSI escape codes
in
framebuffer */
I think adding these comments are usefull - do you want to remove it?
WARNING: line over 80 characters #1249: FILE: include/configs/nokia_rx51.h:203:
- "scriptload=${mmctype}load mmc ${mmcnum}:${mmcpart} ${loadaddr}
${mmcfile}\0" \
WARNING: line over 80 characters #1250: FILE: include/configs/nokia_rx51.h:204:
- "scriptboot=echo Running ${mmcfile} from mmc ${mmcnum}:${mmcpart} ...;" \
WARNING: line over 80 characters #1252: FILE: include/configs/nokia_rx51.h:206:
- "uimageload=${mmctype}load mmc ${mmcnum}:${mmcpart} ${loadaddr}
${mmcfile}\0" \
WARNING: line over 80 characters #1253: FILE: include/configs/nokia_rx51.h:207:
- "uimageboot=echo Booting ${mmcfile} from mmc ${mmcnum}:${mmcpart} ...;" \
WARNING: line over 80 characters #1306: FILE: include/configs/nokia_rx51.h:260: +#define CONFIG_SYS_LONGHELP /* undef to save memory */
WARNING: line over 80 characters #1307: FILE: include/configs/nokia_rx51.h:261: +#define CONFIG_SYS_HUSH_PARSER /* use "hush" command parser
*/
WARNING: line over 80 characters #1310: FILE: include/configs/nokia_rx51.h:264: +#define CONFIG_SYS_CBSIZE 256 /* Console I/O Buffer Size */
WARNING: line over 80 characters #1312: FILE: include/configs/nokia_rx51.h:266: +#define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE +
sizeof(CONFIG_SYS_PROMPT) +
WARNING: line over 80 characters #1313: FILE: include/configs/nokia_rx51.h:267: +#define CONFIG_SYS_MAXARGS 16 /* max number of command args
*/
WARNING: line over 80 characters #1317: FILE: include/configs/nokia_rx51.h:271: +#define CONFIG_SYS_MEMTEST_START (OMAP34XX_SDRC_CS0) /* memtest works on
*/
WARNING: line over 80 characters #1318: FILE: include/configs/nokia_rx51.h:272: +#define CONFIG_SYS_MEMTEST_END (OMAP34XX_SDRC_CS0 + 0x01F00000) /* 31MB
*/
WARNING: line over 80 characters #1320: FILE: include/configs/nokia_rx51.h:274: +#define CONFIG_SYS_LOAD_ADDR (OMAP34XX_SDRC_CS0) /* default load
address
*/
WARNING: line over 80 characters #1328: FILE: include/configs/nokia_rx51.h:282: +#define CONFIG_SYS_PTV 2 /* Divisor: 2^(PTV+1) => 8 */
WARNING: line over 80 characters #1336: FILE: include/configs/nokia_rx51.h:290: +#define CONFIG_STACKSIZE (128 << 10) /* regular stack 128 KiB */
WARNING: line over 80 characters #1338: FILE: include/configs/nokia_rx51.h:292: +#define CONFIG_STACKSIZE_IRQ (4 << 10) /* IRQ stack 4 KiB */
WARNING: line over 80 characters #1339: FILE: include/configs/nokia_rx51.h:293: +#define CONFIG_STACKSIZE_FIQ (4 << 10) /* FIQ stack 4 KiB */
WARNING: line over 80 characters #1345: FILE: include/configs/nokia_rx51.h:299: +#define CONFIG_NR_DRAM_BANKS 2 /* CS1 may or may not be
populated */
WARNING: line over 80 characters #1361: FILE: include/configs/nokia_rx51.h:315: +#define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
total: 12 errors, 124 warnings, 1173 lines checked
/home/wd/Mail/U-Boot/12789 has style problems, please review.
If any of these errors are false positives, please report them to the maintainer, see CHECKPATCH in MAINTAINERS. ERROR: "foo * bar" should be "foo *bar" #178: FILE: common/cmd_bootmenu.c:32: +static char * get_option(int n) {
ERROR: open brace '{' following function declarations go on the next line #178: FILE: common/cmd_bootmenu.c:32: +static char * get_option(int n) {
ERROR: space prohibited after that open parenthesis '(' #182: FILE: common/cmd_bootmenu.c:36:
- if ( n < 0 || n > 99 )
ERROR: space prohibited before that close parenthesis ')' #182: FILE: common/cmd_bootmenu.c:36:
- if ( n < 0 || n > 99 )
ERROR: "foo * bar" should be "foo *bar" #191: FILE: common/cmd_bootmenu.c:45: +static char * get_end_of_title(char * str) {
ERROR: open brace '{' following function declarations go on the next line #191: FILE: common/cmd_bootmenu.c:45: +static char * get_end_of_title(char * str) {
ERROR: space prohibited after that '!' (ctx:WxW) #193: FILE: common/cmd_bootmenu.c:47:
- if ( ! str ) ^
ERROR: space prohibited after that open parenthesis '(' #193: FILE: common/cmd_bootmenu.c:47:
- if ( ! str )
ERROR: space prohibited before that close parenthesis ')' #193: FILE: common/cmd_bootmenu.c:47:
- if ( ! str )
ERROR: "foo * bar" should be "foo *bar" #200: FILE: common/cmd_bootmenu.c:54: +static int print_title(char * begin, char * end) {
ERROR: open brace '{' following function declarations go on the next line #200: FILE: common/cmd_bootmenu.c:54: +static int print_title(char * begin, char * end) {
ERROR: space prohibited after that '!' (ctx:WxW) #202: FILE: common/cmd_bootmenu.c:56:
- if ( ! begin || ! end || end < begin ) ^
ERROR: space prohibited after that '!' (ctx:WxW) #202: FILE: common/cmd_bootmenu.c:56:
- if ( ! begin || ! end || end < begin ) ^
ERROR: space prohibited after that open parenthesis '(' #202: FILE: common/cmd_bootmenu.c:56:
- if ( ! begin || ! end || end < begin )
ERROR: space prohibited before that close parenthesis ')' #202: FILE: common/cmd_bootmenu.c:56:
- if ( ! begin || ! end || end < begin )
ERROR: space prohibited after that open parenthesis '(' #205: FILE: common/cmd_bootmenu.c:59:
- while ( begin != end )
ERROR: space prohibited before that close parenthesis ')' #205: FILE: common/cmd_bootmenu.c:59:
- while ( begin != end )
ERROR: open brace '{' following function declarations go on the next line #212: FILE: common/cmd_bootmenu.c:66: +static int print_entry(int n, int reverse) {
ERROR: "foo * bar" should be "foo *bar" #214: FILE: common/cmd_bootmenu.c:68:
- char * str = get_option(n);
ERROR: "foo * bar" should be "foo *bar" #215: FILE: common/cmd_bootmenu.c:69:
- char * end = get_end_of_title(str);
ERROR: space prohibited after that '!' (ctx:WxW) #217: FILE: common/cmd_bootmenu.c:71:
- if ( ! end ) ^
ERROR: space prohibited after that open parenthesis '(' #217: FILE: common/cmd_bootmenu.c:71:
- if ( ! end )
ERROR: space prohibited before that close parenthesis ')' #217: FILE: common/cmd_bootmenu.c:71:
- if ( ! end )
ERROR: space prohibited after that open parenthesis '(' #222: FILE: common/cmd_bootmenu.c:76:
- if ( reverse )
ERROR: space prohibited before that close parenthesis ')' #222: FILE: common/cmd_bootmenu.c:76:
- if ( reverse )
ERROR: space prohibited after that open parenthesis '(' #229: FILE: common/cmd_bootmenu.c:83:
- if ( reverse )
ERROR: space prohibited before that close parenthesis ')' #229: FILE: common/cmd_bootmenu.c:83:
- if ( reverse )
ERROR: open brace '{' following function declarations go on the next line #236: FILE: common/cmd_bootmenu.c:90: +static int print_menu(int active) {
ERROR: space prohibited after that open parenthesis '(' #248: FILE: common/cmd_bootmenu.c:102:
- while ( 1 ) {
ERROR: space prohibited before that close parenthesis ')' #248: FILE: common/cmd_bootmenu.c:102:
- while ( 1 ) {
ERROR: space prohibited after that open parenthesis '(' #252: FILE: common/cmd_bootmenu.c:106:
if ( ret == 1 )
ERROR: space prohibited before that close parenthesis ')' #252: FILE: common/cmd_bootmenu.c:106:
if ( ret == 1 )
ERROR: space prohibited after that open parenthesis '(' #261: FILE: common/cmd_bootmenu.c:115:
- if ( n == active )
ERROR: space prohibited before that close parenthesis ')' #261: FILE: common/cmd_bootmenu.c:115:
- if ( n == active )
ERROR: space prohibited after that open parenthesis '(' #267: FILE: common/cmd_bootmenu.c:121:
- if ( n == active )
ERROR: space prohibited before that close parenthesis ')' #267: FILE: common/cmd_bootmenu.c:121:
- if ( n == active )
ERROR: open brace '{' following function declarations go on the next line #282: FILE: common/cmd_bootmenu.c:136: +int do_bootmenu(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) {
ERROR: "foo * bar" should be "foo *bar" #291: FILE: common/cmd_bootmenu.c:145:
- char * delay_str = NULL;
ERROR: space prohibited after that open parenthesis '(' #293: FILE: common/cmd_bootmenu.c:147:
- if ( argc >= 2 )
ERROR: space prohibited before that close parenthesis ')' #293: FILE: common/cmd_bootmenu.c:147:
- if ( argc >= 2 )
ERROR: space prohibited after that '!' (ctx:WxW) #296: FILE: common/cmd_bootmenu.c:150:
- if ( ! delay_str ) ^
ERROR: space prohibited after that open parenthesis '(' #296: FILE: common/cmd_bootmenu.c:150:
- if ( ! delay_str )
ERROR: space prohibited before that close parenthesis ')' #296: FILE: common/cmd_bootmenu.c:150:
- if ( ! delay_str )
ERROR: space prohibited after that open parenthesis '(' #299: FILE: common/cmd_bootmenu.c:153:
- if ( delay_str )
ERROR: space prohibited before that close parenthesis ')' #299: FILE: common/cmd_bootmenu.c:153:
- if ( delay_str )
WARNING: consider using kstrto* in preference to simple_strtol #300: FILE: common/cmd_bootmenu.c:154:
delay = (int)simple_strtol(delay_str, NULL, 10);
ERROR: space prohibited after that open parenthesis '(' #302: FILE: common/cmd_bootmenu.c:156:
- if ( delay == 0 ) {
ERROR: space prohibited before that close parenthesis ')' #302: FILE: common/cmd_bootmenu.c:156:
- if ( delay == 0 ) {
ERROR: space prohibited after that open parenthesis '(' #305: FILE: common/cmd_bootmenu.c:159:
if ( get_end_of_title(get_option(0)) )
ERROR: space prohibited before that close parenthesis ')' #305: FILE: common/cmd_bootmenu.c:159:
if ( get_end_of_title(get_option(0)) )
ERROR: space prohibited after that open parenthesis '(' #312: FILE: common/cmd_bootmenu.c:166:
- if ( delay < 0 )
ERROR: space prohibited before that close parenthesis ')' #312: FILE: common/cmd_bootmenu.c:166:
- if ( delay < 0 )
ERROR: space prohibited after that '!' (ctx:WxW) #315: FILE: common/cmd_bootmenu.c:169:
- if ( ! instant ) { ^
ERROR: space prohibited after that open parenthesis '(' #315: FILE: common/cmd_bootmenu.c:169:
- if ( ! instant ) {
ERROR: space prohibited before that close parenthesis ')' #315: FILE: common/cmd_bootmenu.c:169:
- if ( ! instant ) {
ERROR: space prohibited after that open parenthesis '(' #322: FILE: common/cmd_bootmenu.c:176:
- while ( 1 ) {
ERROR: space prohibited before that close parenthesis ')' #322: FILE: common/cmd_bootmenu.c:176:
- while ( 1 ) {
ERROR: space prohibited after that open parenthesis '(' #324: FILE: common/cmd_bootmenu.c:178:
if ( abort || delay > 0 )
ERROR: space prohibited before that close parenthesis ')' #324: FILE: common/cmd_bootmenu.c:178:
if ( abort || delay > 0 )
ERROR: space prohibited after that '!' (ctx:WxW) #327: FILE: common/cmd_bootmenu.c:181:
if ( ! abort ) { ^
ERROR: space prohibited after that open parenthesis '(' #327: FILE: common/cmd_bootmenu.c:181:
if ( ! abort ) {
ERROR: space prohibited before that close parenthesis ')' #327: FILE: common/cmd_bootmenu.c:181:
if ( ! abort ) {
ERROR: space prohibited after that open parenthesis '(' #329: FILE: common/cmd_bootmenu.c:183:
if ( delay > 0 )
ERROR: space prohibited before that close parenthesis ')' #329: FILE: common/cmd_bootmenu.c:183:
if ( delay > 0 )
WARNING: line over 80 characters #330: FILE: common/cmd_bootmenu.c:184:
printf(" Hit any key to stop autoboot: %2d ", delay);
ERROR: space prohibited after that open parenthesis '(' #332: FILE: common/cmd_bootmenu.c:186:
while ( delay > 0 ) {
ERROR: space prohibited before that close parenthesis ')' #332: FILE: common/cmd_bootmenu.c:186:
while ( delay > 0 ) {
ERROR: space prohibited after that open parenthesis '(' #336: FILE: common/cmd_bootmenu.c:190:
for ( i = 0; i < 100; ++i ) {
ERROR: space prohibited before that close parenthesis ')' #336: FILE: common/cmd_bootmenu.c:190:
for ( i = 0; i < 100; ++i ) {
ERROR: space prohibited after that open parenthesis '(' #338: FILE: common/cmd_bootmenu.c:192:
if ( tstc() ) {
ERROR: space prohibited before that close parenthesis ')' #338: FILE: common/cmd_bootmenu.c:192:
if ( tstc() ) {
ERROR: space prohibited after that open parenthesis '(' #343: FILE: common/cmd_bootmenu.c:197:
if ( key == '\e' ) {
ERROR: space prohibited before that close parenthesis ')' #343: FILE: common/cmd_bootmenu.c:197:
if ( key == '\e' ) {
ERROR: space prohibited after that open parenthesis '(' #346: FILE: common/cmd_bootmenu.c:200:
} else if ( key == '\r' )
ERROR: space prohibited before that close parenthesis ')' #346: FILE: common/cmd_bootmenu.c:200:
} else if ( key == '\r' )
ERROR: space prohibited after that open parenthesis '(' #360: FILE: common/cmd_bootmenu.c:214:
if ( abort )
ERROR: space prohibited before that close parenthesis ')' #360: FILE: common/cmd_bootmenu.c:214:
if ( abort )
ERROR: space prohibited after that open parenthesis '(' #368: FILE: common/cmd_bootmenu.c:222:
if ( delay <= 0 )
ERROR: space prohibited before that close parenthesis ')' #368: FILE: common/cmd_bootmenu.c:222:
if ( delay <= 0 )
ERROR: space prohibited after that '!' (ctx:WxW) #373: FILE: common/cmd_bootmenu.c:227:
while ( ! tstc() ) { ^
ERROR: space prohibited after that open parenthesis '(' #373: FILE: common/cmd_bootmenu.c:227:
while ( ! tstc() ) {
ERROR: space prohibited before that close parenthesis ')' #373: FILE: common/cmd_bootmenu.c:227:
while ( ! tstc() ) {
ERROR: space prohibited after that open parenthesis '(' #382: FILE: common/cmd_bootmenu.c:236:
if ( esc == 0 ) {
ERROR: space prohibited before that close parenthesis ')' #382: FILE: common/cmd_bootmenu.c:236:
if ( esc == 0 ) {
ERROR: space prohibited after that open parenthesis '(' #384: FILE: common/cmd_bootmenu.c:238:
if ( key == '\e' ) {
ERROR: space prohibited before that close parenthesis ')' #384: FILE: common/cmd_bootmenu.c:238:
if ( key == '\e' ) {
ERROR: space prohibited after that open parenthesis '(' #389: FILE: common/cmd_bootmenu.c:243:
} else if ( esc == 1 ) {
ERROR: space prohibited before that close parenthesis ')' #389: FILE: common/cmd_bootmenu.c:243:
} else if ( esc == 1 ) {
ERROR: space prohibited after that open parenthesis '(' #391: FILE: common/cmd_bootmenu.c:245:
if ( key == '[' ) {
ERROR: space prohibited before that close parenthesis ')' #391: FILE: common/cmd_bootmenu.c:245:
if ( key == '[' ) {
ERROR: space prohibited after that open parenthesis '(' #397: FILE: common/cmd_bootmenu.c:251:
} else if ( esc == 2 || esc == 3 ) {
ERROR: space prohibited before that close parenthesis ')' #397: FILE: common/cmd_bootmenu.c:251:
} else if ( esc == 2 || esc == 3 ) {
ERROR: space prohibited after that open parenthesis '(' #399: FILE: common/cmd_bootmenu.c:253:
if ( esc == 2 && key == '1' ) {
ERROR: space prohibited before that close parenthesis ')' #399: FILE: common/cmd_bootmenu.c:253:
if ( esc == 2 && key == '1' ) {
ERROR: space prohibited after that open parenthesis '(' #405: FILE: common/cmd_bootmenu.c:259:
if ( key == 'A' )
ERROR: space prohibited before that close parenthesis ')' #405: FILE: common/cmd_bootmenu.c:259:
if ( key == 'A' )
ERROR: space prohibited after that open parenthesis '(' #407: FILE: common/cmd_bootmenu.c:261:
else if ( key == 'B' )
ERROR: space prohibited before that close parenthesis ')' #407: FILE: common/cmd_bootmenu.c:261:
else if ( key == 'B' )
ERROR: space prohibited after that open parenthesis '(' #414: FILE: common/cmd_bootmenu.c:268:
if ( key == '\r' )
ERROR: space prohibited before that close parenthesis ')' #414: FILE: common/cmd_bootmenu.c:268:
if ( key == '\r' )
ERROR: space prohibited after that open parenthesis '(' #419: FILE: common/cmd_bootmenu.c:273:
if ( key == 1 ) {
ERROR: space prohibited before that close parenthesis ')' #419: FILE: common/cmd_bootmenu.c:273:
if ( key == 1 ) {
ERROR: space prohibited after that open parenthesis '(' #421: FILE: common/cmd_bootmenu.c:275:
if ( active > 0 )
ERROR: space prohibited before that close parenthesis ')' #421: FILE: common/cmd_bootmenu.c:275:
if ( active > 0 )
ERROR: space prohibited after that open parenthesis '(' #424: FILE: common/cmd_bootmenu.c:278:
} else if ( key == 2 ) {
ERROR: space prohibited before that close parenthesis ')' #424: FILE: common/cmd_bootmenu.c:278:
} else if ( key == 2 ) {
ERROR: space prohibited after that open parenthesis '(' #426: FILE: common/cmd_bootmenu.c:280:
if ( active < count )
ERROR: space prohibited before that close parenthesis ')' #426: FILE: common/cmd_bootmenu.c:280:
if ( active < count )
ERROR: space prohibited after that open parenthesis '(' #429: FILE: common/cmd_bootmenu.c:283:
} else if ( key == 3 ) {
ERROR: space prohibited before that close parenthesis ')' #429: FILE: common/cmd_bootmenu.c:283:
} else if ( key == 3 ) {
ERROR: "foo * bar" should be "foo *bar" #431: FILE: common/cmd_bootmenu.c:285:
char * str;
ERROR: "foo * bar" should be "foo *bar" #432: FILE: common/cmd_bootmenu.c:286:
char * end;
ERROR: space prohibited after that '!' (ctx:WxW) #436: FILE: common/cmd_bootmenu.c:290:
if ( ! instant ) { ^
ERROR: space prohibited after that open parenthesis '(' #436: FILE: common/cmd_bootmenu.c:290:
if ( ! instant ) {
ERROR: space prohibited before that close parenthesis ')' #436: FILE: common/cmd_bootmenu.c:290:
if ( ! instant ) {
ERROR: space prohibited after that open parenthesis '(' #446: FILE: common/cmd_bootmenu.c:300:
if ( active == count ) {
ERROR: space prohibited before that close parenthesis ')' #446: FILE: common/cmd_bootmenu.c:300:
if ( active == count ) {
ERROR: space prohibited after that '!' (ctx:WxW) #456: FILE: common/cmd_bootmenu.c:310:
if ( ! end ) { ^
ERROR: space prohibited after that open parenthesis '(' #456: FILE: common/cmd_bootmenu.c:310:
if ( ! end ) {
ERROR: space prohibited before that close parenthesis ')' #456: FILE: common/cmd_bootmenu.c:310:
if ( ! end ) {
WARNING: line over 80 characters #458: FILE: common/cmd_bootmenu.c:312:
printf("Invalid Boot Menu entry %d\nStarting U-Boot
console\n\n",
active);
ERROR: space prohibited after that '!' (ctx:WxW) #463: FILE: common/cmd_bootmenu.c:317:
if ( ! end[1] ) { ^
ERROR: space prohibited after that open parenthesis '(' #463: FILE: common/cmd_bootmenu.c:317:
if ( ! end[1] ) {
ERROR: space prohibited before that close parenthesis ')' #463: FILE: common/cmd_bootmenu.c:317:
if ( ! end[1] ) {
WARNING: line over 80 characters #479: FILE: common/cmd_bootmenu.c:333:
parse_string_outer(end+1, FLAG_PARSE_SEMICOLON |
FLAG_EXIT_FROM_LOOP);
total: 121 errors, 4 warnings, 369 lines checked
/home/wd/Mail/U-Boot/12790 has style problems, please review.
I will look at this file and try to fix problems.
If any of these errors are false positives, please report them to the maintainer, see CHECKPATCH in MAINTAINERS. WARNING: line over 80 characters #111: FILE: include/configs/nokia_rx51.h:137: +#define CONFIG_CMD_BOOTMENU /* ANSI terminal Boot Menu */
WARNING: line over 80 characters #140: FILE: include/configs/nokia_rx51.h:244:
"setenv mmcnum 1; setenv mmcpart 1; setenv mmctype fat; setenv mmcfile
bootmenu.scr;" \
total: 0 errors, 2 warnings, 48 lines checked
/home/wd/Mail/U-Boot/12791 has style problems, please review.
If any of these errors are false positives, please report them to the maintainer, see CHECKPATCH in MAINTAINERS.
Best regards,
Wolfgang Denk

Dear Pali =?ISO-8859-1?Q?Roh=E1r?=,
please do not full-quote. Quote only as much of the mail you are replying to as is needed to give enough context. It makes no sense to quoted hundrets of lines which you are not referring to in your reply.
Thanks.
In message 17199828.H8TsXDWnq5@pali-elitebook you wrote:
WARNING: space prohibited between function name and open parenthesis '(' #130: FILE: arch/arm/lib/bootm.c:128:
- s = getenv ("atagaddr");
see file arch/arm/lib/bootm.c - it has this code styling. so this is not error unless you want to mix more code styling in one file.
If you find broken code, then please help fixing it.
Never try to use this as an excuse to add even more broken code.
WARNING: consider using kstrto* in preference to simple_strtoul
...
really? I was not able to find kstrtoul function
False positive.
WARNING: space prohibited between function name and open parenthesis '('
...
WARNING: please, no spaces at the start of a line
...
same - see my first comment
See my comment. All these must be fixed.
see commit message - this patch is from linux upstream and uf u-boot has same styling this should be ok too.
Linux is not always as strict as we tend to be.
Also, if this code has been copied from Linux, then youi missed to properly reference it. See http://www.denx.de/wiki/view/U-Boot/Patches#Attributing_Code_Copyrights_Sign
WARNING: line over 80 characters #117: FILE: common/main.c:1028:
case '\e': /* ANSI escape char */
again - same formating in file common/main.c
Fix it!
WARNING: line over 80 characters
...
If you want I remove above comments /* ... */
If these comments are considered useful, then they should be kept.
In any case, the line length must not be exceeded.
ERROR: do not initialise statics to 0 or NULL #113: FILE: drivers/video/cfb_console.c:382: +static int ansi_colors_need_revert = 0;
what is problem with initialising to 0?
It's redundant, we don't like it, and it triggers a checkpatch warning :-)
Best regards,
Wolfgang Denk

On Saturday 17 December 2011 11:59:14 Pali Rohár wrote:
I'm sending new patch series, which add Nokia RX-51 support to U-Boot. This patches are based on master commit 06e42c6e2ce269667daecd6229d0b7c813838203 and now U-Boot working on Nokia RX-51.
please run all your patches through ./tools/checkpatch.pl. you've got a lot of common issues here. -mike

On Sunday 18 December 2011 14:01:54 Mike Frysinger wrote:
On Saturday 17 December 2011 11:59:14 Pali Rohár wrote:
I'm sending new patch series, which add Nokia RX-51 support to U-Boot. This patches are based on master commit 06e42c6e2ce269667daecd6229d0b7c813838203 and now U-Boot working on Nokia RX-51.
please run all your patches through ./tools/checkpatch.pl. you've got a lot of common issues here. -mike
Ok, I will fix all problems detected by checkpatch.pl

Hello,
I'm sending third version of rx51 patches for u-boot. All patches was checked by checkpatch.pl and no error or warning was appeared. Last 2 patches (0014 and 0015) adding ANSI terminal bootmenu support for rx51 and can be reviewed separatly (patches 0001-0013 adding nokia rx51 board support and working without that last two).

* Hide function save_boot_params if CONFIG_SPL_BUILD is not defined (function do nothing)
* Same behaviour as in file arch/arm/cpu/armv7/omap4/lowlevel_init.S * This allow to implement board specified function save_boot_params in board code
Signed-off-by: Pali Rohár pali.rohar@gmail.com --- arch/arm/cpu/armv7/omap3/lowlevel_init.S | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/arm/cpu/armv7/omap3/lowlevel_init.S b/arch/arm/cpu/armv7/omap3/lowlevel_init.S index 2f6930b..c42c5dd 100644 --- a/arch/arm/cpu/armv7/omap3/lowlevel_init.S +++ b/arch/arm/cpu/armv7/omap3/lowlevel_init.S @@ -35,15 +35,15 @@ _TEXT_BASE: .word CONFIG_SYS_TEXT_BASE /* sdram load addr from config.mk */
+#ifdef CONFIG_SPL_BUILD .global save_boot_params save_boot_params: -#ifdef CONFIG_SPL_BUILD ldr r4, =omap3_boot_device ldr r5, [r0, #0x4] and r5, r5, #0xff str r5, [r4] -#endif bx lr +#endif
.global omap3_gp_romcode_call omap3_gp_romcode_call:

This patch adapts the bootm command so that it can use an existing atags command set up by a previous bootloader. If the environment variable "atagaddr" is unset, bootm behaves as normal. If "atagaddr" is set, bootm will use atags address from environment variable and also append new boot args (if specified in u-boot). For example, if a previous boot loader already set up the atags struct at 0x80000100:
setenv atagaddr 0x80000100; bootm 0x80008000
Signed-off-by: Pali Rohár pali.rohar@gmail.com --- README | 2 ++ arch/arm/lib/bootm.c | 37 ++++++++++++++++++++++++++++++------- 2 files changed, 32 insertions(+), 7 deletions(-)
diff --git a/README b/README index ff72e47..3dd5a97 100644 --- a/README +++ b/README @@ -3564,6 +3564,8 @@ Some configuration options can be set using Environment Variables.
List of environment variables (most likely not complete):
+ atagaddr - bootm will use ATAGs struct from specified address (arm only) + baudrate - see CONFIG_BAUDRATE
bootdelay - see CONFIG_BOOTDELAY diff --git a/arch/arm/lib/bootm.c b/arch/arm/lib/bootm.c index 802e833..1d76774 100644 --- a/arch/arm/lib/bootm.c +++ b/arch/arm/lib/bootm.c @@ -93,6 +93,14 @@ static void announce_and_cleanup(void) cleanup_before_linux(); }
+#if defined(CONFIG_SETUP_MEMORY_TAGS) || \ +defined(CONFIG_CMDLINE_TAG) || \ +defined(CONFIG_INITRD_TAG) || \ +defined(CONFIG_SERIAL_TAG) || \ +defined(CONFIG_REVISION_TAG) +#define CONFIG_SETUP_ANY_TAG +#endif + int do_bootm_linux(int flag, int argc, char *argv[], bootm_headers_t *images) { bd_t *bd = gd->bd; @@ -125,12 +133,20 @@ int do_bootm_linux(int flag, int argc, char *argv[], bootm_headers_t *images) debug ("## Transferring control to Linux (at address %08lx) ...\n", (ulong) kernel_entry);
-#if defined (CONFIG_SETUP_MEMORY_TAGS) || \ - defined (CONFIG_CMDLINE_TAG) || \ - defined (CONFIG_INITRD_TAG) || \ - defined (CONFIG_SERIAL_TAG) || \ - defined (CONFIG_REVISION_TAG) - setup_start_tag (bd); + s = getenv("atagaddr"); + if (s) { + bd->bi_boot_params = simple_strtoul(s, NULL, 16); + printf("Using existing atags at %#x\n", bd->bi_boot_params); + + params = (struct tag *) bd->bi_boot_params; + while (params->hdr.size > 0) + params = tag_next(params); + } else { +#ifdef CONFIG_SETUP_ANY_TAG + setup_start_tag(bd); +#endif + } + #ifdef CONFIG_SERIAL_TAG setup_serial_tag (¶ms); #endif @@ -147,8 +163,15 @@ int do_bootm_linux(int flag, int argc, char *argv[], bootm_headers_t *images) if (images->rd_start && images->rd_end) setup_initrd_tag (bd, images->rd_start, images->rd_end); #endif - setup_end_tag(bd); + + if (s) { + if (params->hdr.size > 0) + setup_end_tag(bd); + } else { +#ifdef CONFIG_SETUP_ANY_TAG + setup_end_tag(bd); #endif + }
announce_and_cleanup();

* Code copied from linux kernel 3.0.0 from file include/linux/i2c/twl.h
Signed-off-by: Pali Rohár pali.rohar@gmail.com --- include/twl4030.h | 98 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 98 insertions(+), 0 deletions(-)
diff --git a/include/twl4030.h b/include/twl4030.h index 9cd32ab..0c17f59 100644 --- a/include/twl4030.h +++ b/include/twl4030.h @@ -151,6 +151,103 @@ #define TWL4030_PM_MASTER_SW_EVENTS_DEVSLP (1 << 1) #define TWL4030_PM_MASTER_SW_EVENTS_DEVOFF (1 << 0)
+/* Power bus message definitions */ + +/* The TWL4030/5030 splits its power-management resources (the various + * regulators, clock and reset lines) into 3 processor groups - P1, P2 and + * P3. These groups can then be configured to transition between sleep, wait-on + * and active states by sending messages to the power bus. See Section 5.4.2 + * Power Resources of TWL4030 TRM + */ + +/* Processor groups */ +#define DEV_GRP_NULL 0x0 +#define DEV_GRP_P1 0x1 /* P1: all OMAP devices */ +#define DEV_GRP_P2 0x2 /* P2: all Modem devices */ +#define DEV_GRP_P3 0x4 /* P3: all peripheral devices */ + +/* Resource groups */ +#define RES_GRP_RES 0x0 /* Reserved */ +#define RES_GRP_PP 0x1 /* Power providers */ +#define RES_GRP_RC 0x2 /* Reset and control */ +#define RES_GRP_PP_RC 0x3 +#define RES_GRP_PR 0x4 /* Power references */ +#define RES_GRP_PP_PR 0x5 +#define RES_GRP_RC_PR 0x6 +#define RES_GRP_ALL 0x7 /* All resource groups */ + +#define RES_TYPE2_R0 0x0 + +#define RES_TYPE_ALL 0x7 + +/* Resource states */ +#define RES_STATE_WRST 0xF +#define RES_STATE_ACTIVE 0xE +#define RES_STATE_SLEEP 0x8 +#define RES_STATE_OFF 0x0 + +/* Power resources */ + +/* Power providers */ +#define RES_VAUX1 1 +#define RES_VAUX2 2 +#define RES_VAUX3 3 +#define RES_VAUX4 4 +#define RES_VMMC1 5 +#define RES_VMMC2 6 +#define RES_VPLL1 7 +#define RES_VPLL2 8 +#define RES_VSIM 9 +#define RES_VDAC 10 +#define RES_VINTANA1 11 +#define RES_VINTANA2 12 +#define RES_VINTDIG 13 +#define RES_VIO 14 +#define RES_VDD1 15 +#define RES_VDD2 16 +#define RES_VUSB_1V5 17 +#define RES_VUSB_1V8 18 +#define RES_VUSB_3V1 19 +#define RES_VUSBCP 20 +#define RES_REGEN 21 +/* Reset and control */ +#define RES_NRES_PWRON 22 +#define RES_CLKEN 23 +#define RES_SYSEN 24 +#define RES_HFCLKOUT 25 +#define RES_32KCLKOUT 26 +#define RES_RESET 27 +/* Power Reference */ +#define RES_Main_Ref 28 + +#define TOTAL_RESOURCES 28 +/* + * Power Bus Message Format ... these can be sent individually by Linux, + * but are usually part of downloaded scripts that are run when various + * power events are triggered. + * + * Broadcast Message (16 Bits): + * DEV_GRP[15:13] MT[12] RES_GRP[11:9] RES_TYPE2[8:7] RES_TYPE[6:4] + * RES_STATE[3:0] + * + * Singular Message (16 Bits): + * DEV_GRP[15:13] MT[12] RES_ID[11:4] RES_STATE[3:0] + */ + +#define MSG_BROADCAST(devgrp, grp, type, type2, state) \ + ((devgrp) << 13 | 1 << 12 | (grp) << 9 | (type2) << 7 \ + | (type) << 4 | (state)) + +#define MSG_SINGULAR(devgrp, id, state) \ + ((devgrp) << 13 | 0 << 12 | (id) << 4 | (state)) + +#define MSG_BROADCAST_ALL(devgrp, state) \ + ((devgrp) << 5 | (state)) + +#define MSG_BROADCAST_REF MSG_BROADCAST_ALL +#define MSG_BROADCAST_PROV MSG_BROADCAST_ALL +#define MSG_BROADCAST__CLK_RST MSG_BROADCAST_ALL + /* Power Managment Receiver */ #define TWL4030_PM_RECEIVER_SC_CONFIG 0x5B #define TWL4030_PM_RECEIVER_SC_DETECT1 0x5C @@ -311,6 +408,7 @@ #define TWL4030_PM_RECEIVER_VDAC_VSEL_18 0x03 #define TWL4030_PM_RECEIVER_VMMC1_VSEL_30 0x02 #define TWL4030_PM_RECEIVER_VMMC1_VSEL_32 0x03 +#define TWL4030_PM_RECEIVER_VSIM_VSEL_18 0x03
/* Device Selection in PM Receiver Module */ #define TWL4030_PM_RECEIVER_DEV_GRP_P1 0x20

Signed-off-by: Pali Rohár pali.rohar@gmail.com --- include/common.h | 20 ++++++++++++++++++++ 1 files changed, 20 insertions(+), 0 deletions(-)
diff --git a/include/common.h b/include/common.h index 5cfdd76..640d15c 100644 --- a/include/common.h +++ b/include/common.h @@ -760,6 +760,26 @@ void clear_ctrlc (void); /* clear the Control-C condition */ int disable_ctrlc (int); /* 1 to disable, 0 to enable Control-C detect */
/* + * ANSI terminal + */ + +#define ANSI_CURSOR_UP "\e[%dA" +#define ANSI_CURSOR_DOWN "\e[%dB" +#define ANSI_CURSOR_FORWARD "\e[%dC" +#define ANSI_CURSOR_BACK "\e[%dD" +#define ANSI_CURSOR_NEXTLINE "\e[%dE" +#define ANSI_CURSOR_PREVIOUSLINE "\e[%dF" +#define ANSI_CURSOR_COLUMN "\e[%dG" +#define ANSI_CURSOR_POSITION "\e[%d;%dH" +#define ANSI_CURSOR_SHOW "\e[?25h" +#define ANSI_CURSOR_HIDE "\e[?25l" +#define ANSI_CLEAR_CONSOLE "\e[2J" +#define ANSI_CLEAR_LINE_TO_END "\e[0K" +#define ANSI_CLEAR_LINE "\e[2K" +#define ANSI_COLOR_RESET "\e[0m" +#define ANSI_COLOR_REVERSE "\e[7m" + +/* * STDIO based functions (can always be used) */ /* serial stuff */

* Ignore ANSI escape codes for moving cursor, which are generated by keyboard
Signed-off-by: Pali Rohár pali.rohar@gmail.com --- common/main.c | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 51 insertions(+), 0 deletions(-)
diff --git a/common/main.c b/common/main.c index e96c95a..e7b5516 100644 --- a/common/main.c +++ b/common/main.c @@ -958,6 +958,7 @@ int readline_into_buffer (const char *const prompt, char * buffer) int n = 0; /* buffer index */ int plen = 0; /* prompt length */ int col; /* output column cnt */ + int esc = 0; /* ansi escape char */ char c;
/* print prompt */ @@ -1024,7 +1025,57 @@ int readline_into_buffer (const char *const prompt, char * buffer) p=delete_char(p_buf, p, &col, &n, plen); continue;
+ case '\e': /* ANSI escape char */ + esc = 1; + continue; + default: + + /* + * Check for ANSI escape chars + */ + if (esc == 0 && c == '\e') { + esc = 1; + continue; + } else if (esc == 1) { + if (c == '[') { + esc = 2; + continue; + } + if (n < CONFIG_SYS_CBSIZE-2) { + ++n; + *p++ = '\e'; + putc('\e'); + } + esc = 0; + } else if (esc == 2 || esc == 3) { + if (esc == 2 && c == '1') { + esc = 3; + continue; + } + /* Ignore ANSI escape sequences */ + /* generated by keyboard */ + /* \e [ 1 A-D and \e [ A-D */ + if (c >= 'A' && c <= 'D') { + esc = 0; + continue; + } + if (esc == 2 && n < CONFIG_SYS_CBSIZE-3) { + n += 2; + *p++ = '\e'; + *p++ = '['; + puts("\e["); + } else if (esc == 3 && + n < CONFIG_SYS_CBSIZE-4) { + n += 3; + *p++ = '\e'; + *p++ = '['; + *p++ = '1'; + puts("\e[1"); + } + esc = 0; + } + /* * Must be a normal character then */

On Sunday 18 December 2011 16:34:01 Pali Rohár wrote:
- Ignore ANSI escape codes for moving cursor, which are generated by
keyboard
this probably should be behind an appropriate CONFIG knob. i don't think this is relevant to serial users (which are the majority of boards). -mike

On Friday 06 January 2012 15:15:29 Mike Frysinger wrote:
On Sunday 18 December 2011 16:34:01 Pali Rohár wrote:
- Ignore ANSI escape codes for moving cursor, which are generated by
keyboard
this probably should be behind an appropriate CONFIG knob. i don't think this is relevant to serial users (which are the majority of boards). -mike
I think this is also relevant to serial console too. I tried serial console (over USB) with Nokia N900 on computer (ANSI terminal) and if I pressed cursor key (UP/DOWN/LEFT/RIGHT) it moved cursor. But in readline function buffer was stored ANSI sequence. So when I pressed ENTER, u-boot tried to execute that buffer and showed me error. But it showed error message something like unknown command <ansi_seq>. ansi_seq was recognized in ansi terminal on computer and it garbaged output. (for example if asn_seq was move up, error message continued on previous line...)
This patch ignore ansi codes which can be generated by curosor keys, so there will not be that bad error messages...

On Saturday 07 January 2012 03:51:16 Pali Rohár wrote:
On Friday 06 January 2012 15:15:29 Mike Frysinger wrote:
On Sunday 18 December 2011 16:34:01 Pali Rohár wrote:
- Ignore ANSI escape codes for moving cursor, which are generated by
keyboard
this probably should be behind an appropriate CONFIG knob. i don't think this is relevant to serial users (which are the majority of boards).
I think this is also relevant to serial console too. I tried serial console (over USB) with Nokia N900 on computer (ANSI terminal) and if I pressed cursor key (UP/DOWN/LEFT/RIGHT) it moved cursor. But in readline function buffer was stored ANSI sequence. So when I pressed ENTER, u-boot tried to execute that buffer and showed me error. But it showed error message something like unknown command <ansi_seq>. ansi_seq was recognized in ansi terminal on computer and it garbaged output. (for example if asn_seq was move up, error message continued on previous line...)
This patch ignore ansi codes which can be generated by curosor keys, so there will not be that bad error messages...
do you have CONFIG_CMDLINE_EDITING enabled ? arrow keys work just fine when that's enabled, and if it isn't, then i think it's expected behavior that pressing the arrow keys would generate "junk" that u-boot wouldn't interpret. -mike

On Sunday 26 February 2012 23:33:01 Mike Frysinger wrote:
On Saturday 07 January 2012 03:51:16 Pali Rohár wrote:
On Friday 06 January 2012 15:15:29 Mike Frysinger wrote:
On Sunday 18 December 2011 16:34:01 Pali Rohár wrote:
- Ignore ANSI escape codes for moving cursor, which are generated by
keyboard
this probably should be behind an appropriate CONFIG knob. i don't think this is relevant to serial users (which are the majority of boards).
I think this is also relevant to serial console too. I tried serial console (over USB) with Nokia N900 on computer (ANSI terminal) and if I pressed cursor key (UP/DOWN/LEFT/RIGHT) it moved cursor. But in readline function buffer was stored ANSI sequence. So when I pressed ENTER, u-boot tried to execute that buffer and showed me error. But it showed error message something like unknown command <ansi_seq>. ansi_seq was recognized in ansi terminal on computer and it garbaged output. (for example if asn_seq was move up, error message continued on previous line...)
This patch ignore ansi codes which can be generated by curosor keys, so there will not be that bad error messages...
do you have CONFIG_CMDLINE_EDITING enabled ? arrow keys work just fine when that's enabled, and if it isn't, then i think it's expected behavior that pressing the arrow keys would generate "junk" that u-boot wouldn't interpret. -mike
I had CONFIG_CMDLINE_EDITING disabled - I did not know this option. Anyway, when I enabled it arrow keys does not worked with cfb video driver and rx51 platform code.
I will try to fix that problem and I then will delete this patch.

On Monday 27 February 2012 13:40:07 Pali Rohár wrote:
On Sunday 26 February 2012 23:33:01 Mike Frysinger wrote:
On Saturday 07 January 2012 03:51:16 Pali Rohár wrote:
On Friday 06 January 2012 15:15:29 Mike Frysinger wrote:
On Sunday 18 December 2011 16:34:01 Pali Rohár wrote:
- Ignore ANSI escape codes for moving cursor, which are generated
by
keyboard
this probably should be behind an appropriate CONFIG knob. i don't think this is relevant to serial users (which are the majority of boards).
I think this is also relevant to serial console too. I tried serial console (over USB) with Nokia N900 on computer (ANSI terminal) and if I pressed cursor key (UP/DOWN/LEFT/RIGHT) it moved cursor. But in readline function buffer was stored ANSI sequence. So when I pressed ENTER, u-boot tried to execute that buffer and showed me error. But it showed error message something like unknown command <ansi_seq>. ansi_seq was recognized in ansi terminal on computer and it garbaged output. (for example if asn_seq was move up, error message continued on previous line...)
This patch ignore ansi codes which can be generated by curosor keys, so there will not be that bad error messages...
do you have CONFIG_CMDLINE_EDITING enabled ? arrow keys work just fine when that's enabled, and if it isn't, then i think it's expected behavior that pressing the arrow keys would generate "junk" that u-boot wouldn't interpret.
I had CONFIG_CMDLINE_EDITING disabled - I did not know this option. Anyway, when I enabled it arrow keys does not worked with cfb video driver and rx51 platform code.
I will try to fix that problem and I then will delete this patch.
sounds good. not sure if this something we could really document in a way that'd help people :/. -mike

* Use correct buffer size, do not damage screen output
Signed-off-by: Pali Rohár pali.rohar@gmail.com --- drivers/video/cfb_console.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/video/cfb_console.c b/drivers/video/cfb_console.c index 904caf7..9092399 100644 --- a/drivers/video/cfb_console.c +++ b/drivers/video/cfb_console.c @@ -701,7 +701,7 @@ static void console_scrollup(void) ); #else memcpyl(CONSOLE_ROW_FIRST, CONSOLE_ROW_SECOND, - CONSOLE_SCROLL_SIZE >> 2); + CONSOLE_SCROLL_SIZE); #endif
/* clear the last one */

* console_clear - clear full console framebuffer output * console_clear_line - clear part of specified line (or full)
Signed-off-by: Pali Rohár pali.rohar@gmail.com --- drivers/video/cfb_console.c | 64 +++++++++++++++++++++++++++++++++++-------- 1 files changed, 52 insertions(+), 12 deletions(-)
diff --git a/drivers/video/cfb_console.c b/drivers/video/cfb_console.c index 9092399..b74d6d0 100644 --- a/drivers/video/cfb_console.c +++ b/drivers/video/cfb_console.c @@ -683,6 +683,57 @@ static void memcpyl(int *d, int *s, int c) } #endif
+static void console_clear(void) +{ +#ifdef VIDEO_HW_RECTFILL + video_hw_rectfill(VIDEO_PIXEL_SIZE, /* bytes per pixel */ + 0, /* dest pos x */ + video_logo_height, /* dest pos y */ + VIDEO_VISIBLE_COLS, /* frame width */ + VIDEO_VISIBLE_ROWS, /* frame height */ + bgx /* fill color */ + ); +#else + memsetl(CONSOLE_ROW_FIRST, CONSOLE_SIZE, bgx); +#endif +} + +static void console_clear_line(int line, int begin, int end) +{ +#ifdef VIDEO_HW_RECTFILL + video_hw_rectfill(VIDEO_PIXEL_SIZE, /* bytes per pixel */ + /* FIXME: correct? */ + VIDEO_FONT_WIDTH * begin, /* dest pos x */ + /* FIXME: correct? */ + video_logo_height + + CONSOLE_ROW_SIZE * line, /* dest pos y */ + /* FIXME: correct? */ + VIDEO_FONT_WIDTH * (end - begin), /* frame width */ + VIDEO_FONT_HEIGHT, /* frame height */ + bgx /* fill color */ + ); +#else + int i; + if (begin == 0 && end == CONSOLE_COLS) + memsetl(CONSOLE_ROW_FIRST + + CONSOLE_ROW_SIZE * line, /* offset of row */ + CONSOLE_ROW_SIZE >> 2, /* length of row */ + bgx /* fill color */ + ); + else + for (i = 0; i < VIDEO_FONT_HEIGHT; ++i) + memsetl(CONSOLE_ROW_FIRST + + CONSOLE_ROW_SIZE * line + /* offset of row */ + VIDEO_FONT_WIDTH * + VIDEO_PIXEL_SIZE * begin + /* offset of col */ + i * VIDEO_LINE_LEN, /* col offset of i line */ + (VIDEO_FONT_WIDTH * VIDEO_PIXEL_SIZE * + (end - begin + 1)) >> 2, /* length to end */ + bgx /* fill color */ + ); +#endif +} + static void console_scrollup(void) { /* copy up rows ignoring the first one */ @@ -705,18 +756,7 @@ static void console_scrollup(void) #endif
/* clear the last one */ -#ifdef VIDEO_HW_RECTFILL - video_hw_rectfill(VIDEO_PIXEL_SIZE, /* bytes per pixel */ - 0, /* dest pos x */ - VIDEO_VISIBLE_ROWS - - VIDEO_FONT_HEIGHT, /* dest pos y */ - VIDEO_VISIBLE_COLS, /* frame width */ - VIDEO_FONT_HEIGHT, /* frame height */ - CONSOLE_BG_COL /* fill color */ - ); -#else - memsetl(CONSOLE_ROW_LAST, CONSOLE_ROW_SIZE >> 2, CONSOLE_BG_COL); -#endif + console_clear_line(CONSOLE_ROWS-1, 0, CONSOLE_COLS); }
static void console_back(void)

* console_cursor_fix - fix cursor position (check for out of screen) * console_cursor_up, console_cursor_down, console_cursor_left, console_cursor_right, console_cursor_set_position for change cursor position * console_newline - added param to specify count of creating new lines * console_previewsline - opposite of console_newline
Signed-off-by: Pali Rohár pali.rohar@gmail.com --- drivers/video/cfb_console.c | 64 +++++++++++++++++++++++++++++++++++++++---- 1 files changed, 58 insertions(+), 6 deletions(-)
diff --git a/drivers/video/cfb_console.c b/drivers/video/cfb_console.c index b74d6d0..3823eae 100644 --- a/drivers/video/cfb_console.c +++ b/drivers/video/cfb_console.c @@ -773,9 +773,54 @@ static void console_back(void) CURSOR_SET; }
-static void console_newline(void) +static void console_cursor_fix(void) { - console_row++; + if (console_row < 0) + console_row = 0; + if (console_row >= CONSOLE_ROWS) + console_row = CONSOLE_ROWS-1; + if (console_col < 0) + console_col = 0; + if (console_col >= CONSOLE_COLS) + console_col = CONSOLE_COLS-1; +} + +static void console_cursor_up(int n) +{ + console_row -= n; + console_cursor_fix(); +} + +static void console_cursor_down(int n) +{ + console_row += n; + console_cursor_fix(); +} + +static void console_cursor_left(int n) +{ + console_col -= n; + console_cursor_fix(); +} + +static void console_cursor_right(int n) +{ + console_col += n; + console_cursor_fix(); +} + +static void console_cursor_set_position(int row, int col) +{ + if (console_row != -1) + console_row = row; + if (console_col != -1) + console_col = col; + console_cursor_fix(); +} + +static void console_newline(int n) +{ + console_row += n; console_col = 0;
/* Check if we need to scroll the terminal */ @@ -784,10 +829,17 @@ static void console_newline(void) console_scrollup();
/* Decrement row number */ - console_row--; + console_row = CONSOLE_ROWS-1; } }
+static void console_previewsline(int n) +{ + /* FIXME: also scroll terminal ? */ + console_row -= n; + console_cursor_fix(); +} + static void console_cr(void) { console_col = 0; @@ -806,7 +858,7 @@ void video_putc(const char c)
case '\n': /* next line */ if (console_col || (!console_col && nl)) - console_newline(); + console_newline(1); nl = 1; break;
@@ -815,7 +867,7 @@ void video_putc(const char c) console_col &= ~0x0007;
if (console_col >= CONSOLE_COLS) - console_newline(); + console_newline(1); break;
case 8: /* backspace */ @@ -829,7 +881,7 @@ void video_putc(const char c)
/* check for newline */ if (console_col >= CONSOLE_COLS) { - console_newline(); + console_newline(1); nl = 0; } }

* This patch add support for move cursor and reverse colors via ANSI espace codes in cfb_console driver * ANSI escape codes can be enabled/disabled via CONFIG_CFB_CONSOLE_ANSI
Signed-off-by: Pali Rohár pali.rohar@gmail.com --- drivers/video/cfb_console.c | 216 ++++++++++++++++++++++++++++++++++++++++++- 1 files changed, 215 insertions(+), 1 deletions(-)
diff --git a/drivers/video/cfb_console.c b/drivers/video/cfb_console.c index 3823eae..dc8d99b 100644 --- a/drivers/video/cfb_console.c +++ b/drivers/video/cfb_console.c @@ -377,6 +377,10 @@ static int console_row; /* cursor row */
static u32 eorx, fgx, bgx; /* color pats */
+static char ansi_buf[10] = { 0, }; +static int ansi_buf_size; +static int ansi_colors_need_revert; + static const int video_font_draw_table8[] = { 0x00000000, 0x000000ff, 0x0000ff00, 0x0000ffff, 0x00ff0000, 0x00ff00ff, 0x00ffff00, 0x00ffffff, @@ -602,6 +606,14 @@ static void video_putchar(int xx, int yy, unsigned char c) video_drawchars(xx, yy + video_logo_height, &c, 1); }
+static void console_swap_colors(void) +{ + eorx = fgx; + fgx = bgx; + bgx = eorx; + eorx = fgx ^ bgx; +} + #if defined(CONFIG_CONSOLE_CURSOR) || defined(CONFIG_VIDEO_SW_CURSOR) static void video_set_cursor(void) { @@ -845,7 +857,7 @@ static void console_cr(void) console_col = 0; }
-void video_putc(const char c) +static void parse_putc(const char c) { static int nl = 1;
@@ -888,6 +900,208 @@ void video_putc(const char c) CURSOR_SET; }
+void video_putc(const char c) +{ +#ifdef CONFIG_CFB_CONSOLE_ANSI + int i; + + if (c == 27) { + for (i = 0; i < ansi_buf_size; ++i) + parse_putc(ansi_buf[i]); + ansi_buf[0] = 27; + ansi_buf_size = 1; + return; + } + + if (ansi_buf_size > 0) { + /* + 0 - ESC + 1 - [ + 2 - num1 + 3 - .. + 4 - ; + 5 - num2 + 6 - .. + 7 - cchar + */ + int next = 0; + + int flush = 0; + int fail = 0; + + int num1 = 0; + int num2 = 0; + int cchar = 0; + + ansi_buf[ansi_buf_size++] = c; + + if (ansi_buf_size >= sizeof(ansi_buf)) + fail = 1; + + for (i = 0; i < ansi_buf_size; ++i) { + if (fail) + break; + + switch (next) { + case 0: + if (ansi_buf[i] == 27) + next = 1; + else + fail = 1; + break; + + case 1: + if (ansi_buf[i] == '[') + next = 2; + else + fail = 1; + break; + + case 2: + if (ansi_buf[i] >= '0' && ansi_buf[i] <= '9') { + num1 = ansi_buf[i]-'0'; + next = 3; + } else { + --i; + num1 = 1; + next = 4; + } + break; + + case 3: + if (ansi_buf[i] >= '0' && ansi_buf[i] <= '9') { + num1 *= 10; + num1 += ansi_buf[i]-'0'; + } else { + --i; + next = 4; + } + break; + + case 4: + if (ansi_buf[i] != ';') { + --i; + next = 7; + } else + next = 5; + break; + + case 5: + if (ansi_buf[i] >= '0' && ansi_buf[i] <= '9') { + num2 = ansi_buf[i]-'0'; + next = 6; + } else + fail = 1; + break; + + case 6: + if (ansi_buf[i] >= '0' && ansi_buf[i] <= '9') { + num2 *= 10; + num2 += ansi_buf[i]-'0'; + } else { + --i; + next = 7; + } + break; + + case 7: + if ((ansi_buf[i] >= 'A' && ansi_buf[i] <= 'H') + || ansi_buf[i] == 'J' + || ansi_buf[i] == 'K' + || ansi_buf[i] == 'm') { + cchar = ansi_buf[i]; + flush = 1; + } else + fail = 1; + break; + } + } + + if (fail) { + for (i = 0; i < ansi_buf_size; ++i) + parse_putc(ansi_buf[i]); + ansi_buf_size = 0; + return; + } + + if (flush) { + CURSOR_OFF; + ansi_buf_size = 0; + switch (cchar) { + case 'A': + /* move cursor num1 rows up */ + console_cursor_up(num1); + break; + case 'B': + /* move cursor num1 rows down */ + console_cursor_down(num1); + break; + case 'C': + /* move cursor num1 columns forward */ + console_cursor_right(num1); + break; + case 'D': + /* move cursor num1 columns back */ + console_cursor_left(num1); + break; + case 'E': + /* move cursor num1 rows up at begin of row */ + console_previewsline(num1); + break; + case 'F': + /* move cursor num1 rows down at begin of row */ + console_newline(num1); + break; + case 'G': + /* move cursor to column num1 */ + console_cursor_set_position(-1, num1-1); + break; + case 'H': + /* move cursor to row num1, column num2 */ + console_cursor_set_position(num1-1, num2-1); + break; + case 'J': + /* clear console and move cursor to 0, 0 */ + console_clear(); + console_cursor_set_position(0, 0); + break; + case 'K': + /* clear line */ + if (num1 == 0) + console_clear_line(console_row, + console_col, + CONSOLE_COLS-1); + else if (num1 == 1) + console_clear_line(console_row, + 0, console_col); + else + console_clear_line(console_row, + 0, CONSOLE_COLS-1); + break; + case 'm': + if (num1 == 0) { /* reset swapped colors */ + if (ansi_colors_need_revert) { + console_swap_colors(); + ansi_colors_need_revert = 0; + } + } else if (num1 == 7) { /* once swap colors */ + if (!ansi_colors_need_revert) { + console_swap_colors(); + ansi_colors_need_revert = 1; + } + } + break; + } + CURSOR_SET; + } + } else { + parse_putc(c); + } +#else + parse_putc(c); +#endif +} + void video_puts(const char *s) { int count = strlen(s);

* Command can be enabled by CONFIG_CMD_CLEAR
Signed-off-by: Pali Rohár pali.rohar@gmail.com Cc: Marcel Mol marcel@mesa.nl --- common/Makefile | 1 + common/cmd_clear.c | 42 ++++++++++++++++++++++++++++++++++++++++++ include/config_cmd_all.h | 1 + 3 files changed, 44 insertions(+), 0 deletions(-) create mode 100644 common/cmd_clear.c
diff --git a/common/Makefile b/common/Makefile index 2d9ae8c..e1efd45 100644 --- a/common/Makefile +++ b/common/Makefile @@ -69,6 +69,7 @@ COBJS-$(CONFIG_CMD_BEDBUG) += bedbug.o cmd_bedbug.o COBJS-$(CONFIG_CMD_BMP) += cmd_bmp.o COBJS-$(CONFIG_CMD_BOOTLDR) += cmd_bootldr.o COBJS-$(CONFIG_CMD_CACHE) += cmd_cache.o +COBJS-$(CONFIG_CMD_CLEAR) += cmd_clear.o COBJS-$(CONFIG_CMD_CONSOLE) += cmd_console.o COBJS-$(CONFIG_CMD_CPLBINFO) += cmd_cplbinfo.o COBJS-$(CONFIG_DATAFLASH_MMC_SELECT) += cmd_dataflash_mmc_mux.o diff --git a/common/cmd_clear.c b/common/cmd_clear.c new file mode 100644 index 0000000..597611e --- /dev/null +++ b/common/cmd_clear.c @@ -0,0 +1,42 @@ +/* + * Copyright 2011 + * Marcel Mol, MESA Consulting, marcel@mesa.nl + * + * Copyright 2011 + * Pali Rohár, pali.rohar@gmail.com + * + * 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 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 + */ + +#include <common.h> +#include <command.h> + +static int do_clear(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) +{ + puts(ANSI_CLEAR_CONSOLE); + printf(ANSI_CURSOR_POSITION, 1, 1); + return 0; +} + +U_BOOT_CMD( + clear, CONFIG_SYS_MAXARGS, 1, do_clear, + "clear", + "\n" + " - clear screen and move cursor to top of screen" +); diff --git a/include/config_cmd_all.h b/include/config_cmd_all.h index 9716f9c..3f25eba 100644 --- a/include/config_cmd_all.h +++ b/include/config_cmd_all.h @@ -23,6 +23,7 @@ #define CONFIG_CMD_BSP /* Board Specific functions */ #define CONFIG_CMD_CACHE /* icache, dcache */ #define CONFIG_CMD_CDP /* Cisco Discovery Protocol */ +#define CONFIG_CMD_CLEAR /* ANSI clear screen command */ #define CONFIG_CMD_CONSOLE /* coninfo */ #define CONFIG_CMD_DATE /* support for RTC, date/time...*/ #define CONFIG_CMD_DHCP /* DHCP Support */

* If not defined CONFIG_MENUCMD do nothing
* If CONFIG_MENUKEY is 0 and was pressed any key run env "menu_cmd" * If pressed key was CONFIG_MENUKEY run env "menu_cmd" * If CONFIG_MENUKEY is not defined run env "menu_cmd" always
* CONFIG_MENUKEY working if defined CONFIG_MENUCMD and CONFIG_BOOTDELAY >= 0
Signed-off-by: Pali Rohár pali.rohar@gmail.com --- common/main.c | 34 +++++++++++++++++++++++----------- 1 files changed, 23 insertions(+), 11 deletions(-)
diff --git a/common/main.c b/common/main.c index e7b5516..503d6c4 100644 --- a/common/main.c +++ b/common/main.c @@ -82,6 +82,20 @@ int do_mdm_init = 0; extern void mdm_init(void); /* defined in board.c */ #endif
+#if defined(CONFIG_MENUKEY) && !defined(CONFIG_MENUCMD) && \ +(!defined(CONFIG_BOOTDELAY) || CONFIG_BOOTDELAY < 0) +#error CONFIG_MENUKEY defined, but not CONFIG_MENUCMD or CONFIG_BOOTDELAY >= 0 +#error define CONFIG_MENUCMD and CONFIG_BOOTDELAY too +#endif + +#ifdef CONFIG_MENUCMD +# ifdef CONFIG_MENUKEY +static int menucmd; +# else +static int menucmd = 1; +# endif +#endif + /*************************************************************************** * Watch for 'delay' seconds for autoboot stop or autoboot delay string. * returns: 0 - no key string, allow autoboot 1 - got key string, abort @@ -201,10 +215,6 @@ int abortboot(int bootdelay)
# else /* !defined(CONFIG_AUTOBOOT_KEYED) */
-#ifdef CONFIG_MENUKEY -static int menukey = 0; -#endif - #ifndef CONFIG_MENU static inline #endif @@ -241,8 +251,10 @@ int abortboot(int bootdelay) if (tstc()) { /* we got a key press */ abort = 1; /* don't auto boot */ bootdelay = 0; /* no more delay */ -# ifdef CONFIG_MENUKEY - menukey = getc(); +# if defined(CONFIG_MENUCMD) && defined(CONFIG_MENUKEY) + if (CONFIG_MENUKEY == 0 || + CONFIG_MENUKEY == getc()) + menucmd = 1; # else (void) getc(); /* consume input */ # endif @@ -292,6 +304,7 @@ int run_command2(const char *cmd, int flag)
void main_loop (void) { + char *s; #ifndef CONFIG_SYS_HUSH_PARSER static char lastcommand[CONFIG_SYS_CBSIZE] = { 0, }; int len; @@ -300,7 +313,6 @@ void main_loop (void) #endif
#if defined(CONFIG_BOOTDELAY) && (CONFIG_BOOTDELAY >= 0) - char *s; int bootdelay; #endif #ifdef CONFIG_PREBOOT @@ -405,15 +417,15 @@ void main_loop (void) disable_ctrlc(prev); /* restore Control C checking */ # endif } +#endif /* CONFIG_BOOTDELAY */
-# ifdef CONFIG_MENUKEY - if (menukey == CONFIG_MENUKEY) { +#ifdef CONFIG_MENUCMD + if (menucmd == 1) { s = getenv("menucmd"); if (s) run_command2(s, 0); } -#endif /* CONFIG_MENUKEY */ -#endif /* CONFIG_BOOTDELAY */ +#endif
/* * Main Loop for Monitor Command Processing

* if defined run env "premonitor" before Main Loop for Monitor Processing
Signed-off-by: Pali Rohár pali.rohar@gmail.com --- common/env_common.c | 3 +++ common/main.c | 4 ++++ 2 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/common/env_common.c b/common/env_common.c index 8a71096..1ef8ecc 100644 --- a/common/env_common.c +++ b/common/env_common.c @@ -92,6 +92,9 @@ const uchar default_environment[] = { #ifdef CONFIG_PREBOOT "preboot=" CONFIG_PREBOOT "\0" #endif +#ifdef CONFIG_PREMONITOR + "premonitor=" CONFIG_PREMONITOR "\0" +#endif #ifdef CONFIG_ROOTPATH "rootpath=" CONFIG_ROOTPATH "\0" #endif diff --git a/common/main.c b/common/main.c index 503d6c4..e0c262c 100644 --- a/common/main.c +++ b/common/main.c @@ -427,6 +427,10 @@ void main_loop (void) } #endif
+ s = getenv("premonitor"); + if (s) + run_command2(s, 0); + /* * Main Loop for Monitor Command Processing */

This board definition results in a u-boot.bin which can be chainloaded from NOLO in qemu or on a real N900. It does very little hardware config because NOLO has already configured the board. Only needed is enabling internal eMMC memory via twl4030 regulator which is not enabled by NOLO.
NOLO is expecting a kernel image and will treat any image it finds in onenand as such. This u-boot is intended to be flashed to the N900 like a kernel. In order to transparently boot the original kernel, it will be appended to u-boot.bin at 0x40000. NOLO will load the entire image into memory and execute u-boot, which saves the ATAGs set by NOLO. Then the bootscripts will attempt to load uImage or boot.scr from a fat or ext2 filesystem in external SD card or internal eMMC memory. If this fails or keyboard is closed the appended kernel image will be booted using the stored ATAGs (see boot order).
There is support for hardware watchdog. It is started by NOLO so u-boot must kick watchdog to prevent reboot device (but not very often, max every 2 seconds). There is also support for framebuffer display output with ANSI espace codes and the N900 HW keyboard input. USB tty works but is disabled because it prevents the current Maemo kernel from booting.
Based on previous work by: Alistair Buxton a.j.buxton@gmail.com
Default boot order:
* 0. if keyboard is closed boot automatically NOLO kernel image * 1. try boot from external SD card * 2. try boot from internal eMMC memory * 3. try boot from attached NOLO kernel image
Boot from SD or eMMC in this order:
* find boot.scr on first fat partition * find uImage on first fat parition * same order for 2. - 4. fat partition
* find boot.scr on first ext2 partition * find uImage on first ext2 parition * same order for 2. - 4. ext2 partition
Available additional commands/variables:
* run sercon - Use serial port for control * run usbcon - Use usbtty for control * run vgacon - Use framebuffer and HW keyboard for control (default) * run emmcboot - Boot from external SD card (see boot order) * run immcboot - Boot from internal eMMC memory (see boot order) * run noloboot - Boot NOLO kernel image (attached to U-Boot binary) * run scriptload - Load boot script: mmc ${mmcnum} (0 - external, 1 - internal), partition number ${mmcpart} (1 - 4), parition type ${mmctype} (fat, ext2), file name ${mmcfile} * run scriptboot - Run loaded boot script (see scriptload) * run uimageload - Load kernel image: mmc ${mmcnum} (0 - external, 1 - internal), partition number ${mmcpart} (1 - 4), parition type ${mmctype} (fat, ext2), file name ${mmcfile} * run uimageboot - Boot kernel image (see uimageload)
Signed-off-by: Pali Rohár pali.rohar@gmail.com --- board/nokia/rx51/Makefile | 44 +++++ board/nokia/rx51/rx51.c | 433 ++++++++++++++++++++++++++++++++++++++++++ board/nokia/rx51/rx51.h | 375 ++++++++++++++++++++++++++++++++++++ boards.cfg | 1 + include/configs/nokia_rx51.h | 320 +++++++++++++++++++++++++++++++ 5 files changed, 1173 insertions(+), 0 deletions(-) create mode 100644 board/nokia/rx51/Makefile create mode 100644 board/nokia/rx51/rx51.c create mode 100644 board/nokia/rx51/rx51.h create mode 100644 include/configs/nokia_rx51.h
diff --git a/board/nokia/rx51/Makefile b/board/nokia/rx51/Makefile new file mode 100644 index 0000000..018142a --- /dev/null +++ b/board/nokia/rx51/Makefile @@ -0,0 +1,44 @@ +# +# (C) Copyright 2000, 2001, 2002 +# Wolfgang Denk, DENX Software Engineering, wd@denx.de. +# +# 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 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 +# + +include $(TOPDIR)/config.mk + +LIB = $(obj)lib$(BOARD).o + +COBJS-y := $(BOARD).o + +COBJS := $(sort $(COBJS-y)) +SRCS := $(COBJS:.o=.c) +OBJS := $(addprefix $(obj),$(COBJS)) + +$(LIB): $(obj).depend $(OBJS) + $(call cmd_link_o_target, $(OBJS)) + +######################################################################### + +# defines $(obj).depend target +include $(SRCTREE)/rules.mk + +sinclude $(obj).depend + +######################################################################### diff --git a/board/nokia/rx51/rx51.c b/board/nokia/rx51/rx51.c new file mode 100644 index 0000000..c3b3d61 --- /dev/null +++ b/board/nokia/rx51/rx51.c @@ -0,0 +1,433 @@ +/* + * (C) Copyright 2011 + * Pali Rohár pali.rohar@gmail.com + * + * (C) Copyright 2010 + * Alistair Buxton a.j.buxton@gmail.com + * + * Derived from Beagle Board and 3430 SDP code: + * (C) Copyright 2004-2008 + * Texas Instruments, <www.ti.com> + * + * Author : + * Sunil Kumar sunilsaini05@gmail.com + * Shashi Ranjan shashiranjanmca05@gmail.com + * + * Richard Woodruff r-woodruff2@ti.com + * Syed Mohammed Khasim khasim@ti.com + * + * 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 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 + */ + +#include <common.h> +#include <twl4030.h> +#include <i2c.h> +#include <video_fb.h> +#include <asm/io.h> +#include <asm/bitops.h> +#include <asm/gpio.h> +#include <asm/mach-types.h> +#include <asm/arch/mux.h> +#include <asm/arch/sys_proto.h> +#include <asm/arch/mmc_host_def.h> + +#include "rx51.h" + +#define stringify(s) tostring(s) +#define tostring(s) #s + +DECLARE_GLOBAL_DATA_PTR; + +GraphicDevice gdev; + +const omap3_sysinfo sysinfo = { + DDR_STACKED, + "Nokia RX-51", + "" +}; + +/* + * Routine: save_boot_params (called after reset from start.S) + * Description: Save atag address and attached kernel address. + * Move u-boot to address CONFIG_SYS_TEXT_BASE + */ +asm( +"startaddr:\n" /* address where should be u-boot after relocation */ +" .word " stringify(CONFIG_SYS_TEXT_BASE) "\n" +"relocaddr:\n" /* address of this relocaddr section after relocation */ +" .word .\n" /* address of section (calculated at compile time) */ +".global rx51_atagaddr\n" +"rx51_atagaddr:\n" +"atagaddr:\n" /* stored atag address (r2) */ +" .word 0x0\n" +".global rx51_kernaddr\n" +"rx51_kernaddr:\n" +"kernaddr:\n" /* stored attached kernel address (u-boot + 0x40000) */ +" .word 0x80048000\n" +".global save_boot_params\n" +"save_boot_params:\n" /* function save_boot_params, called after reset */ + /* r2 - address of atag (set by NOLO) */ +" adr r0, relocaddr\n"/* r0 - address of section relocaddr */ +" ldr r1, relocaddr\n"/* r1 - address of relocaddr after relocation */ +" sub r0, r0, r1\n" /* r1 - calculated offset for relocation */ +" ldr r1, startaddr\n"/* r1 - address of u-boot after relocation */ +" add r0, r0, r1\n" /* r0 - address where is u-boot now */ + /* (address after relocation + offset) */ + +" cmp r0, r1\n" +" bne reloc\n"/* relocate if u-boot is not at correct address */ +" bx lr\n" /* else return (to reset, relocation is not needed) */ + +"reloc:\n" +" str r2, atagaddr\n" /* store atag address to memory */ +" add r2, r0, #0x40000\n" /* r2 - address of attached kernel */ +/* (u-boot address + kernel offset 0x40000) - also end address of u-boot */ +" str r2, kernaddr\n" /* store kernel address to memory */ + +"loop:\n" +" ldmia r0!, {r3 - r10}\n" /* copy from source address (r0) */ +" stmia r1!, {r3 - r10}\n" /* copy to destination address (r1) */ +" cmp r0, r2\n" +" bne loop\n" /* until end of source address (r2) */ + +" ldr r2, atagaddr\n" /* revert back address of atag to r2 */ +" ldr pc, startaddr\n" /* jump to start section */ +/* (where should be u-boot after relocation) and restart u-boot */ +); + +/* + * Routine: board_init + * Description: Early hardware init. + */ +int board_init(void) +{ + gpmc_init(); /* in SRAM or SDRAM, finish GPMC */ + /* board id for Linux */ + gd->bd->bi_arch_number = MACH_TYPE_NOKIA_RX51; + /* boot param addr */ + gd->bd->bi_boot_params = (OMAP34XX_SDRC_CS0 + 0x100); + + return 0; +} + +/* + * Routine: video_hw_init + * Description: Set up the GraphicDevice depending on sys_boot. + */ +void *video_hw_init(void) +{ + /* fill in Graphic Device */ + gdev.frameAdrs = 0x8f9c0000; + gdev.winSizeX = 800; + gdev.winSizeY = 480; + gdev.gdfBytesPP = 2; + gdev.gdfIndex = GDF_16BIT_565RGB; + memset((void *)gdev.frameAdrs, 0, 0xbb800); + return (void *) &gdev; +} + +/* + * Routine: twl4030_regulator_set_mode + * Description: Set twl4030 regulator mode over i2c powerbus. + */ +static void twl4030_regulator_set_mode(u8 id, u8 mode) +{ + u16 msg = MSG_SINGULAR(DEV_GRP_P1, id, mode); + twl4030_i2c_write_u8(TWL4030_CHIP_PM_MASTER, msg >> 8, + TWL4030_PM_MASTER_PB_WORD_MSB); + twl4030_i2c_write_u8(TWL4030_CHIP_PM_MASTER, msg & 0xff, + TWL4030_PM_MASTER_PB_WORD_LSB); +} + +/* + * Routine: misc_init_r + * Description: Configure board specific parts. + */ +int misc_init_r(void) +{ + unsigned int slide_sw; + char buf[12]; + + sprintf(buf, "%#x", rx51_kernaddr); + setenv("init_kernaddr", buf); + sprintf(buf, "%#x", rx51_atagaddr); + setenv("init_atagaddr", buf); + + /* initialize twl4030 power managment */ + twl4030_power_init(); + + /* set VSIM to 1.8V */ + twl4030_pmrecv_vsel_cfg(TWL4030_PM_RECEIVER_VSIM_DEDICATED, + TWL4030_PM_RECEIVER_VSIM_VSEL_18, + TWL4030_PM_RECEIVER_VSIM_DEV_GRP, + TWL4030_PM_RECEIVER_DEV_GRP_P1); + + /* enable I2C access to powerbus (needed for twl4030 regulator) */ + twl4030_i2c_write_u8(TWL4030_CHIP_PM_MASTER, 0x02, + TWL4030_PM_MASTER_PB_CFG); + + /* set VAUX3, VSIM and VMMC1 state to active - enable eMMC memory */ + twl4030_regulator_set_mode(RES_VAUX3, RES_STATE_ACTIVE); + twl4030_regulator_set_mode(RES_VSIM, RES_STATE_ACTIVE); + twl4030_regulator_set_mode(RES_VMMC1, RES_STATE_ACTIVE); + + /* set environment variable slide_sw if keyboard slide is open/close */ + gpio_direction_input(71); + slide_sw = gpio_get_value(71); + gpio_free(71); + setenv("slide_sw", slide_sw ? "close" : "open"); + + dieid_num_r(); + + return 0; +} + +/* + * Routine: set_muxconf_regs + * Description: Setting up the configuration Mux registers specific to the + * hardware. Many pins need to be moved from protect to primary + * mode. + */ +void set_muxconf_regs(void) +{ + MUX_RX51(); +} + +static unsigned long int twl_wd_time; /* last time of watchdog reset */ +static unsigned long int twl_i2c_lock; + +/* + * Routine: hw_watchdog_reset + * Description: Reset timeout of twl4030 watchdog. + */ +void hw_watchdog_reset(void) +{ + u8 timeout = 0; + + /* do not reset watchdog too often - max every 4s */ + if (get_timer(twl_wd_time) < 4 * CONFIG_SYS_HZ) + return; + + /* localy lock twl4030 i2c bus */ + if (test_and_set_bit(0, &twl_i2c_lock)) + return; + + /* read actual watchdog timeout */ + twl4030_i2c_read_u8(TWL4030_CHIP_PM_RECEIVER, &timeout, + TWL4030_PM_RECEIVER_WATCHDOG_CFG); + + /* timeout 0 means watchdog is disabled */ + /* reset watchdog timeout to 31s (maximum) */ + if (timeout != 0) + twl4030_i2c_write_u8(TWL4030_CHIP_PM_RECEIVER, 31, + TWL4030_PM_RECEIVER_WATCHDOG_CFG); + + /* store last watchdog reset time */ + twl_wd_time = get_timer(0); + + /* localy unlock twl4030 i2c bus */ + test_and_clear_bit(0, &twl_i2c_lock); +} + +/* + * TWL4030 keypad handler for cfb_console + */ + +static const char keymap[] = { + /* normal */ + 'q', 'o', 'p', ',', '\b', 0, 'a', 's', + 'w', 'd', 'f', 'g', 'h', 'j', 'k', 'l', + 'e', '.', 0, '\r', 0, 'z', 'x', 'c', + 'r', 'v', 'b', 'n', 'm', ' ', ' ', 0, + 't', 0, 0, 0, 0, 0, 0, 0, + 'y', 0, 0, 0, 0, 0, 0, 0, + 'u', 0, 0, 0, 0, 0, 0, 0, + 'i', 5, 6, 0, 0, 0, 0, 0, + /* fn */ + '1', '9', '0', '=', '\b', 0, '*', '+', + '2', '#', '-', '_', '(', ')', '&', '!', + '3', '?', '^', '\r', 0, 156, '$', 238, + '4', '/', '\', '"', ''', '@', 0, '<', + '5', '|', '>', 0, 0, 0, 0, 0, + '6', 0, 0, 0, 0, 0, 0, 0, + '7', 0, 0, 0, 0, 0, 0, 0, + '8', 16, 17, 0, 0, 0, 0, 0, +}; + +static u8 keys[8]; +static u8 old_keys[8] = {0, 0, 0, 0, 0, 0, 0, 0}; +#define KEYBUF_SIZE 32 +static u8 keybuf[KEYBUF_SIZE]; +static u8 keybuf_head; +static u8 keybuf_tail; + +/* + * Routine: rx51_kp_init + * Description: Initialize HW keyboard. + */ +int rx51_kp_init(void) +{ + int ret = 0; + u8 ctrl; + ret = twl4030_i2c_read_u8(TWL4030_CHIP_KEYPAD, &ctrl, + TWL4030_KEYPAD_KEYP_CTRL_REG); + + if (!ret) { + /* turn on keyboard and use hardware scanning */ + ctrl |= TWL4030_KEYPAD_CTRL_KBD_ON; + ctrl |= TWL4030_KEYPAD_CTRL_SOFT_NRST; + ctrl |= TWL4030_KEYPAD_CTRL_SOFTMODEN; + ret |= twl4030_i2c_write_u8(TWL4030_CHIP_KEYPAD, ctrl, + TWL4030_KEYPAD_KEYP_CTRL_REG); + /* enable key event status */ + ret |= twl4030_i2c_write_u8(TWL4030_CHIP_KEYPAD, 0xfe, + TWL4030_KEYPAD_KEYP_IMR1); + /* enable interrupt generation on rising and falling */ + /* this is a workaround for qemu twl4030 emulation */ + ret |= twl4030_i2c_write_u8(TWL4030_CHIP_KEYPAD, 0x57, + TWL4030_KEYPAD_KEYP_EDR); + /* enable ISR clear on read */ + ret |= twl4030_i2c_write_u8(TWL4030_CHIP_KEYPAD, 0x05, + TWL4030_KEYPAD_KEYP_SIH_CTRL); + } + return ret; +} + +static void rx51_kp_fill(u8 k, u8 mods) +{ + if (!(mods & 2) && (k == 18 || k == 31 || k == 33 || k == 34)) { + /* cursor keys, without fn */ + keybuf[keybuf_tail++] = '\e'; + keybuf_tail %= KEYBUF_SIZE; + keybuf[keybuf_tail++] = '['; + keybuf_tail %= KEYBUF_SIZE; + keybuf[keybuf_tail++] = '1'; + if (k == 18) /* up */ + keybuf[keybuf_tail++] = 'A'; + else if (k == 31) /* left */ + keybuf[keybuf_tail++] = 'D'; + else if (k == 33) /* down */ + keybuf[keybuf_tail++] = 'B'; + else if (k == 34) /* right */ + keybuf[keybuf_tail++] = 'C'; + keybuf_tail %= KEYBUF_SIZE; + return; + } + + if (mods & 2) { /* fn */ + k = keymap[k+64]; + } else { + k = keymap[k]; + if (mods & 1) { /* ctrl */ + if (k >= 'a' && k <= 'z') + k -= 'a' - 1; + } + if (mods & 4) { /* shift */ + if (k >= 'a' && k <= 'z') + k += 'A' - 'a'; + else if (k == '.') + k = ':'; + else if (k == ',') + k = ';'; + } + } + keybuf[keybuf_tail++] = k; + keybuf_tail %= KEYBUF_SIZE; +} + +/* + * Routine: rx51_kp_tstc + * Description: Test if key was pressed (from buffer). + */ +int rx51_kp_tstc(void) +{ + u8 c, r, dk, i; + u8 intr; + u8 mods; + + /* localy lock twl4030 i2c bus */ + if (test_and_set_bit(0, &twl_i2c_lock)) + return 0; + + /* twl4030 remembers up to 2 events */ + for (i = 0; i < 2; i++) { + + /* check interrupt register for events */ + twl4030_i2c_read_u8(TWL4030_CHIP_KEYPAD, &intr, + TWL4030_KEYPAD_KEYP_ISR1+(2*i)); + + if (intr&1) { /* got an event */ + + /* read the key state */ + i2c_read(TWL4030_CHIP_KEYPAD, + TWL4030_KEYPAD_FULL_CODE_7_0, 1, keys, 8); + + /* cut out modifier keys from the keystate */ + mods = keys[4] >> 4; + keys[4] &= 0x0f; + + for (c = 0; c < 8; c++) { + + /* get newly pressed keys only */ + dk = ((keys[c] ^ old_keys[c])&keys[c]); + old_keys[c] = keys[c]; + + /* fill the keybuf */ + for (r = 0; r < 8; r++) { + if (dk&1) + rx51_kp_fill((c*8)+r, mods); + dk = dk >> 1; + } + + } + + } + + } + + /* localy unlock twl4030 i2c bus */ + test_and_clear_bit(0, &twl_i2c_lock); + + return (KEYBUF_SIZE + keybuf_tail - keybuf_head)%KEYBUF_SIZE; +} + +/* + * Routine: rx51_kp_getc + * Description: Get last pressed key (from buffer). + */ +int rx51_kp_getc(void) +{ + keybuf_head %= KEYBUF_SIZE; + while (!rx51_kp_tstc()) { + udelay(1); + hw_watchdog_reset(); + } + return keybuf[keybuf_head++]; +} + +/* + * Routine: board_mmc_init + * Description: Initialize mmc devices. + */ +int board_mmc_init(bd_t *bis) +{ + omap_mmc_init(0); + omap_mmc_init(1); + return 0; +} diff --git a/board/nokia/rx51/rx51.h b/board/nokia/rx51/rx51.h new file mode 100644 index 0000000..887988f --- /dev/null +++ b/board/nokia/rx51/rx51.h @@ -0,0 +1,375 @@ +/* + * (C) Copyright 2008 + * Dirk Behme dirk.behme@gmail.com + * + * 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 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 _RX51_H_ +#define _RX51_H_ + +extern u32 rx51_atagaddr; /* atag address */ +extern u32 rx51_kernaddr; /* attached kernel address */ + +/* + * IEN - Input Enable + * IDIS - Input Disable + * PTD - Pull type Down + * PTU - Pull type Up + * DIS - Pull type selection is inactive + * EN - Pull type selection is active + * M0 - Mode 0 + * The commented string gives the final mux configuration for that pin + */ +#define MUX_RX51() \ + /*SDRC*/\ + MUX_VAL(CP(SDRC_D0), (IEN | PTD | DIS | M0)) /*SDRC_D0*/\ + MUX_VAL(CP(SDRC_D1), (IEN | PTD | DIS | M0)) /*SDRC_D1*/\ + MUX_VAL(CP(SDRC_D2), (IEN | PTD | DIS | M0)) /*SDRC_D2*/\ + MUX_VAL(CP(SDRC_D3), (IEN | PTD | DIS | M0)) /*SDRC_D3*/\ + MUX_VAL(CP(SDRC_D4), (IEN | PTD | DIS | M0)) /*SDRC_D4*/\ + MUX_VAL(CP(SDRC_D5), (IEN | PTD | DIS | M0)) /*SDRC_D5*/\ + MUX_VAL(CP(SDRC_D6), (IEN | PTD | DIS | M0)) /*SDRC_D6*/\ + MUX_VAL(CP(SDRC_D7), (IEN | PTD | DIS | M0)) /*SDRC_D7*/\ + MUX_VAL(CP(SDRC_D8), (IEN | PTD | DIS | M0)) /*SDRC_D8*/\ + MUX_VAL(CP(SDRC_D9), (IEN | PTD | DIS | M0)) /*SDRC_D9*/\ + MUX_VAL(CP(SDRC_D10), (IEN | PTD | DIS | M0)) /*SDRC_D10*/\ + MUX_VAL(CP(SDRC_D11), (IEN | PTD | DIS | M0)) /*SDRC_D11*/\ + MUX_VAL(CP(SDRC_D12), (IEN | PTD | DIS | M0)) /*SDRC_D12*/\ + MUX_VAL(CP(SDRC_D13), (IEN | PTD | DIS | M0)) /*SDRC_D13*/\ + MUX_VAL(CP(SDRC_D14), (IEN | PTD | DIS | M0)) /*SDRC_D14*/\ + MUX_VAL(CP(SDRC_D15), (IEN | PTD | DIS | M0)) /*SDRC_D15*/\ + MUX_VAL(CP(SDRC_D16), (IEN | PTD | DIS | M0)) /*SDRC_D16*/\ + MUX_VAL(CP(SDRC_D17), (IEN | PTD | DIS | M0)) /*SDRC_D17*/\ + MUX_VAL(CP(SDRC_D18), (IEN | PTD | DIS | M0)) /*SDRC_D18*/\ + MUX_VAL(CP(SDRC_D19), (IEN | PTD | DIS | M0)) /*SDRC_D19*/\ + MUX_VAL(CP(SDRC_D20), (IEN | PTD | DIS | M0)) /*SDRC_D20*/\ + MUX_VAL(CP(SDRC_D21), (IEN | PTD | DIS | M0)) /*SDRC_D21*/\ + MUX_VAL(CP(SDRC_D22), (IEN | PTD | DIS | M0)) /*SDRC_D22*/\ + MUX_VAL(CP(SDRC_D23), (IEN | PTD | DIS | M0)) /*SDRC_D23*/\ + MUX_VAL(CP(SDRC_D24), (IEN | PTD | DIS | M0)) /*SDRC_D24*/\ + MUX_VAL(CP(SDRC_D25), (IEN | PTD | DIS | M0)) /*SDRC_D25*/\ + MUX_VAL(CP(SDRC_D26), (IEN | PTD | DIS | M0)) /*SDRC_D26*/\ + MUX_VAL(CP(SDRC_D27), (IEN | PTD | DIS | M0)) /*SDRC_D27*/\ + MUX_VAL(CP(SDRC_D28), (IEN | PTD | DIS | M0)) /*SDRC_D28*/\ + MUX_VAL(CP(SDRC_D29), (IEN | PTD | DIS | M0)) /*SDRC_D29*/\ + MUX_VAL(CP(SDRC_D30), (IEN | PTD | DIS | M0)) /*SDRC_D30*/\ + MUX_VAL(CP(SDRC_D31), (IEN | PTD | DIS | M0)) /*SDRC_D31*/\ + MUX_VAL(CP(SDRC_CLK), (IEN | PTD | DIS | M0)) /*SDRC_CLK*/\ + MUX_VAL(CP(SDRC_DQS0), (IEN | PTD | DIS | M0)) /*SDRC_DQS0*/\ + MUX_VAL(CP(SDRC_DQS1), (IEN | PTD | DIS | M0)) /*SDRC_DQS1*/\ + MUX_VAL(CP(SDRC_DQS2), (IEN | PTD | DIS | M0)) /*SDRC_DQS2*/\ + MUX_VAL(CP(SDRC_DQS3), (IEN | PTD | DIS | M0)) /*SDRC_DQS3*/\ + /*GPMC*/\ + MUX_VAL(CP(GPMC_A1), (IDIS | PTD | DIS | M0)) /*GPMC_A1*/\ + MUX_VAL(CP(GPMC_A2), (IDIS | PTD | DIS | M0)) /*GPMC_A2*/\ + MUX_VAL(CP(GPMC_A3), (IDIS | PTD | DIS | M0)) /*GPMC_A3*/\ + MUX_VAL(CP(GPMC_A4), (IDIS | PTD | DIS | M0)) /*GPMC_A4*/\ + MUX_VAL(CP(GPMC_A5), (IDIS | PTD | DIS | M0)) /*GPMC_A5*/\ + MUX_VAL(CP(GPMC_A6), (IDIS | PTD | DIS | M0)) /*GPMC_A6*/\ + MUX_VAL(CP(GPMC_A7), (IDIS | PTD | DIS | M0)) /*GPMC_A7*/\ + MUX_VAL(CP(GPMC_A8), (IDIS | PTD | DIS | M0)) /*GPMC_A8*/\ + MUX_VAL(CP(GPMC_A9), (IDIS | PTD | DIS | M0)) /*GPMC_A9*/\ + MUX_VAL(CP(GPMC_A10), (IDIS | PTD | DIS | M0)) /*GPMC_A10*/\ + MUX_VAL(CP(GPMC_D0), (IEN | PTD | DIS | M0)) /*GPMC_D0*/\ + MUX_VAL(CP(GPMC_D1), (IEN | PTD | DIS | M0)) /*GPMC_D1*/\ + MUX_VAL(CP(GPMC_D2), (IEN | PTD | DIS | M0)) /*GPMC_D2*/\ + MUX_VAL(CP(GPMC_D3), (IEN | PTD | DIS | M0)) /*GPMC_D3*/\ + MUX_VAL(CP(GPMC_D4), (IEN | PTD | DIS | M0)) /*GPMC_D4*/\ + MUX_VAL(CP(GPMC_D5), (IEN | PTD | DIS | M0)) /*GPMC_D5*/\ + MUX_VAL(CP(GPMC_D6), (IEN | PTD | DIS | M0)) /*GPMC_D6*/\ + MUX_VAL(CP(GPMC_D7), (IEN | PTD | DIS | M0)) /*GPMC_D7*/\ + MUX_VAL(CP(GPMC_D8), (IEN | PTD | DIS | M0)) /*GPMC_D8*/\ + MUX_VAL(CP(GPMC_D9), (IEN | PTD | DIS | M0)) /*GPMC_D9*/\ + MUX_VAL(CP(GPMC_D10), (IEN | PTD | DIS | M0)) /*GPMC_D10*/\ + MUX_VAL(CP(GPMC_D11), (IEN | PTD | DIS | M0)) /*GPMC_D11*/\ + MUX_VAL(CP(GPMC_D12), (IEN | PTD | DIS | M0)) /*GPMC_D12*/\ + MUX_VAL(CP(GPMC_D13), (IEN | PTD | DIS | M0)) /*GPMC_D13*/\ + MUX_VAL(CP(GPMC_D14), (IEN | PTD | DIS | M0)) /*GPMC_D14*/\ + MUX_VAL(CP(GPMC_D15), (IEN | PTD | DIS | M0)) /*GPMC_D15*/\ + MUX_VAL(CP(GPMC_NCS0), (IDIS | PTU | EN | M0)) /*GPMC_nCS0*/\ + MUX_VAL(CP(GPMC_NCS1), (IDIS | PTU | EN | M0)) /*GPMC_nCS1*/\ + MUX_VAL(CP(GPMC_NCS2), (IDIS | PTU | EN | M0)) /*GPMC_nCS2*/\ + MUX_VAL(CP(GPMC_NCS3), (IDIS | PTU | EN | M0)) /*GPMC_nCS3*/\ + MUX_VAL(CP(GPMC_NCS4), (IDIS | PTU | EN | M0)) /*GPMC_nCS4*/\ + MUX_VAL(CP(GPMC_NCS5), (IDIS | PTD | DIS | M0)) /*GPMC_nCS5*/\ + MUX_VAL(CP(GPMC_NCS6), (IEN | PTD | DIS | M1)) /*nDMA_REQ2*/\ + MUX_VAL(CP(GPMC_NCS7), (IEN | PTU | EN | M1)) /*nDMA_REQ3*/\ + MUX_VAL(CP(GPMC_NBE1), (IEN | PTD | DIS | M0)) /*GPMC_nBE1*/\ + MUX_VAL(CP(GPMC_WAIT2), (IEN | PTU | EN | M0)) /*GPMC_WAIT2*/\ + MUX_VAL(CP(GPMC_WAIT3), (IEN | PTU | EN | M0)) /*GPMC_WAIT3*/\ + MUX_VAL(CP(GPMC_CLK), (IDIS | PTD | DIS | M0)) /*GPMC_CLK*/\ + MUX_VAL(CP(GPMC_NADV_ALE), (IDIS | PTD | DIS | M0)) /*GPMC_nADV*/\ + MUX_VAL(CP(GPMC_NOE), (IDIS | PTD | DIS | M0)) /*GPMC_nOE*/\ + MUX_VAL(CP(GPMC_NWE), (IDIS | PTD | DIS | M0)) /*GPMC_nWE*/\ + MUX_VAL(CP(GPMC_NBE0_CLE), (IDIS | PTD | DIS | M0)) /*GPMC_nBE0*/\ + MUX_VAL(CP(GPMC_NWP), (IEN | PTD | DIS | M0)) /*GPMC_nWP*/\ + MUX_VAL(CP(GPMC_WAIT0), (IEN | PTU | EN | M0)) /*GPMC_WAIT0*/\ + MUX_VAL(CP(GPMC_WAIT1), (IEN | PTU | EN | M0)) /*GPMC_WAIT1*/\ + /*DSS*/\ + MUX_VAL(CP(DSS_PCLK), (IDIS | PTD | DIS | M0)) /*DSS_PCLK*/\ + MUX_VAL(CP(DSS_HSYNC), (IDIS | PTD | DIS | M0)) /*DSS_HSYNC*/\ + MUX_VAL(CP(DSS_VSYNC), (IDIS | PTD | DIS | M0)) /*DSS_VSYNC*/\ + MUX_VAL(CP(DSS_ACBIAS), (IDIS | PTD | DIS | M0)) /*DSS_ACBIAS*/\ + MUX_VAL(CP(DSS_DATA0), (IDIS | PTD | DIS | M0)) /*DSS_DATA0*/\ + MUX_VAL(CP(DSS_DATA1), (IDIS | PTD | DIS | M0)) /*DSS_DATA1*/\ + MUX_VAL(CP(DSS_DATA2), (IDIS | PTD | DIS | M0)) /*DSS_DATA2*/\ + MUX_VAL(CP(DSS_DATA3), (IDIS | PTD | DIS | M0)) /*DSS_DATA3*/\ + MUX_VAL(CP(DSS_DATA4), (IDIS | PTD | DIS | M0)) /*DSS_DATA4*/\ + MUX_VAL(CP(DSS_DATA5), (IDIS | PTD | DIS | M0)) /*DSS_DATA5*/\ + MUX_VAL(CP(DSS_DATA6), (IDIS | PTD | DIS | M0)) /*DSS_DATA6*/\ + MUX_VAL(CP(DSS_DATA7), (IDIS | PTD | DIS | M0)) /*DSS_DATA7*/\ + MUX_VAL(CP(DSS_DATA8), (IDIS | PTD | DIS | M0)) /*DSS_DATA8*/\ + MUX_VAL(CP(DSS_DATA9), (IDIS | PTD | DIS | M0)) /*DSS_DATA9*/\ + MUX_VAL(CP(DSS_DATA10), (IDIS | PTD | DIS | M0)) /*DSS_DATA10*/\ + MUX_VAL(CP(DSS_DATA11), (IDIS | PTD | DIS | M0)) /*DSS_DATA11*/\ + MUX_VAL(CP(DSS_DATA12), (IDIS | PTD | DIS | M0)) /*DSS_DATA12*/\ + MUX_VAL(CP(DSS_DATA13), (IDIS | PTD | DIS | M0)) /*DSS_DATA13*/\ + MUX_VAL(CP(DSS_DATA14), (IDIS | PTD | DIS | M0)) /*DSS_DATA14*/\ + MUX_VAL(CP(DSS_DATA15), (IDIS | PTD | DIS | M0)) /*DSS_DATA15*/\ + MUX_VAL(CP(DSS_DATA16), (IDIS | PTD | DIS | M0)) /*DSS_DATA16*/\ + MUX_VAL(CP(DSS_DATA17), (IDIS | PTD | DIS | M0)) /*DSS_DATA17*/\ + MUX_VAL(CP(DSS_DATA18), (IDIS | PTD | DIS | M0)) /*DSS_DATA18*/\ + MUX_VAL(CP(DSS_DATA19), (IDIS | PTD | DIS | M0)) /*DSS_DATA19*/\ + MUX_VAL(CP(DSS_DATA20), (IDIS | PTD | DIS | M0)) /*DSS_DATA20*/\ + MUX_VAL(CP(DSS_DATA21), (IDIS | PTD | DIS | M0)) /*DSS_DATA21*/\ + MUX_VAL(CP(DSS_DATA22), (IDIS | PTD | DIS | M0)) /*DSS_DATA22*/\ + MUX_VAL(CP(DSS_DATA23), (IDIS | PTD | DIS | M0)) /*DSS_DATA23*/\ + /*CAMERA*/\ + MUX_VAL(CP(CAM_HS), (IEN | PTU | EN | M0)) /*CAM_HS */\ + MUX_VAL(CP(CAM_VS), (IEN | PTU | EN | M0)) /*CAM_VS */\ + MUX_VAL(CP(CAM_XCLKA), (IDIS | PTD | DIS | M0)) /*CAM_XCLKA*/\ + MUX_VAL(CP(CAM_PCLK), (IEN | PTU | EN | M0)) /*CAM_PCLK*/\ + MUX_VAL(CP(CAM_FLD), (IDIS | PTD | DIS | M4)) /*GPIO_98*/\ + MUX_VAL(CP(CAM_D0), (IEN | PTD | DIS | M0)) /*CAM_D0*/\ + MUX_VAL(CP(CAM_D1), (IEN | PTD | DIS | M0)) /*CAM_D1*/\ + MUX_VAL(CP(CAM_D2), (IEN | PTD | DIS | M0)) /*CAM_D2*/\ + MUX_VAL(CP(CAM_D3), (IEN | PTD | DIS | M0)) /*CAM_D3*/\ + MUX_VAL(CP(CAM_D4), (IEN | PTD | DIS | M0)) /*CAM_D4*/\ + MUX_VAL(CP(CAM_D5), (IEN | PTD | DIS | M0)) /*CAM_D5*/\ + MUX_VAL(CP(CAM_D6), (IEN | PTD | DIS | M0)) /*CAM_D6*/\ + MUX_VAL(CP(CAM_D7), (IEN | PTD | DIS | M0)) /*CAM_D7*/\ + MUX_VAL(CP(CAM_D8), (IEN | PTD | DIS | M0)) /*CAM_D8*/\ + MUX_VAL(CP(CAM_D9), (IEN | PTD | DIS | M0)) /*CAM_D9*/\ + MUX_VAL(CP(CAM_D10), (IEN | PTD | DIS | M0)) /*CAM_D10*/\ + MUX_VAL(CP(CAM_D11), (IEN | PTD | DIS | M0)) /*CAM_D11*/\ + MUX_VAL(CP(CAM_XCLKB), (IDIS | PTD | DIS | M0)) /*CAM_XCLKB*/\ + MUX_VAL(CP(CAM_WEN), (IEN | PTD | DIS | M4)) /*GPIO_167*/\ + MUX_VAL(CP(CAM_STROBE), (IDIS | PTD | DIS | M0)) /*CAM_STROBE*/\ + MUX_VAL(CP(CSI2_DX0), (IEN | PTD | DIS | M0)) /*CSI2_DX0*/\ + MUX_VAL(CP(CSI2_DY0), (IEN | PTD | DIS | M0)) /*CSI2_DY0*/\ + MUX_VAL(CP(CSI2_DX1), (IEN | PTD | DIS | M0)) /*CSI2_DX1*/\ + MUX_VAL(CP(CSI2_DY1), (IEN | PTD | DIS | M0)) /*CSI2_DY1*/\ + /*Audio Interface */\ + MUX_VAL(CP(MCBSP2_FSX), (IEN | PTD | DIS | M0)) /*McBSP2_FSX*/\ + MUX_VAL(CP(MCBSP2_CLKX), (IEN | PTD | DIS | M0)) /*McBSP2_CLK*/\ + MUX_VAL(CP(MCBSP2_DR), (IEN | PTD | DIS | M0)) /*McBSP2_DR*/\ + MUX_VAL(CP(MCBSP2_DX), (IDIS | PTD | DIS | M0)) /*McBSP2_DX*/\ + /*Expansion card */\ + MUX_VAL(CP(MMC1_CLK), (IDIS | PTU | EN | M0)) /*MMC1_CLK*/\ + MUX_VAL(CP(MMC1_CMD), (IEN | PTU | EN | M0)) /*MMC1_CMD*/\ + MUX_VAL(CP(MMC1_DAT0), (IEN | PTU | EN | M0)) /*MMC1_DAT0*/\ + MUX_VAL(CP(MMC1_DAT1), (IEN | PTU | EN | M0)) /*MMC1_DAT1*/\ + MUX_VAL(CP(MMC1_DAT2), (IEN | PTU | EN | M0)) /*MMC1_DAT2*/\ + MUX_VAL(CP(MMC1_DAT3), (IEN | PTU | EN | M0)) /*MMC1_DAT3*/\ + MUX_VAL(CP(MMC1_DAT4), (IEN | PTU | EN | M0)) /*MMC1_DAT4*/\ + MUX_VAL(CP(MMC1_DAT5), (IEN | PTU | EN | M0)) /*MMC1_DAT5*/\ + MUX_VAL(CP(MMC1_DAT6), (IEN | PTU | EN | M0)) /*MMC1_DAT6*/\ + MUX_VAL(CP(MMC1_DAT7), (IEN | PTU | EN | M0)) /*MMC1_DAT7*/\ + /*Wireless LAN */\ + MUX_VAL(CP(MMC2_CLK), (IEN | PTU | EN | M4)) /*GPIO_130*/\ + MUX_VAL(CP(MMC2_CMD), (IEN | PTU | EN | M4)) /*GPIO_131*/\ + MUX_VAL(CP(MMC2_DAT0), (IEN | PTU | EN | M4)) /*GPIO_132*/\ + MUX_VAL(CP(MMC2_DAT1), (IEN | PTU | EN | M4)) /*GPIO_133*/\ + MUX_VAL(CP(MMC2_DAT2), (IEN | PTU | EN | M4)) /*GPIO_134*/\ + MUX_VAL(CP(MMC2_DAT3), (IEN | PTU | EN | M4)) /*GPIO_135*/\ + MUX_VAL(CP(MMC2_DAT4), (IEN | PTU | EN | M4)) /*GPIO_136*/\ + MUX_VAL(CP(MMC2_DAT5), (IEN | PTU | EN | M4)) /*GPIO_137*/\ + MUX_VAL(CP(MMC2_DAT6), (IEN | PTU | EN | M4)) /*GPIO_138*/\ + MUX_VAL(CP(MMC2_DAT7), (IEN | PTU | EN | M4)) /*GPIO_139*/\ + /*Bluetooth*/\ + MUX_VAL(CP(MCBSP3_DX), (IEN | PTD | DIS | M1)) /*UART2_CTS*/\ + MUX_VAL(CP(MCBSP3_DR), (IDIS | PTD | DIS | M1)) /*UART2_RTS*/\ + MUX_VAL(CP(MCBSP3_CLKX), (IDIS | PTD | DIS | M1)) /*UART2_TX*/\ + MUX_VAL(CP(MCBSP3_FSX), (IEN | PTD | DIS | M1)) /*UART2_RX*/\ + MUX_VAL(CP(UART2_CTS), (IEN | PTD | DIS | M4)) /*GPIO_144*/\ + MUX_VAL(CP(UART2_RTS), (IEN | PTD | DIS | M4)) /*GPIO_145*/\ + MUX_VAL(CP(UART2_TX), (IEN | PTD | DIS | M4)) /*GPIO_146*/\ + MUX_VAL(CP(UART2_RX), (IEN | PTD | DIS | M4)) /*GPIO_147*/\ + /*Modem Interface */\ + MUX_VAL(CP(UART1_TX), (IDIS | PTD | DIS | M0)) /*UART1_TX*/\ + MUX_VAL(CP(UART1_RTS), (IDIS | PTD | DIS | M4)) /*GPIO_149*/ \ + MUX_VAL(CP(UART1_CTS), (IDIS | PTD | DIS | M4)) /*GPIO_150*/ \ + MUX_VAL(CP(UART1_RX), (IEN | PTD | DIS | M0)) /*UART1_RX*/\ + MUX_VAL(CP(MCBSP4_CLKX), (IEN | PTD | DIS | M1)) /*SSI1_DAT*/\ + MUX_VAL(CP(MCBSP4_DR), (IEN | PTD | DIS | M1)) /*SSI1_FLAG*/\ + MUX_VAL(CP(MCBSP4_DX), (IEN | PTD | DIS | M1)) /*SSI1_RDY*/\ + MUX_VAL(CP(MCBSP4_FSX), (IEN | PTD | DIS | M1)) /*SSI1_WAKE*/\ + MUX_VAL(CP(MCBSP1_CLKR), (IDIS | PTD | DIS | M4)) /*GPIO_156*/\ + MUX_VAL(CP(MCBSP1_FSR), (IDIS | PTU | EN | M4)) /*GPIO_157*/\ + MUX_VAL(CP(MCBSP1_DX), (IDIS | PTD | DIS | M4)) /*GPIO_158*/\ + MUX_VAL(CP(MCBSP1_DR), (IDIS | PTD | DIS | M4)) /*GPIO_159*/\ + MUX_VAL(CP(MCBSP_CLKS), (IEN | PTU | DIS | M0)) /*McBSP_CLKS*/\ + MUX_VAL(CP(MCBSP1_FSX), (IDIS | PTD | DIS | M4)) /*GPIO_161*/\ + MUX_VAL(CP(MCBSP1_CLKX), (IDIS | PTD | DIS | M4)) /*GPIO_162*/\ + /*Serial Interface*/\ + MUX_VAL(CP(UART3_CTS_RCTX), (IEN | PTD | EN | M0)) /*UART3_CTS*/\ + MUX_VAL(CP(UART3_RTS_SD), (IDIS | PTD | DIS | M0)) /*UART3_RTS*/\ + MUX_VAL(CP(UART3_RX_IRRX), (IEN | PTD | DIS | M0)) /*UART3_RX*/\ + MUX_VAL(CP(UART3_TX_IRTX), (IDIS | PTD | DIS | M0)) /*UART3_TX*/\ + MUX_VAL(CP(HSUSB0_CLK), (IEN | PTD | DIS | M0)) /*HSUSB0_CLK*/\ + MUX_VAL(CP(HSUSB0_STP), (IDIS | PTU | EN | M0)) /*HSUSB0_STP*/\ + MUX_VAL(CP(HSUSB0_DIR), (IEN | PTD | DIS | M0)) /*HSUSB0_DIR*/\ + MUX_VAL(CP(HSUSB0_NXT), (IEN | PTD | DIS | M0)) /*HSUSB0_NXT*/\ + MUX_VAL(CP(HSUSB0_DATA0), (IEN | PTD | DIS | M0)) /*HSUSB0_DA0*/\ + MUX_VAL(CP(HSUSB0_DATA1), (IEN | PTD | DIS | M0)) /*HSUSB0_DA1*/\ + MUX_VAL(CP(HSUSB0_DATA2), (IEN | PTD | DIS | M0)) /*HSUSB0_DA2*/\ + MUX_VAL(CP(HSUSB0_DATA3), (IEN | PTD | DIS | M0)) /*HSUSB0_DA3*/\ + MUX_VAL(CP(HSUSB0_DATA4), (IEN | PTD | DIS | M0)) /*HSUSB0_DA4*/\ + MUX_VAL(CP(HSUSB0_DATA5), (IEN | PTD | DIS | M0)) /*HSUSB0_DA5*/\ + MUX_VAL(CP(HSUSB0_DATA6), (IEN | PTD | DIS | M0)) /*HSUSB0_DA6*/\ + MUX_VAL(CP(HSUSB0_DATA7), (IEN | PTD | DIS | M0)) /*HSUSB0_DA7*/\ + MUX_VAL(CP(I2C1_SCL), (IEN | PTU | EN | M0)) /*I2C1_SCL*/\ + MUX_VAL(CP(I2C1_SDA), (IEN | PTU | EN | M0)) /*I2C1_SDA*/\ + MUX_VAL(CP(I2C2_SCL), (IEN | PTU | EN | M4)) /*GPIO_168*/\ + MUX_VAL(CP(I2C2_SDA), (IEN | PTU | EN | M4)) /*GPIO_183*/\ + MUX_VAL(CP(I2C3_SCL), (IEN | PTU | EN | M0)) /*I2C3_SCL*/\ + MUX_VAL(CP(I2C3_SDA), (IEN | PTU | EN | M0)) /*I2C3_SDA*/\ + MUX_VAL(CP(I2C4_SCL), (IEN | PTU | EN | M0)) /*I2C4_SCL*/\ + MUX_VAL(CP(I2C4_SDA), (IEN | PTU | EN | M0)) /*I2C4_SDA*/\ + MUX_VAL(CP(HDQ_SIO), (IDIS | PTU | EN | M4)) /*GPIO_170*/\ + MUX_VAL(CP(MCSPI1_CLK), (IEN | PTU | EN | M4)) /*GPIO_171*/\ + MUX_VAL(CP(MCSPI1_SIMO), (IEN | PTU | EN | M4)) /*GPIO_172*/\ + MUX_VAL(CP(MCSPI1_SOMI), (IEN | PTD | DIS | M0)) /*McSPI1_SOM*/\ + MUX_VAL(CP(MCSPI1_CS0), (IEN | PTD | EN | M0)) /*McSPI1_CS0*/\ + MUX_VAL(CP(MCSPI1_CS1), (IDIS | PTD | EN | M0)) /*McSPI1_CS1*/\ + MUX_VAL(CP(MCSPI1_CS2), (IDIS | PTD | DIS | M4)) /*GPIO_176*/\ + /* USB EHCI (port 2) */\ + MUX_VAL(CP(MCSPI1_CS3), (IEN | PTU | DIS | M3)) /*HSUSB2_DA2*/\ + MUX_VAL(CP(MCSPI2_CLK), (IEN | PTU | DIS | M3)) /*HSUSB2_DA7*/\ + MUX_VAL(CP(MCSPI2_SIMO), (IEN | PTU | DIS | M3)) /*HSUSB2_DA4*/\ + MUX_VAL(CP(MCSPI2_SOMI), (IEN | PTU | DIS | M3)) /*HSUSB2_DA5*/\ + MUX_VAL(CP(MCSPI2_CS0), (IEN | PTU | DIS | M3)) /*HSUSB2_DA6*/\ + MUX_VAL(CP(MCSPI2_CS1), (IEN | PTU | DIS | M3)) /*HSUSB2_DA3*/\ + MUX_VAL(CP(ETK_D10_ES2), (IDIS | PTU | DIS | M3)) /*HSUSB2_CLK*/\ + MUX_VAL(CP(ETK_D11_ES2), (IDIS | PTU | DIS | M3)) /*HSUSB2_STP*/\ + MUX_VAL(CP(ETK_D12_ES2), (IEN | PTU | DIS | M3)) /*HSUSB2_DIR*/\ + MUX_VAL(CP(ETK_D13_ES2), (IEN | PTU | DIS | M3)) /*HSUSB2_NXT*/\ + MUX_VAL(CP(ETK_D14_ES2), (IEN | PTU | DIS | M3)) /*HSUSB2_DA0*/\ + MUX_VAL(CP(ETK_D15_ES2), (IEN | PTU | DIS | M3)) /*HSUSB2_DA1*/\ + /*Control and debug */\ + MUX_VAL(CP(SYS_32K), (IEN | PTD | DIS | M0)) /*SYS_32K*/\ + MUX_VAL(CP(SYS_CLKREQ), (IEN | PTD | DIS | M0)) /*SYS_CLKREQ*/\ + MUX_VAL(CP(SYS_NIRQ), (IEN | PTU | EN | M0)) /*SYS_nIRQ*/\ + MUX_VAL(CP(SYS_BOOT0), (IEN | PTD | DIS | M4)) /*GPIO_2*/\ + MUX_VAL(CP(SYS_BOOT1), (IEN | PTD | DIS | M4)) /*GPIO_3*/\ + MUX_VAL(CP(SYS_BOOT2), (IEN | PTD | DIS | M4)) /*MMC1_WP*/\ + MUX_VAL(CP(SYS_BOOT3), (IEN | PTD | DIS | M4)) /*GPIO_5*/\ + MUX_VAL(CP(SYS_BOOT4), (IEN | PTD | DIS | M4)) /*GPIO_6*/\ + MUX_VAL(CP(SYS_BOOT5), (IEN | PTD | DIS | M4)) /*GPIO_7*/\ + MUX_VAL(CP(SYS_BOOT6), (IDIS | PTD | DIS | M4)) /*GPIO_8*/ \ + MUX_VAL(CP(SYS_OFF_MODE), (IEN | PTD | DIS | M0)) /*SYS_OFF_MD*/\ + MUX_VAL(CP(SYS_CLKOUT1), (IEN | PTD | DIS | M0)) /*SYS_CLKOUT*/\ + MUX_VAL(CP(SYS_CLKOUT2), (IEN | PTU | EN | M4)) /*GPIO_186*/\ + MUX_VAL(CP(ETK_CLK_ES2), (IDIS | PTU | EN | M3)) /*HSUSB1_STP*/\ + MUX_VAL(CP(ETK_CTL_ES2), (IDIS | PTU | DIS | M3)) /*HSUSB1_CLK*/\ + MUX_VAL(CP(ETK_D0_ES2), (IEN | PTU | DIS | M3)) /*HSUSB1_DA0*/\ + MUX_VAL(CP(ETK_D1_ES2), (IEN | PTU | DIS | M3)) /*HSUSB1_DA1*/\ + MUX_VAL(CP(ETK_D2_ES2), (IEN | PTU | DIS | M3)) /*HSUSB1_DA2*/\ + MUX_VAL(CP(ETK_D3_ES2), (IEN | PTU | DIS | M3)) /*HSUSB1_DA7*/\ + MUX_VAL(CP(ETK_D4_ES2), (IEN | PTU | DIS | M3)) /*HSUSB1_DA4*/\ + MUX_VAL(CP(ETK_D5_ES2), (IEN | PTU | DIS | M3)) /*HSUSB1_DA5*/\ + MUX_VAL(CP(ETK_D6_ES2), (IEN | PTU | DIS | M3)) /*HSUSB1_DA6*/\ + MUX_VAL(CP(ETK_D7_ES2), (IEN | PTU | DIS | M3)) /*HSUSB1_DA3*/\ + MUX_VAL(CP(ETK_D8_ES2), (IEN | PTU | DIS | M3)) /*HSUSB1_DIR*/\ + MUX_VAL(CP(ETK_D9_ES2), (IEN | PTU | DIS | M3)) /*HSUSB1_NXT*/\ + MUX_VAL(CP(D2D_MCAD1), (IEN | PTD | EN | M0)) /*d2d_mcad1*/\ + MUX_VAL(CP(D2D_MCAD2), (IEN | PTD | EN | M0)) /*d2d_mcad2*/\ + MUX_VAL(CP(D2D_MCAD3), (IEN | PTD | EN | M0)) /*d2d_mcad3*/\ + MUX_VAL(CP(D2D_MCAD4), (IEN | PTD | EN | M0)) /*d2d_mcad4*/\ + MUX_VAL(CP(D2D_MCAD5), (IEN | PTD | EN | M0)) /*d2d_mcad5*/\ + MUX_VAL(CP(D2D_MCAD6), (IEN | PTD | EN | M0)) /*d2d_mcad6*/\ + MUX_VAL(CP(D2D_MCAD7), (IEN | PTD | EN | M0)) /*d2d_mcad7*/\ + MUX_VAL(CP(D2D_MCAD8), (IEN | PTD | EN | M0)) /*d2d_mcad8*/\ + MUX_VAL(CP(D2D_MCAD9), (IEN | PTD | EN | M0)) /*d2d_mcad9*/\ + MUX_VAL(CP(D2D_MCAD10), (IEN | PTD | EN | M0)) /*d2d_mcad10*/\ + MUX_VAL(CP(D2D_MCAD11), (IEN | PTD | EN | M0)) /*d2d_mcad11*/\ + MUX_VAL(CP(D2D_MCAD12), (IEN | PTD | EN | M0)) /*d2d_mcad12*/\ + MUX_VAL(CP(D2D_MCAD13), (IEN | PTD | EN | M0)) /*d2d_mcad13*/\ + MUX_VAL(CP(D2D_MCAD14), (IEN | PTD | EN | M0)) /*d2d_mcad14*/\ + MUX_VAL(CP(D2D_MCAD15), (IEN | PTD | EN | M0)) /*d2d_mcad15*/\ + MUX_VAL(CP(D2D_MCAD16), (IEN | PTD | EN | M0)) /*d2d_mcad16*/\ + MUX_VAL(CP(D2D_MCAD17), (IEN | PTD | EN | M0)) /*d2d_mcad17*/\ + MUX_VAL(CP(D2D_MCAD18), (IEN | PTD | EN | M0)) /*d2d_mcad18*/\ + MUX_VAL(CP(D2D_MCAD19), (IEN | PTD | EN | M0)) /*d2d_mcad19*/\ + MUX_VAL(CP(D2D_MCAD20), (IEN | PTD | EN | M0)) /*d2d_mcad20*/\ + MUX_VAL(CP(D2D_MCAD21), (IEN | PTD | EN | M0)) /*d2d_mcad21*/\ + MUX_VAL(CP(D2D_MCAD22), (IEN | PTD | EN | M0)) /*d2d_mcad22*/\ + MUX_VAL(CP(D2D_MCAD23), (IEN | PTD | EN | M0)) /*d2d_mcad23*/\ + MUX_VAL(CP(D2D_MCAD24), (IEN | PTD | EN | M0)) /*d2d_mcad24*/\ + MUX_VAL(CP(D2D_MCAD25), (IEN | PTD | EN | M0)) /*d2d_mcad25*/\ + MUX_VAL(CP(D2D_MCAD26), (IEN | PTD | EN | M0)) /*d2d_mcad26*/\ + MUX_VAL(CP(D2D_MCAD27), (IEN | PTD | EN | M0)) /*d2d_mcad27*/\ + MUX_VAL(CP(D2D_MCAD28), (IEN | PTD | EN | M0)) /*d2d_mcad28*/\ + MUX_VAL(CP(D2D_MCAD29), (IEN | PTD | EN | M0)) /*d2d_mcad29*/\ + MUX_VAL(CP(D2D_MCAD30), (IEN | PTD | EN | M0)) /*d2d_mcad30*/\ + MUX_VAL(CP(D2D_MCAD31), (IEN | PTD | EN | M0)) /*d2d_mcad31*/\ + MUX_VAL(CP(D2D_MCAD32), (IEN | PTD | EN | M0)) /*d2d_mcad32*/\ + MUX_VAL(CP(D2D_MCAD33), (IEN | PTD | EN | M0)) /*d2d_mcad33*/\ + MUX_VAL(CP(D2D_MCAD34), (IEN | PTD | EN | M0)) /*d2d_mcad34*/\ + MUX_VAL(CP(D2D_MCAD35), (IEN | PTD | EN | M0)) /*d2d_mcad35*/\ + MUX_VAL(CP(D2D_MCAD36), (IEN | PTD | EN | M0)) /*d2d_mcad36*/\ + MUX_VAL(CP(D2D_CLK26MI), (IEN | PTD | DIS | M0)) /*d2d_clk26m*/\ + MUX_VAL(CP(D2D_NRESPWRON), (IEN | PTD | EN | M0)) /*d2d_nrespw*/\ + MUX_VAL(CP(D2D_NRESWARM), (IEN | PTU | EN | M0)) /*d2d_nreswa*/\ + MUX_VAL(CP(D2D_ARM9NIRQ), (IEN | PTD | DIS | M0)) /*d2d_arm9ni*/\ + MUX_VAL(CP(D2D_UMA2P6FIQ), (IEN | PTD | DIS | M0)) /*d2d_uma2p6*/\ + MUX_VAL(CP(D2D_SPINT), (IEN | PTD | EN | M0)) /*d2d_spint*/\ + MUX_VAL(CP(D2D_FRINT), (IEN | PTD | EN | M0)) /*d2d_frint*/\ + MUX_VAL(CP(D2D_DMAREQ0), (IEN | PTD | DIS | M0)) /*d2d_dmare0*/\ + MUX_VAL(CP(D2D_DMAREQ1), (IEN | PTD | DIS | M0)) /*d2d_dmare1*/\ + MUX_VAL(CP(D2D_DMAREQ2), (IEN | PTD | DIS | M0)) /*d2d_dmare2*/\ + MUX_VAL(CP(D2D_DMAREQ3), (IEN | PTD | DIS | M0)) /*d2d_dmare3*/\ + MUX_VAL(CP(D2D_N3GTRST), (IEN | PTD | DIS | M0)) /*d2d_n3gtrs*/\ + MUX_VAL(CP(D2D_N3GTDI), (IEN | PTD | DIS | M0)) /*d2d_n3gtdi*/\ + MUX_VAL(CP(D2D_N3GTDO), (IEN | PTD | DIS | M0)) /*d2d_n3gtdo*/\ + MUX_VAL(CP(D2D_N3GTMS), (IEN | PTD | DIS | M0)) /*d2d_n3gtms*/\ + MUX_VAL(CP(D2D_N3GTCK), (IEN | PTD | DIS | M0)) /*d2d_n3gtck*/\ + MUX_VAL(CP(D2D_N3GRTCK), (IEN | PTD | DIS | M0)) /*d2d_n3grtc*/\ + MUX_VAL(CP(D2D_MSTDBY), (IEN | PTU | EN | M0)) /*d2d_mstdby*/\ + MUX_VAL(CP(D2D_SWAKEUP), (IEN | PTD | EN | M0)) /*d2d_swakeu*/\ + MUX_VAL(CP(D2D_IDLEREQ), (IEN | PTD | DIS | M0)) /*d2d_idlere*/\ + MUX_VAL(CP(D2D_IDLEACK), (IEN | PTU | EN | M0)) /*d2d_idleac*/\ + MUX_VAL(CP(D2D_MWRITE), (IEN | PTD | DIS | M0)) /*d2d_mwrite*/\ + MUX_VAL(CP(D2D_SWRITE), (IEN | PTD | DIS | M0)) /*d2d_swrite*/\ + MUX_VAL(CP(D2D_MREAD), (IEN | PTD | DIS | M0)) /*d2d_mread*/\ + MUX_VAL(CP(D2D_SREAD), (IEN | PTD | DIS | M0)) /*d2d_sread*/\ + MUX_VAL(CP(D2D_MBUSFLAG), (IEN | PTD | DIS | M0)) /*d2d_mbusfl*/\ + MUX_VAL(CP(D2D_SBUSFLAG), (IEN | PTD | DIS | M0)) /*d2d_sbusfl*/\ + MUX_VAL(CP(SDRC_CKE0), (IDIS | PTU | EN | M0)) /*sdrc_cke0*/\ + MUX_VAL(CP(SDRC_CKE1), (IDIS | PTU | EN | M0)) /*sdrc_cke1*/ + +#define MUX_RX51_C() \ + MUX_VAL(CP(MCBSP3_DX), (IEN | PTD | DIS | M4)) /*GPIO_140*/\ + MUX_VAL(CP(MCBSP3_DR), (IEN | PTD | DIS | M4)) /*GPIO_142*/\ + MUX_VAL(CP(MCBSP3_CLKX), (IEN | PTD | DIS | M4)) /*GPIO_141*/\ + MUX_VAL(CP(UART2_CTS), (IEN | PTU | EN | M0)) /*UART2_CTS*/\ + MUX_VAL(CP(UART2_RTS), (IDIS | PTD | DIS | M0)) /*UART2_RTS*/\ + MUX_VAL(CP(UART2_TX), (IDIS | PTD | DIS | M0)) /*UART2_TX*/ + +#endif diff --git a/boards.cfg b/boards.cfg index 1e5b3e0..be3b57f 100644 --- a/boards.cfg +++ b/boards.cfg @@ -210,6 +210,7 @@ omap3_evm_quick_mmc arm armv7 evm ti omap3_evm_quick_nand arm armv7 evm ti omap3 omap3_sdp3430 arm armv7 sdp3430 ti omap3 devkit8000 arm armv7 devkit8000 timll omap3 +nokia_rx51 arm armv7 rx51 nokia omap3 omap4_panda arm armv7 panda ti omap4 omap4_sdp4430 arm armv7 sdp4430 ti omap4 omap5_evm arm armv7 omap5_evm ti omap5 diff --git a/include/configs/nokia_rx51.h b/include/configs/nokia_rx51.h new file mode 100644 index 0000000..c892f65 --- /dev/null +++ b/include/configs/nokia_rx51.h @@ -0,0 +1,320 @@ +/* + * (C) Copyright 2011 + * Pali Rohár pali.rohar@gmail.com + * + * (C) Copyright 2010 + * Alistair Buxton a.j.buxton@gmail.com + * + * Derived from Beagle Board code: + * (C) Copyright 2006-2008 + * Texas Instruments. + * Richard Woodruff r-woodruff2@ti.com + * Syed Mohammed Khasim x0khasim@ti.com + * + * Configuration settings for the Nokia RX-51 aka N900. + * + * 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 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 __CONFIG_H +#define __CONFIG_H + +/* + * High Level Configuration Options + */ + +#define CONFIG_ARMV7 /* This is an ARM V7 CPU core */ +#define CONFIG_OMAP /* in a TI OMAP core */ +#define CONFIG_OMAP34XX /* which is a 34XX */ +#define CONFIG_OMAP3430 /* which is in a 3430 */ +#define CONFIG_L2_OFF /* kernel won't boot if l2 enabled */ +/*(old u-boot tried but failed to enable it, due to a bug.) */ + +/* It doesn't really matter what we set this to. NOLO will load u-boot.bin + * in a random place anyway, and we have to copy. + */ +#define CONFIG_SYS_TEXT_BASE 0x80008000 + +#define CONFIG_SDRC /* The chip has SDRC controller */ + +#include <asm/arch/cpu.h> /* get chip and board defs */ +#include <asm/arch/omap3.h> + +/* + * Display CPU and Board information + */ +#define CONFIG_DISPLAY_CPUINFO +#define CONFIG_DISPLAY_BOARDINFO + +/* Clock Defines */ +#define V_OSCK 26000000 /* Clock output from T2 */ +#define V_SCLK (V_OSCK >> 1) + +#undef CONFIG_USE_IRQ /* no support for IRQs */ +#define CONFIG_MISC_INIT_R +#define CONFIG_SKIP_LOWLEVEL_INIT /* NOLO set everything up */ + +#define CONFIG_CMDLINE_TAG /* enable passing kernel command line string */ +#define CONFIG_INITRD_TAG /* enable passing initrd */ + +/* + * Size of malloc() pool + */ +#define CONFIG_ENV_SIZE (128 << 10) /* 128 KiB Sector */ +#define CONFIG_SYS_MALLOC_LEN (CONFIG_ENV_SIZE + (128 << 10)) + +/* + * Hardware drivers + */ + +/* + * NS16550 Configuration + */ +#define V_NS16550_CLK 48000000 /* 48MHz (APLL96/2) */ + +#define CONFIG_SYS_NS16550 +#define CONFIG_SYS_NS16550_SERIAL +#define CONFIG_SYS_NS16550_REG_SIZE (-4) +#define CONFIG_SYS_NS16550_CLK V_NS16550_CLK + +/* + * select serial console configuration + */ +#define CONFIG_CONS_INDEX 3 +#define CONFIG_SYS_NS16550_COM3 OMAP34XX_UART3 +#define CONFIG_SERIAL3 3 /* UART3 on RX-51 */ + +/* allow to overwrite serial and ethaddr */ +#define CONFIG_ENV_OVERWRITE +#define CONFIG_BAUDRATE 115200 +#define CONFIG_SYS_BAUDRATE_TABLE {4800, 9600, 19200, 38400, 57600, 115200} +#define CONFIG_MMC +#define CONFIG_GENERIC_MMC +#define CONFIG_OMAP_HSMMC +#define CONFIG_DOS_PARTITION + +/* DDR - I use Micron DDR */ +#define CONFIG_OMAP3_MICRON_DDR + +/* USB - broken */ +#define CONFIG_MUSB_UDC +#define CONFIG_USB_OMAP3 +#define CONFIG_TWL4030_USB + +/* USB device configuration - broken */ +#define CONFIG_USB_DEVICE +/* FIXME: usbtty breaks maemo pr1.2 kernel booting +#define CONFIG_USB_TTY +*/ +#define CONFIG_SYS_CONSOLE_IS_IN_ENV + +/* commands to include */ +#include <config_cmd_default.h> + +#define CONFIG_CMD_EXT2 /* EXT2 Support */ +#define CONFIG_CMD_FAT /* FAT support */ + +#define CONFIG_CMD_I2C /* I2C serial bus support */ +#define CONFIG_CMD_MMC /* MMC support */ +#undef CONFIG_CMD_ONENAND /* NAND support */ + +#define CONFIG_CMD_CLEAR /* ANSI terminal clear screen command */ + +#undef CONFIG_CMD_FLASH /* flinfo, erase, protect */ +#undef CONFIG_CMD_FPGA /* FPGA configuration Support */ +#undef CONFIG_CMD_IMI /* iminfo */ +#undef CONFIG_CMD_IMLS /* List all found images */ +#undef CONFIG_CMD_NET /* bootp, tftpboot, rarpboot */ +#undef CONFIG_CMD_NFS /* NFS support */ + +#define CONFIG_SYS_NO_FLASH +#define CONFIG_HARD_I2C +#define CONFIG_SYS_I2C_SPEED 100000 +#define CONFIG_SYS_I2C_SLAVE 1 +#define CONFIG_SYS_I2C_BUS 0 +#define CONFIG_SYS_I2C_BUS_SELECT 1 +#define CONFIG_DRIVER_OMAP34XX_I2C 1 + +/* + * TWL4030 + */ +#define CONFIG_TWL4030_POWER +#define CONFIG_TWL4030_LED +#define CONFIG_TWL4030_KEYPAD + +/* Watchdog support */ +#define CONFIG_HW_WATCHDOG + +/* + * Framebuffer + */ +/* Video console */ +#define CONFIG_VIDEO +#define CONFIG_CFB_CONSOLE +#define CONFIG_CFB_CONSOLE_ANSI /* Enable ANSI escape codes in framebuffer */ +#define CONFIG_VIDEO_LOGO +#define VIDEO_FB_16BPP_PIXEL_SWAP +#define VIDEO_FB_16BPP_WORD_SWAP +#define CONFIG_VIDEO_SW_CURSOR +#define CONFIG_SPLASH_SCREEN + +/* functions for cfb_console */ +#define VIDEO_KBD_INIT_FCT rx51_kp_init() +#define VIDEO_TSTC_FCT rx51_kp_tstc +#define VIDEO_GETC_FCT rx51_kp_getc +#ifndef __ASSEMBLY__ +int rx51_kp_init(void); +int rx51_kp_tstc(void); +int rx51_kp_getc(void); +#endif + +/* Environment information */ +#define CONFIG_BOOTDELAY 3 + +#define CONFIG_EXTRA_ENV_SETTINGS \ + "usbtty=cdc_acm\0" \ + "stdin=vga\0" \ + "stdout=vga\0" \ + "stderr=vga\0" \ + "setcon=setenv stdin ${con};" \ + "setenv stdout ${con};" \ + "setenv stderr ${con}\0" \ + "sercon=setenv con serial; run setcon\0" \ + "usbcon=setenv con usbtty; run setcon\0" \ + "vgacon=setenv con vga; run setcon\0" \ + "switchmmc=mmc dev ${mmcnum}\0" \ + "loadaddr=0x82000000\0" \ + "fileload=${mmctype}load mmc ${mmcnum}:${mmcpart} ${loadaddr} " \ + "${mmcfile}\0" \ + "scriptboot=echo Running ${mmcfile} from mmc ${mmcnum}:${mmcpart} ...;"\ + "source ${loadaddr}\0" \ + "uimageboot=echo Booting ${mmcfile} from mmc ${mmcnum}:${mmcpart} ...;"\ + "bootm ${loadaddr}\0" \ + "noloboot=echo Booting NOLO supplied kernel ...;" \ + "setenv atagaddr ${init_atagaddr};" \ + "bootm ${init_kernaddr}\0" \ + "trymmcpart=setenv mmcfile boot.scr; run trymmcscript;" \ + "setenv mmcfile uImage; run trymmcuimage\0" \ + "trymmcload=setenv mmcpart 1; run trymmcpart;" \ + "setenv mmcpart 2; run trymmcpart;" \ + "setenv mmcpart 3; run trymmcpart;" \ + "setenv mmcpart 4; run trymmcpart\0" \ + "trymmcboot=if run switchmmc; then " \ + "setenv mmctype fat;" \ + "run trymmcload;" \ + "setenv mmctype ext2;" \ + "run trymmcload;" \ + "fi\0" \ + "trymmcscript=if run switchmmc; then " \ + "if run fileload; then " \ + "run scriptboot;" \ + "fi;" \ + "fi\0" \ + "trymmcuimage=if run switchmmc; then " \ + "if run fileload; then " \ + "run uimageboot;" \ + "fi;" \ + "fi\0" \ + "immcboot=setenv mmcnum 1; run trymmcboot\0" \ + "emmcboot=setenv mmcnum 0; run trymmcboot\0" + +#define CONFIG_PREBOOT \ + "if test $slide_sw != open; then run noloboot; fi;" + +#define CONFIG_PREMONITOR \ + "echo Extra commands:;" \ + "echo run sercon - Use serial port for control.;" \ + "echo run usbcon - Use usbtty for control.;" \ + "echo run vgacon - Use framebuffer/keyboard.;" \ + "echo run emmcboot - Boot from SD card slot.;" \ + "echo run immcboot - Boot internal eMMC memory.;" \ + "echo run noloboot - Boot kernel loaded by NOLO.;" \ + "echo" + +#define CONFIG_BOOTCOMMAND \ + "run emmcboot;" \ + "run immcboot;" \ + "run noloboot;" \ + "echo" + +#define CONFIG_AUTO_COMPLETE +/* + * Miscellaneous configurable options + */ +#define CONFIG_SYS_LONGHELP /* undef to save memory */ +#define CONFIG_SYS_HUSH_PARSER /* use "hush" command parser */ +#define CONFIG_SYS_PROMPT_HUSH_PS2 "> " +#define CONFIG_SYS_PROMPT "Nokia RX-51 # " +#define CONFIG_SYS_CBSIZE 256 /* Console I/O Buffer Size */ +/* Print Buffer Size */ +#define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE + \ + sizeof(CONFIG_SYS_PROMPT) + 16) +#define CONFIG_SYS_MAXARGS 16 /* max number of command args */ +/* Boot Argument Buffer Size */ +#define CONFIG_SYS_BARGSIZE (CONFIG_SYS_CBSIZE) + +#define CONFIG_SYS_MEMTEST_START (OMAP34XX_SDRC_CS0) +#define CONFIG_SYS_MEMTEST_END (OMAP34XX_SDRC_CS0 + 0x01F00000)/*31MB*/ + +/* default load address */ +#define CONFIG_SYS_LOAD_ADDR (OMAP34XX_SDRC_CS0) + +/* + * OMAP3 has 12 GP timers, they can be driven by the system clock + * (12/13/16.8/19.2/38.4MHz) or by 32KHz clock. We use 13MHz (V_SCLK). + * This rate is divided by a local divisor. + */ +#define CONFIG_SYS_TIMERBASE (OMAP34XX_GPT2) +#define CONFIG_SYS_PTV 2 /* Divisor: 2^(PTV+1) => 8 */ +#define CONFIG_SYS_HZ 1000 + +/*----------------------------------------------------------------------- + * Stack sizes + * + * The stack sizes are set up in start.S using the settings below + */ +#define CONFIG_STACKSIZE (128 << 10) /* regular stack 128 KiB */ +#ifdef CONFIG_USE_IRQ +#define CONFIG_STACKSIZE_IRQ (4 << 10) /* IRQ stack 4 KiB */ +#define CONFIG_STACKSIZE_FIQ (4 << 10) /* FIQ stack 4 KiB */ +#endif + +/*----------------------------------------------------------------------- + * Physical Memory Map + */ +#define CONFIG_NR_DRAM_BANKS 2 /* CS1 may or may not be populated */ +#define PHYS_SDRAM_1 OMAP34XX_SDRC_CS0 +#define PHYS_SDRAM_2 OMAP34XX_SDRC_CS1 + +/* SDRAM Bank Allocation method */ +#define SDRC_R_B_C 1 + +/*----------------------------------------------------------------------- + * FLASH and environment organization + */ + +#define CONFIG_ENV_IS_NOWHERE + +#define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM_1 +#define CONFIG_SYS_INIT_RAM_ADDR 0x4020f800 +#define CONFIG_SYS_INIT_RAM_SIZE 0x800 +#define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SYS_INIT_RAM_ADDR + \ + CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE) + +#endif /* __CONFIG_H */

On Sun, Dec 18, 2011 at 2:34 PM, Pali Rohár pali.rohar@gmail.com wrote:
This board definition results in a u-boot.bin which can be chainloaded from NOLO in qemu or on a real N900. It does very little hardware config because NOLO has already configured the board. Only needed is enabling internal eMMC memory via twl4030 regulator which is not enabled by NOLO.
[snip]
+/*
- Routine: save_boot_params (called after reset from start.S)
- Description: Save atag address and attached kernel address.
- Move u-boot to address CONFIG_SYS_TEXT_BASE
- */
+asm( +"startaddr:\n" /* address where should be u-boot after relocation */
Please put this into its own .S file so it's more readable, thanks.
[snip]
+/*
- High Level Configuration Options
- */
+#define CONFIG_ARMV7 /* This is an ARM V7 CPU core */
This isn't used.
+#define CONFIG_L2_OFF /* kernel won't boot if l2 enabled */
This isn't correct for disabling L2 now and doesn't do anything. So L2 is probably enabled :)
[snip]
+/* DDR - I use Micron DDR */ +#define CONFIG_OMAP3_MICRON_DDR
No you don't :) This can go away.
[snip]
+#ifdef CONFIG_USE_IRQ +#define CONFIG_STACKSIZE_IRQ (4 << 10) /* IRQ stack 4 KiB */ +#define CONFIG_STACKSIZE_FIQ (4 << 10) /* FIQ stack 4 KiB */ +#endif
We just removed all of these from other config files.
+/*-----------------------------------------------------------------------
- Physical Memory Map
- */
+#define CONFIG_NR_DRAM_BANKS 2 /* CS1 may or may not be populated */ +#define PHYS_SDRAM_1 OMAP34XX_SDRC_CS0 +#define PHYS_SDRAM_2 OMAP34XX_SDRC_CS1
+/* SDRAM Bank Allocation method */ +#define SDRC_R_B_C 1
And I'm not sure if any of these are really needed now.
Thanks.

On Tuesday 03 January 2012 09:05:17 Tom Rini wrote:
On Sun, Dec 18, 2011 at 2:34 PM, Pali Rohár pali.rohar@gmail.com wrote:
This board definition results in a u-boot.bin which can be chainloaded from NOLO in qemu or on a real N900. It does very little hardware config because NOLO has already configured the board. Only needed is enabling internal eMMC memory via twl4030 regulator which is not enabled by NOLO.
[snip]
+/*
- Routine: save_boot_params (called after reset from start.S)
- Description: Save atag address and attached kernel address.
Move u-boot to address CONFIG_SYS_TEXT_BASE
- */
+asm( +"startaddr:\n" /* address where should be u-boot after relocation */
Please put this into its own .S file so it's more readable, thanks.
Ok. I will put it into board/nokia/rx51/rx51.S
[snip]
+/*
- High Level Configuration Options
- */
+#define CONFIG_ARMV7 /* This is an ARM V7 CPU core */
This isn't used.
+#define CONFIG_L2_OFF /* kernel won't boot if l2 enabled */
This isn't correct for disabling L2 now and doesn't do anything. So L2 is probably enabled :)
and #define CONFIG_SYS_L2CACHE_OFF is correct?
[snip]
+/* DDR - I use Micron DDR */ +#define CONFIG_OMAP3_MICRON_DDR
No you don't :) This can go away.
ok, deleted.
[snip]
+#ifdef CONFIG_USE_IRQ +#define CONFIG_STACKSIZE_IRQ (4 << 10) /* IRQ stack 4 KiB */ +#define CONFIG_STACKSIZE_FIQ (4 << 10) /* FIQ stack 4 KiB */ +#endif
We just removed all of these from other config files.
deleted too.
+/*-----------------------------------------------------------------------
- Physical Memory Map
- */
+#define CONFIG_NR_DRAM_BANKS 2 /* CS1 may or may not be populated */ +#define PHYS_SDRAM_1 OMAP34XX_SDRC_CS0 +#define PHYS_SDRAM_2 OMAP34XX_SDRC_CS1
+/* SDRAM Bank Allocation method */ +#define SDRC_R_B_C 1
And I'm not sure if any of these are really needed now.
When I deleted this code, I cannot compile U-Boot. Here is error message: include/asm/u-boot.h:48:17: error: ‘CONFIG_NR_DRAM_BANKS’ undeclared here (not in a function)
So this code is needed.
Thanks.

On Tue, Jan 10, 2012 at 6:14 AM, Pali Rohár pali.rohar@gmail.com wrote:
On Tuesday 03 January 2012 09:05:17 Tom Rini wrote:
On Sun, Dec 18, 2011 at 2:34 PM, Pali Rohár pali.rohar@gmail.com wrote:
This board definition results in a u-boot.bin which can be chainloaded from NOLO in qemu or on a real N900. It does very little hardware config because NOLO has already configured the board. Only needed is enabling internal eMMC memory via twl4030 regulator which is not enabled by NOLO.
[snip]
[snip]
+/*
- High Level Configuration Options
- */
+#define CONFIG_ARMV7 /* This is an ARM V7 CPU core */
This isn't used.
+#define CONFIG_L2_OFF /* kernel won't boot if l2 enabled */
This isn't correct for disabling L2 now and doesn't do anything. So L2 is probably enabled :)
and #define CONFIG_SYS_L2CACHE_OFF is correct?
Yes.
[snip]
+/*-----------------------------------------------------------------------
- Physical Memory Map
- */
+#define CONFIG_NR_DRAM_BANKS 2 /* CS1 may or may not be populated */ +#define PHYS_SDRAM_1 OMAP34XX_SDRC_CS0 +#define PHYS_SDRAM_2 OMAP34XX_SDRC_CS1
+/* SDRAM Bank Allocation method */ +#define SDRC_R_B_C 1
And I'm not sure if any of these are really needed now.
When I deleted this code, I cannot compile U-Boot. Here is error message: include/asm/u-boot.h:48:17: error: ‘CONFIG_NR_DRAM_BANKS’ undeclared here (not in a function)
I just meant the SDRC_R_B_C part, sorry.

* Configuration is done via env variables bootmenu_delay and bootmenu_<num>:
bootmenu_delay=<delay> bootmenu_<num>="<title>=<commands>"
(title and commands are separated by first char '=')
<delay> is delay in seconds of autobooting first entry <num> is boot menu entry, starting from zero <title> is text shown in boot screen <commands> are commands which will be executed when menu entry is selected
* First argument of bootmenu command override bootmenu_delay env * If env bootmenu_delay or bootmenu arg is not specified, delay is 10 seconds * If delay is 0, no entry will be shown on screen and first will be called * If delay is less then 0, no autoboot delay will be used * Boot Menu will stop finding next menu entry if last was not defined * Boot Menu always add menu entry "U-Boot console" at end of all entries
* Example using:
setenv bootmenu_0 Boot 1. kernel=bootm 0x82000000 # Set first menu entry setenv bootmenu_1 Boot 2. kernel=bootm 0x83000000 # Set second menu entry setenv bootmenu_2 Reset board=reset # Set third menu entry setenv bootmenu_3 U-Boot boot order=boot # Set fourth menu entry setenv bootmenu_4 # Empty string is end of all bootmenu entries bootmenu 20 # Run bootmenu with autoboot delay 20s
Signed-off-by: Pali Rohár pali.rohar@gmail.com --- common/Makefile | 1 + common/cmd_bootmenu.c | 366 ++++++++++++++++++++++++++++++++++++++++++++++ include/config_cmd_all.h | 1 + 3 files changed, 368 insertions(+), 0 deletions(-) create mode 100644 common/cmd_bootmenu.c
diff --git a/common/Makefile b/common/Makefile index e1efd45..7402bfb 100644 --- a/common/Makefile +++ b/common/Makefile @@ -67,6 +67,7 @@ COBJS-$(CONFIG_CMD_SOURCE) += cmd_source.o COBJS-$(CONFIG_CMD_BDI) += cmd_bdinfo.o COBJS-$(CONFIG_CMD_BEDBUG) += bedbug.o cmd_bedbug.o COBJS-$(CONFIG_CMD_BMP) += cmd_bmp.o +COBJS-$(CONFIG_CMD_BOOTMENU) += cmd_bootmenu.o COBJS-$(CONFIG_CMD_BOOTLDR) += cmd_bootldr.o COBJS-$(CONFIG_CMD_CACHE) += cmd_cache.o COBJS-$(CONFIG_CMD_CLEAR) += cmd_clear.o diff --git a/common/cmd_bootmenu.c b/common/cmd_bootmenu.c new file mode 100644 index 0000000..931ed18 --- /dev/null +++ b/common/cmd_bootmenu.c @@ -0,0 +1,366 @@ +/* + * (C) Copyright 2011 Pali Rohár pali.rohar@gmail.com + * + * 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 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 + */ + +#include <common.h> +#include <command.h> +#include <watchdog.h> +#include <linux/string.h> + +#ifdef CONFIG_SYS_HUSH_PARSER +#include <hush.h> +#endif + +static char *get_option(int n) +{ + + char name[] = "bootmenu_\0\0"; + + if (n < 0 || n > 99) + return NULL; + + sprintf(name+9, "%d", n); + + return getenv(name); + +} + +static char *get_end_of_title(char *str) +{ + + if (!str) + return NULL; + + return strchr(str, '='); + +} + +static int print_title(char *begin, char *end) +{ + + if (!begin || !end || end < begin) + return 1; + + while (begin != end) + putc(*(begin++)); + + return 0; + +} + +static int print_entry(int n, int reverse) +{ + + char *str = get_option(n); + char *end = get_end_of_title(str); + + if (!end) + return 1; + + printf(ANSI_CURSOR_POSITION, n+4, 1); + + if (reverse) + puts(ANSI_COLOR_REVERSE); + + puts(" "); + print_title(str, end); + puts(ANSI_CLEAR_LINE_TO_END); + + if (reverse) + puts(ANSI_COLOR_RESET); + + return 0; + +} + +static int print_menu(int active) +{ + + int n = 0; + + printf(ANSI_CURSOR_POSITION, 1, 1); + puts(ANSI_CLEAR_LINE); + printf(ANSI_CURSOR_POSITION, 2, 1); + puts(" *** U-Boot BOOT MENU ***"); + puts(ANSI_CLEAR_LINE_TO_END); + printf(ANSI_CURSOR_POSITION, 3, 1); + puts(ANSI_CLEAR_LINE); + + while (1) { + + int ret = print_entry(n, n == active ? 1 : 0); + + if (ret == 1) + break; + + ++n; + + } + + printf(ANSI_CURSOR_POSITION, n+4, 1); + + if (n == active) + puts(ANSI_COLOR_REVERSE); + + puts(" U-Boot console"); + puts(ANSI_CLEAR_LINE_TO_END); + + if (n == active) + puts(ANSI_COLOR_RESET); + + printf(ANSI_CURSOR_POSITION, n+5, 1); + puts(ANSI_CLEAR_LINE); + printf(ANSI_CURSOR_POSITION, n+6, 1); + puts(" Press UP/DOWN to move, ENTER to select"); + puts(ANSI_CLEAR_LINE_TO_END); + printf(ANSI_CURSOR_POSITION, n+7, 1); + puts(ANSI_CLEAR_LINE); + + return n; + +} + +int do_bootmenu(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[]) +{ + + int active = 0; + int abort = 0; + int key = 0; /* 0 - NONE, 1 - UP, 2 - DOWN, 3 - SELECT */ + int esc = 0; + int count = 0; + int delay = 10; + int instant = 0; + char *delay_str = NULL; + + if (argc >= 2) + delay_str = argv[1]; + + if (!delay_str) + delay_str = getenv("bootmenu_delay"); + + if (delay_str) + delay = (int)simple_strtol(delay_str, NULL, 10); + + if (delay == 0) { + + /* prevent setting U-Boot console as first menu entry */ + if (get_end_of_title(get_option(0))) + count = 1; + + instant = 1; + + } + + if (delay < 0) + abort = 1; + + if (!instant) { + + puts(ANSI_CURSOR_HIDE); + puts(ANSI_CLEAR_CONSOLE); + printf(ANSI_CURSOR_POSITION, 1, 1); + + } + + while (1) { + + if (abort || delay > 0) + count = print_menu(active); + + if (!abort) { + + if (delay > 0) + printf(" Hit any key to stop autoboot: %2d ", + delay); + + while (delay > 0) { + + int i; + + for (i = 0; i < 100; ++i) { + + if (tstc()) { + + abort = 1; + key = getc(); + + if (key == '\e') { + esc = 1; + key = 0; + } else if (key == '\r') + key = 3; + else + key = 0; + + break; + + } + + WATCHDOG_RESET(); + udelay(10000); + + } + + if (abort) + break; + + --delay; + printf("\b\b\b%2d ", delay); + + } + + if (delay <= 0) + key = 3; + + } else { + + while (!tstc()) { + + WATCHDOG_RESET(); + udelay(10000); + + } + + key = getc(); + + if (esc == 0) { + + if (key == '\e') { + esc = 1; + key = 0; + } + + } else if (esc == 1) { + + if (key == '[') { + esc = 2; + key = 0; + } else + esc = 0; + + } else if (esc == 2 || esc == 3) { + + if (esc == 2 && key == '1') { + esc = 3; + key = 0; + } else + esc = 0; + + if (key == 'A') + key = 1; + else if (key == 'B') + key = 2; + else + key = 0; + + } + + if (key == '\r') + key = 3; + + } + + if (key == 1) { + + if (active > 0) + --active; + + } else if (key == 2) { + + if (active < count) + ++active; + + } else if (key == 3) { + + char *str; + char *end; + + putc('\n'); + + if (!instant) { + + puts(ANSI_CURSOR_SHOW); + puts(ANSI_CLEAR_CONSOLE); + printf(ANSI_CURSOR_POSITION, 1, 1); + + } + + WATCHDOG_RESET(); + + /* last entry is always U-Boot console */ + if (active == count) { + + puts("Starting U-Boot console\n\n"); + return 0; + + } + + str = get_option(active); + end = get_end_of_title(str); + + if (!end) { + + printf("Invalid Boot Menu entry %d\n", active); + puts("Starting U-Boot console\n\n"); + return 0; + + } + + if (!end[1]) { + + printf("Invalid Boot Menu entry %d: ", active); + print_title(str, end); + puts("\nStarting U-Boot console\n\n"); + return 0; + + } + + printf("Booting Boot Menu entry %d: ", active); + print_title(str, end); + puts(" ...\n\n"); + +#ifndef CONFIG_SYS_HUSH_PARSER + run_command(end+1, 0); +#else + parse_string_outer(end+1, FLAG_PARSE_SEMICOLON | + FLAG_EXIT_FROM_LOOP); +#endif + + printf("\nFailed booting Boot Menu entry %d: ", active); + print_title(str, end); + puts("\nStarting U-Boot console\n\n"); + return 0; + + } + + } + + /* never happends */ + return 1; + +} + +U_BOOT_CMD( + bootmenu, 2, 1, do_bootmenu, + "ANSI terminal bootmenu", + "[delay]\n" + " - show ANSI terminal bootmenu with autoboot delay (default 10s)" +); diff --git a/include/config_cmd_all.h b/include/config_cmd_all.h index 3f25eba..8c0a648 100644 --- a/include/config_cmd_all.h +++ b/include/config_cmd_all.h @@ -20,6 +20,7 @@ #define CONFIG_CMD_BEDBUG /* Include BedBug Debugger */ #define CONFIG_CMD_BMP /* BMP support */ #define CONFIG_CMD_BOOTD /* bootd */ +#define CONFIG_CMD_BOOTMENU /* ANSI terminal Boot Menu */ #define CONFIG_CMD_BSP /* Board Specific functions */ #define CONFIG_CMD_CACHE /* icache, dcache */ #define CONFIG_CMD_CDP /* Cisco Discovery Protocol */

* default bootmenu entries: NOLO kernel, internal eMMC memory, external SD card, u-boot boot order
* when keyboard slide is closed always boot NOLO kernel
* when keyborad slide is open in CONFIG_PREBOOT try load bootmenu.scr from first FAT partition of internal eMMC memory (also known as MyDocs) which (should) overwrite default bootmenu entries
Signed-off-by: Pali Rohár pali.rohar@gmail.com --- include/configs/nokia_rx51.h | 22 ++++++++++++++++++---- 1 files changed, 18 insertions(+), 4 deletions(-)
diff --git a/include/configs/nokia_rx51.h b/include/configs/nokia_rx51.h index c892f65..2a1de85 100644 --- a/include/configs/nokia_rx51.h +++ b/include/configs/nokia_rx51.h @@ -134,6 +134,7 @@ #define CONFIG_CMD_MMC /* MMC support */ #undef CONFIG_CMD_ONENAND /* NAND support */
+#define CONFIG_CMD_BOOTMENU /* ANSI terminal Boot Menu */ #define CONFIG_CMD_CLEAR /* ANSI terminal clear screen command */
#undef CONFIG_CMD_FLASH /* flinfo, erase, protect */ @@ -185,8 +186,6 @@ int rx51_kp_getc(void); #endif
/* Environment information */ -#define CONFIG_BOOTDELAY 3 - #define CONFIG_EXTRA_ENV_SETTINGS \ "usbtty=cdc_acm\0" \ "stdin=vga\0" \ @@ -232,10 +231,22 @@ int rx51_kp_getc(void); "fi;" \ "fi\0" \ "immcboot=setenv mmcnum 1; run trymmcboot\0" \ - "emmcboot=setenv mmcnum 0; run trymmcboot\0" + "emmcboot=setenv mmcnum 0; run trymmcboot\0" \ + "menucmd=bootmenu\0" \ + "bootmenu_0=Internal flash=run noloboot\0" \ + "bootmenu_1=Internal eMMC=run immcboot\0" \ + "bootmenu_2=External SD card=run emmcboot\0" \ + "bootmenu_3=U-Boot boot order=boot\0" \ + "bootmenu_delay=3\0"
#define CONFIG_PREBOOT \ - "if test $slide_sw != open; then run noloboot; fi;" + "if test $slide_sw = open; then " \ + "setenv mmcnum 1; setenv mmcpart 1; setenv mmctype fat;" \ + "setenv mmcfile bootmenu.scr;" \ + "run trymmcscript;" \ + "else " \ + "setenv bootmenu_delay 0;" \ + "fi"
#define CONFIG_PREMONITOR \ "echo Extra commands:;" \ @@ -253,7 +264,10 @@ int rx51_kp_getc(void); "run noloboot;" \ "echo"
+#define CONFIG_MENUCMD + #define CONFIG_AUTO_COMPLETE + /* * Miscellaneous configurable options */

On Sun, Dec 18, 2011 at 2:34 PM, Pali Rohár pali.rohar@gmail.com wrote:
* default bootmenu entries: NOLO kernel, internal eMMC memory, external SD card, u-boot boot order
* when keyboard slide is closed always boot NOLO kernel
* when keyborad slide is open in CONFIG_PREBOOT try load bootmenu.scr from first FAT partition of internal eMMC memory (also known as MyDocs) which (should) overwrite default bootmenu entries
Signed-off-by: Pali Rohár pali.rohar@gmail.com
Acked-by: Tom Rini trini@ti.com

Dear Pali =?ISO-8859-1?Q?Roh=E1r?=,
In message 1778406.ezGto4lKnu@pali-elitebook you wrote:
I'm sending third version of rx51 patches for u-boot. All patches was checked by checkpatch.pl and no error or warning was appeared. Last 2 patches (0014 and 0015) adding ANSI terminal bootmenu support for rx51 and can be reviewed separatly (patches 0001-0013 adding nokia rx51 board support and working without that last two).
It seems you did not bother to read http://www.denx.de/wiki/view/U-Boot/Patches#Sending_updated_patch_versions
I do not have the time to try to find out what you might have changed compared top your previous submission, and others are in the same situation.
Why did you not provide any change logs?
Best regards,
Wolfgang Denk

On Monday 19 December 2011 00:57:27 Wolfgang Denk wrote:
Dear Pali =?ISO-8859-1?Q?Roh=E1r?=,
In message 1778406.ezGto4lKnu@pali-elitebook you wrote:
I'm sending third version of rx51 patches for u-boot. All patches was checked by checkpatch.pl and no error or warning was appeared. Last 2 patches (0014 and 0015) adding ANSI terminal bootmenu support for rx51 and can be reviewed separatly (patches 0001-0013 adding nokia rx51 board support and working without that last two).
It seems you did not bother to read http://www.denx.de/wiki/view/U-Boot/Patches#Sending_updated_patch_versions
I do not have the time to try to find out what you might have changed compared top your previous submission, and others are in the same situation.
Why did you not provide any change logs?
Best regards,
Wolfgang Denk
Here is changelog v2:v3
* fixed all problems detected by checkpatch.pl * wrapped long commit messages * in arch/arm/lib/bootm.c added local define CONFIG_SETUP_ANY_TAG * Patch "cfb_console.c: Add function console_swap_colors" squashed into "cfb_console.c: Add support for ANSI terminal" * renamed command clr to clear; use puts instead printf; move cursor to pos1,1 * removed check #ifdef CONFIG_PREMONITOR in main.c * rx51 board code: removed Makefile targets: clean and distclean * ansi bootmenu command: use puts instead printf

Hi Pali,
On 19/12/11 18:17, Pali Rohár wrote:
On Monday 19 December 2011 00:57:27 Wolfgang Denk wrote:
Dear Pali =?ISO-8859-1?Q?Roh=E1r?=,
In message 1778406.ezGto4lKnu@pali-elitebook you wrote:
I'm sending third version of rx51 patches for u-boot. All patches was checked by checkpatch.pl and no error or warning was appeared. Last 2 patches (0014 and 0015) adding ANSI terminal bootmenu support for rx51 and can be reviewed separatly (patches 0001-0013 adding nokia rx51 board support and working without that last two).
It seems you did not bother to read http://www.denx.de/wiki/view/U-Boot/Patches#Sending_updated_patch_versions
I do not have the time to try to find out what you might have changed compared top your previous submission, and others are in the same situation.
Why did you not provide any change logs?
Best regards,
Wolfgang Denk
Here is changelog v2:v3
- fixed all problems detected by checkpatch.pl
- wrapped long commit messages
- in arch/arm/lib/bootm.c added local define CONFIG_SETUP_ANY_TAG
- Patch "cfb_console.c: Add function console_swap_colors" squashed into
"cfb_console.c: Add support for ANSI terminal"
- renamed command clr to clear; use puts instead printf; move cursor to pos1,1
- removed check #ifdef CONFIG_PREMONITOR in main.c
- rx51 board code: removed Makefile targets: clean and distclean
- ansi bootmenu command: use puts instead printf
So which patches have changed? What changes apply to which patch?
Before posting any more updates, please read:
http://www.denx.de/wiki/view/U-Boot/Patches
_completely_
In particular: - Set the in-reply-to email header of the new version of _each_ _individual_ patch the the message-id: of the previous version of that _individual_ patch - Add v1/v2/v3 to the subject line of the updated version of _each_ _individual_ patch (i.e. [PATCH v2 06/15] ......) - You do not need to post an new version of any patches which have no changes (you can if you want to keep the version numbers the same across the whole series, but make sure you put 'no changes' in the changelog) - Include the changelog for all previous version of _each_ _individual_ patch on the new version of _each_ _individual_ patch - DO NOT put the changelog in patch 0 - Use git format-patch and git send-email - git format-patch creates a ready-to-send email - All you need to do is add the 'in-reply-to' email header and chagelog and then do a git-send-email
We are fairly tolerant of honest mistakes (thankfully, because I've made my fair share) but we tend to draw the line at mistakes that could have been avoided with a little prior reading (particularly if said reading was explicitly pointed out)
I suggest you create a 'v4' patchset after reading up on exactly how to submit revised patches
Regards,
Graeme
participants (7)
-
Graeme Russ
-
Marek Vasut
-
Mike Frysinger
-
Pali Rohár
-
Stefano Babic
-
Tom Rini
-
Wolfgang Denk