[U-Boot] [PATCH][SDK1.2] powerpc/p1010rdb: add readme document for p1010rdb

2012-04-28 Thread Shengzhou Liu
Signed-off-by: Shengzhou Liu 
---
 doc/README.p1010rdb |  147 +++
 1 files changed, 147 insertions(+), 0 deletions(-)
 create mode 100644 doc/README.p1010rdb

diff --git a/doc/README.p1010rdb b/doc/README.p1010rdb
new file mode 100644
index 000..5979f82
--- /dev/null
+++ b/doc/README.p1010rdb
@@ -0,0 +1,147 @@
+Overview
+=
+The P1010RDB is a Freescale reference design board that hosts the P1010 SoC.
+
+The P1010 is a cost-effective, low-power, highly integrated host processor
+based on a Power Architecture e500v2 core (maximum core frequency 800/1000 
MHz),
+that addresses the requirements of several routing, gateways, storage, 
consumer,
+and industrial applications. Applications of interest include the main CPUs and
+I/O processors in network attached storage (NAS), the voice over IP (VoIP)
+router/gateway, and wireless LAN (WLAN) and industrial controllers.
+
+The P1010RDB board features are as follows:
+Memory subsystem:
+   — 1Gbyte unbuffered DDR3 SDRAM discrete devices (32-bit bus)
+   — 32 Mbyte NOR flash single-chip memory
+   — 32 Mbyte NAND flash memory
+   — 256 Kbit M24256 I2C EEPROM
+   — 16 Mbyte SPI memory
+   — I2C Board EEPROM 128x8 bit memory
+   — SD/MMC connector to interface with the SD memory card
+Interfaces:
+   — PCIe:
+   – Lane0: x1 mini-PCIe slot
+   – Lane1: x1 PCIe standard slot
+   — SATA:
+   – 1 internal SATA connector to 2.5” 160G SATA2 HDD
+   – 1 eSATA connector to rear panel
+   — 10/100/1000 BaseT Ethernet ports:
+   – eTSEC1, RGMII: one 10/100/1000 port using Vitesse VSC8641XKO
+   – eTSEC2, SGMII: one 10/100/1000 port using Vitesse VSC8221
+   – eTSEC3, SGMII: one 10/100/1000 port using Vitesse VSC8221
+   — USB 2.0 port:
+   – x1 USB2.0 port: via an ULPI PHY to micro-AB connector
+   – x1 USB2.0 poort via an internal PHY to micro-AB connector
+   — FlexCAN ports:
+   – x2 DB-9 female connectors for FlexCAN bus(revision 2.0B)
+  interface;
+   — DUART interface:
+   – DUART interface: supports two UARTs up to 115200 bps for
+  console display
+   – RJ45 connectors are used for these 2 UART ports.
+   — TDM
+   – 2 FXS ports connected via an external SLIC to the TDM
+  interface. SLIC is controllled via SPI.
+   – 1 FXO port connected via a relay to FXS for switchover to
+  POTS
+Board connectors:
+   — Mini-ITX power supply connector
+   — JTAG/COP for debugging
+IEEE Std. 1588 signals for test and measurement
+Real-time clock on I2C bus
+POR
+   — support critical POR setting changed via switch on board
+PCB
+   — 6-layer routing (4-layer signals, 2-layer power and ground)
+
+
+
+Settings of DIP-switch
+==
+  SW4[1:4]=  and SW6[4]=0 for boot from 16bit NOR flash
+  SW4[1:4]= 1000 and SW6[4]=1 for boot from 8bit NAND flash
+  SW4[1:4]= 0110 and SW6[4]=0 for boot from SPI flash
+Note: 1 stands for 'on', 0 stands for 'off'
+
+Please refer to P1010-RDB User Guide for details.
+
+
+Setting of hwconfig
+===
+If FlexCAN or TDM is needed, please set "fsl_p1010mux:tdm_can=can" or
+"fsl_p1010mux:tdm_can=tdm" explicitly in u-booot prompt as below for example:
+setenv hwconfig "fsl_p1010mux:tdm_can=tdm;usb1:dr_mode=host,phy_type=utmi"
+By default, don't set fsl_p1010mux:tdm_can, in this case, spi chip selection
+is set to spi-flash instead of to SLIC/TDM/DAC and tdm_can_sel is set to TDM
+instead of to CAN/UART1.
+
+
+Build and burn u-boot to NOR flash
+===
+1. Build u-boot.bin image
+   export ARCH=powerpc
+   export CROSS_COMPILE=/your_path/powerpc-linux-gnu-
+   make P1010RDB_NOR
+
+2. Burn u-boot.bin into NOR flash
+   => tftp 100 u-boot.bin
+   => protect off all
+   => erase eff8 efff
+   => cp.b 100 eff8 8
+3. Check SW4[1:4]=  and SW6[4]=0, then power on.
+
+
+Build and burn u-boot to NAND flash
+
+1. Build u-boot.bin image
+   export ARCH=powerpc
+   export CROSS_COMPILE=/your_path/powerpc-linux-gnu-
+   make P1010RDB_NAND
+
+2. Burn u-boot-nand.bin into NAND flash
+   => tftp 100 u-boot-nand.bin
+   => nand erase 0 8
+   => nand write 100 0 8
+
+3. Check SW4[1:4]= 1000 and SW6[4]=1, then power on.
+
+
+
+Build and burn u-boot to SPI flash
+===
+1. Build u-boot-spi.bin image
+   make P1010RDB_SPIFLASH_config; make
+   Boot up kernel with rootfs.ext2.gz.uboot.p1010rdb
+   Download u-boot.bin to linux and you can find some config files
+   under /usr/share such as config_xx.dat. Do below co

Re: [U-Boot] [PATCH v3 0/7] tegra: Add NAND flash support

2012-04-28 Thread Thierry Reding
* Stephen Warren wrote:
> On 04/26/2012 11:10 PM, Thierry Reding wrote:
> > * Stephen Warren wrote:
> >> On 04/26/2012 12:32 PM, Thierry Reding wrote:
> >>> The problem is that neither the format of the BCT nor that of the PT is
> >>> documented anywhere. It seems like the BCT contains a reference to where 
> >>> in
> >>> the flash the PT starts but I wasn't able to find out where.
> ...
> >>> As I said before, the biggest problem with updating the whole content is 
> >>> that
> >>> there's no documentation about either the BCT or the PT. There's 
> >>> cbootimage
> >>> on gitorious that has some information about the BCT, but it's incomplete.
> >>
> >> Out of curiosity, what's missing from cbootimage?
> > 
> > It's missing support for PT. That may not be necessary in a setup where we
> > initialize the NAND from Linux user space, though, so maybe it would be
> > enough.
> 
> I don't believe the Tegra boot process actually /requires/ the PT even
> exist. IIRC, the boot ROM searches for the BCT, and the BCT contains a
> pointer to the bootloader (e.g. U-Boot), so it's only at a later stage
> in the game that anything would care about the PT. As such, worrying
> about the PT (or even including it) may be pointless.

After digging into this some more, I get the same impression. PT seems
entirely optional. Information about the bootloader seems to be stored within
the BCT.

> I believe that TrimSlice's firmware recovery SD card images are created
> solely using cbootimage, and hence most likely have no PT, although
> obviously no additional partitions/file-systems on the media.

It looks like cbootimage does have support for generating the bootloader
bits, so maybe I can get this to work.

> Perhaps you could define some hard-coded "MTD" partitions (e.g. the
> first 1MB and the rest), where the first 1MB contains BCT + U-Boot and
> the rest contains a regular MBR or GPT partition table. I /think/ there
> may even be a kernel command-line option to define the MTD partition layout?
> 
> Or, you could probably even get away with using a GPT for the entire
> NAND by placing just the secondary GPT at the end of the NAND, putting
> the BCT+U-Boot right at the start, and defining a GPT partition to
> protect/cover BCT+U-Boot. I vaguely recall trying this on some Tegra
> device, but I may be wrong.

I didn't even know that you could put an MBR or GPT onto NAND. I was under
the impression that the only way to partition flash was via MTD partitions.
I'll have to see if I can make such a setup work.

Thierry


pgpSe8qrANJsD.pgp
Description: PGP signature
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH, V2] Resend: i.MX6: add enable_sata_clock()

2012-04-28 Thread Dirk Behme

Hi Eric,

first, do you really want the "Resend" in the subject?

On 26.04.2012 01:48, Eric Nelson wrote:

This patch requires Stefano's driver for MX5/MX6 to be useful.
http://lists.denx.de/pipermail/u-boot/2012-February/118530.html

This is the first and board-independent part of what's needed to enable
SATA on an i.MX6 board as discussed in this thread:
http://lists.denx.de/pipermail/u-boot/2012-March/120919.html

Signed-off-by: Eric Nelson

---
V2 updated to return -EIO instead of -1.

  arch/arm/cpu/armv7/mx6/clock.c   |   31 
  arch/arm/include/asm/arch-mx6/clock.h|1 +
  arch/arm/include/asm/arch-mx6/imx-regs.h |9 +++
  arch/arm/include/asm/arch-mx6/iomux-v3.h |  111 ++
  4 files changed, 152 insertions(+), 0 deletions(-)

diff --git a/arch/arm/cpu/armv7/mx6/clock.c b/arch/arm/cpu/armv7/mx6/clock.c
index ef98563..de91cac 100644
--- a/arch/arm/cpu/armv7/mx6/clock.c
+++ b/arch/arm/cpu/armv7/mx6/clock.c
@@ -303,6 +303,37 @@ u32 imx_get_fecclk(void)
return decode_pll(PLL_ENET, CONFIG_SYS_MX6_HCLK);
  }

+int enable_sata_clock(void)
+{
+   u32 reg = 0;
+   s32 timeout = 10;
+   struct imx_ccm_reg *const imx_ccm
+   = (struct imx_ccm_reg *) CCM_BASE_ADDR;


Could you check if the file clock.c has already a global

struct imx_ccm_reg *imx_ccm = (struct imx_ccm_reg *)CCM_BASE_ADDR;

definition, so this redefinition of "struct imx_ccm_reg *const 
imx_ccm" should (must?) be removed here? See


http://git.denx.de/cgi-bin/gitweb.cgi?p=u-boot.git;a=blob;f=arch/arm/cpu/armv7/mx6/clock.c;h=ef98563ff7639a3895e5dc00acd9cc30bb3c6772;hb=HEAD#l37

Trying to compile this I had to remove this on my test branch [1].

Best regards

Dirk

[1] 
https://github.com/dirkbehme/u-boot-imx6/commit/543964ad861b8143c142df3bb0f914ef2aee7558#L0R309


___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH V3] i.MX6: mx6q_sabrelite: add SATA bindings

2012-04-28 Thread Dirk Behme

Hi Eric,

On 26.04.2012 01:50, Eric Nelson wrote:

Signed-off-by: Eric Nelson

---
V2 has been stripped of the board-independent changes and
uses clrsetbits_le32() instead of twiddling bits by hand.

V3 returns immediately from setup_sata() if enable_sata_clock()
returns an error.

  board/freescale/mx6qsabrelite/mx6qsabrelite.c |   32 +
  include/configs/mx6qsabrelite.h   |   13 ++
  2 files changed, 45 insertions(+), 0 deletions(-)

diff --git a/board/freescale/mx6qsabrelite/mx6qsabrelite.c 
b/board/freescale/mx6qsabrelite/mx6qsabrelite.c
index 1d09a72..c9a108f 100644
--- a/board/freescale/mx6qsabrelite/mx6qsabrelite.c
+++ b/board/freescale/mx6qsabrelite/mx6qsabrelite.c
@@ -25,6 +25,8 @@
  #include
  #include
  #include
+#include


Do we need ccm_regs.h here?

Best regards

Dirk
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] video: cfb_console: flush dcache for frame buffer in DRAM

2012-04-28 Thread Anatolij Gustschin
Data cache flushing is required for frame buffer in RAM to fix the
distorted console text output. Currently this text distortion is
observed with cfb on beageboard and N900 when running with data
cache enabled.

Reported-by: Pali Rohár 
Signed-off-by: Anatolij Gustschin 
---
 drivers/video/cfb_console.c |   35 +++
 1 files changed, 35 insertions(+), 0 deletions(-)

diff --git a/drivers/video/cfb_console.c b/drivers/video/cfb_console.c
index 904caf7..dd7ccb7 100644
--- a/drivers/video/cfb_console.c
+++ b/drivers/video/cfb_console.c
@@ -360,6 +360,8 @@ void console_cursor(int state);
 extern void video_get_info_str(int line_number,char *info);
 #endif
 
+DECLARE_GLOBAL_DATA_PTR;
+
 /* Locals */
 static GraphicDevice *pGD; /* Pointer to Graphic array */
 
@@ -377,6 +379,8 @@ static int console_row; /* cursor row */
 
 static u32 eorx, fgx, bgx; /* color pats */
 
+static int cfb_do_flush_cache;
+
 static const int video_font_draw_table8[] = {
0x, 0x00ff, 0xff00, 0x,
0x00ff, 0x00ff00ff, 0x0000, 0x00ff,
@@ -553,6 +557,8 @@ static void video_drawchars(int xx, int yy, unsigned char 
*s, int count)
SWAP32((video_font_draw_table32
[bits & 15][3] & eorx) ^ bgx);
}
+   if (cfb_do_flush_cache)
+   flush_cache((ulong)dest0, 32);
dest0 += VIDEO_FONT_WIDTH * VIDEO_PIXEL_SIZE;
s++;
}
@@ -621,6 +627,8 @@ static void video_invertchar(int xx, int yy)
for (x = firstx; x < lastx; x++) {
u8 *dest = (u8 *)(video_fb_address) + x + y;
*dest = ~*dest;
+   if (cfb_do_flush_cache)
+   flush_cache((ulong)dest, 4);
}
}
 }
@@ -717,6 +725,8 @@ static void console_scrollup(void)
 #else
memsetl(CONSOLE_ROW_LAST, CONSOLE_ROW_SIZE >> 2, CONSOLE_BG_COL);
 #endif
+   if (cfb_do_flush_cache)
+   flush_cache((ulong)CONSOLE_ROW_FIRST, CONSOLE_SIZE);
 }
 
 static void console_back(void)
@@ -1651,6 +1661,29 @@ static void *video_logo(void)
 }
 #endif
 
+static int cfb_fb_is_in_dram(void)
+{
+   bd_t *bd = gd->bd;
+   ulong start, end;
+   int i;
+
+   for (i = 0; i < CONFIG_NR_DRAM_BANKS; ++i) {
+#if defined(CONFIG_ARM) || defined(CONFIG_AVR32) || defined(COFNIG_NDS32) || \
+defined(CONFIG_SANDBOX) || defined(CONFIG_X86)
+   start = bd->bi_dram[i].start;
+   end = bd->bi_dram[i].start + bd->bi_dram[i].size - 1;
+#else
+   start = bd->bi_memstart;
+   end = bd->bi_memsize;
+#endif
+
+   if ((ulong)video_fb_address >= start &&
+   (ulong)video_fb_address < end)
+   return 1;
+   }
+   return 0;
+}
+
 static int video_init(void)
 {
unsigned char color8;
@@ -1664,6 +1697,8 @@ static int video_init(void)
video_init_hw_cursor(VIDEO_FONT_WIDTH, VIDEO_FONT_HEIGHT);
 #endif
 
+   cfb_do_flush_cache = cfb_fb_is_in_dram() && dcache_status();
+
/* Init drawing pats */
switch (VIDEO_DATA_FORMAT) {
case GDF__8BIT_INDEX:
-- 
1.7.1

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 05/14] cfb_console: Fix function console_scrollup

2012-04-28 Thread Anatolij Gustschin
On Thu, 26 Apr 2012 23:50:57 +0200
Pali Rohár  wrote:

> On Thursday 26 April 2012 23:45:52 Anatolij Gustschin wrote:
> > Hi,
> > 
> > On Tue, 24 Jan 2012 15:28:02 +0100
> > 
> > Pali Rohár  wrote:
> > >  * Use correct buffer size, do not damage screen output
> > 
> > It seems that I can reproduce similar problem on the
> > beagleboard now. Will try to debug and find a solution for it.
> 
> Ok, thanks! I played a lot of with u-boot on nokia n900, but I 
> did not find reason...

Probably the issue is caused by cached frame buffer data. This [1]
patch is supposed to fix it. Could you please test it on N900?
Additional cache flushing also needs to be added to your extensions
for cfb_console to fix the menu output.

Thanks,
Anatolij

[1] http://patchwork.ozlabs.org/patch/155662/
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH, V2] Resend: i.MX6: add enable_sata_clock()

2012-04-28 Thread Eric Nelson

On 04/28/2012 07:42 AM, Dirk Behme wrote:

Hi Eric,

first, do you really want the "Resend" in the subject?

On 26.04.2012 01:48, Eric Nelson wrote:

This patch requires Stefano's driver for MX5/MX6 to be useful.
http://lists.denx.de/pipermail/u-boot/2012-February/118530.html

This is the first and board-independent part of what's needed to enable
SATA on an i.MX6 board as discussed in this thread:
http://lists.denx.de/pipermail/u-boot/2012-March/120919.html

Signed-off-by: Eric Nelson

---
V2 updated to return -EIO instead of -1.

arch/arm/cpu/armv7/mx6/clock.c | 31 
arch/arm/include/asm/arch-mx6/clock.h | 1 +
arch/arm/include/asm/arch-mx6/imx-regs.h | 9 +++
arch/arm/include/asm/arch-mx6/iomux-v3.h | 111 ++
4 files changed, 152 insertions(+), 0 deletions(-)

diff --git a/arch/arm/cpu/armv7/mx6/clock.c b/arch/arm/cpu/armv7/mx6/clock.c
index ef98563..de91cac 100644
--- a/arch/arm/cpu/armv7/mx6/clock.c
+++ b/arch/arm/cpu/armv7/mx6/clock.c
@@ -303,6 +303,37 @@ u32 imx_get_fecclk(void)
return decode_pll(PLL_ENET, CONFIG_SYS_MX6_HCLK);
}

+int enable_sata_clock(void)
+{
+ u32 reg = 0;
+ s32 timeout = 10;
+ struct imx_ccm_reg *const imx_ccm
+ = (struct imx_ccm_reg *) CCM_BASE_ADDR;


Could you check if the file clock.c has already a global

struct imx_ccm_reg *imx_ccm = (struct imx_ccm_reg *)CCM_BASE_ADDR;

definition, so this redefinition of "struct imx_ccm_reg *const imx_ccm" should
(must?) be removed here? See

http://git.denx.de/cgi-bin/gitweb.cgi?p=u-boot.git;a=blob;f=arch/arm/cpu/armv7/mx6/clock.c;h=ef98563ff7639a3895e5dc00acd9cc30bb3c6772;hb=HEAD#l37

Trying to compile this I had to remove this on my test branch [1].



Hi Dirk,

I tried to address this global/non-const by making it explicitly public,
but Stefano nacked the patch:
http://patchwork.ozlabs.org/patch/144712/

As it stands, the compiler won't generate an external reference for the
local above, so it should be good.

The global/writable/not published variable imx_ccm should be fixed though.
At least it should be static if it's not exposed through a header and
const so it isn't placed in the BSS segment.

I'll generate a patch later today.

Regards,


Eric
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH V3] i.MX6: mx6q_sabrelite: add SATA bindings

2012-04-28 Thread Eric Nelson

Hi Dirk,

On 04/28/2012 07:51 AM, Dirk Behme wrote:

Hi Eric,

On 26.04.2012 01:50, Eric Nelson wrote:

Signed-off-by: Eric Nelson

---
V2 has been stripped of the board-independent changes and
uses clrsetbits_le32() instead of twiddling bits by hand.

V3 returns immediately from setup_sata() if enable_sata_clock()
returns an error.

board/freescale/mx6qsabrelite/mx6qsabrelite.c | 32 +
include/configs/mx6qsabrelite.h | 13 ++
2 files changed, 45 insertions(+), 0 deletions(-)

diff --git a/board/freescale/mx6qsabrelite/mx6qsabrelite.c
b/board/freescale/mx6qsabrelite/mx6qsabrelite.c
index 1d09a72..c9a108f 100644
--- a/board/freescale/mx6qsabrelite/mx6qsabrelite.c
+++ b/board/freescale/mx6qsabrelite/mx6qsabrelite.c
@@ -25,6 +25,8 @@
#include
#include
#include
+#include


Do we need ccm_regs.h here?



Nope. Good catch.

I'll generate a V4 in a day or two to allow some other review.

Stefano, what's the status of the dwc_ahsata driver?

Without that, the bindings are clearly useless.

Regards,


Eric
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] video: cfb_console: flush dcache for frame buffer in DRAM

2012-04-28 Thread Pali Rohár
On Saturday 28 April 2012 17:04:07 you wrote:
> Data cache flushing is required for frame buffer in RAM to fix
> the distorted console text output. Currently this text
> distortion is observed with cfb on beageboard and N900 when
> running with data cache enabled.
>
> Reported-by: Pali Rohár 
> Signed-off-by: Anatolij Gustschin 

Tested-by: Pali Rohár 

--
Pali Rohár
pali.ro...@gmail.com

signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 05/14] cfb_console: Fix function console_scrollup

2012-04-28 Thread Pali Rohár
On Saturday 28 April 2012 17:11:51 Anatolij Gustschin wrote:
> On Thu, 26 Apr 2012 23:50:57 +0200
>
> Pali Rohár  wrote:
> > On Thursday 26 April 2012 23:45:52 Anatolij Gustschin wrote:
> > > Hi,
> > >
> > > On Tue, 24 Jan 2012 15:28:02 +0100
> > >
> > > Pali Rohár  wrote:
> > > >  * Use correct buffer size, do not damage screen output
> > >
> > > It seems that I can reproduce similar problem on the
> > > beagleboard now. Will try to debug and find a solution for
> > > it.
> >
> > Ok, thanks! I played a lot of with u-boot on nokia n900, but
> > I
> > did not find reason...
>
> Probably the issue is caused by cached frame buffer data. This
> [1] patch is supposed to fix it. Could you please test it on
> N900? Additional cache flushing also needs to be added to your
> extensions for cfb_console to fix the menu output.
>
> Thanks,
> Anatolij
>
> [1] http://patchwork.ozlabs.org/patch/155662/

Hi, your patch fixing this problem. Thanks!

--
Pali Rohár
pali.ro...@gmail.com

signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2 00/11] Nokia RX-51 support

2012-04-28 Thread Pali Rohár
This patch series add support for new board Nokia RX-51 (aka N900).
This patch series supersedes version v1. It was rebased on top of
u-boot master and in this version was dropped BootMenu support.

Patch details:

Already commited (dropped) patches:
  arm,omap3: Define save_boot_params in lowlevel_init.S for SPL only

Dropped patches:
  Fix function readline in main.c
  cfb_console: Fix function console_scrollup
  New config variable CONFIG_MENUCMD
  New command bootmenu: ANSI terminal Boot Menu support
  RX-51: Add support for bootmenu

New patches:
  cfb_console: Fix function console_back
  cfb_console: Ignore bell character
  video: cfb_console: flush dcache for frame buffer in DRAM

Anatolij Gustschin (1):
  video: cfb_console: flush dcache for frame buffer in DRAM

Pali Rohár (10):
  arm: Optionally use existing atags in bootm.c
  Add power bus message definitions in twl4030.h
  cfb_console: Fix function console_back
  cfb_console: Add function console_clear and console_clear_line
  cfb_console: Add functions for moving with cursor
  cfb_console: Add support for some ANSI terminal escape codes
  cfb_console: Ignore bell character
  New command clear: Clear the ANSI terminal
  New config variable CONFIG_PREMONITOR
  New board support: Nokia RX-51 aka N900

 README   |5 +
 arch/arm/lib/bootm.c |   60 +++---
 board/nokia/rx51/Makefile|   46 +
 board/nokia/rx51/lowlevel_init.S |   71 +++
 board/nokia/rx51/rx51.c  |  380 +++
 board/nokia/rx51/rx51.h  |  378 +++
 boards.cfg   |1 +
 common/Makefile  |1 +
 common/cmd_clear.c   |   42 
 common/env_common.c  |3 +
 common/main.c|4 +
 drivers/video/cfb_console.c  |  404 +++---
 include/common.h |7 +
 include/config_cmd_all.h |1 +
 include/configs/nokia_rx51.h |  373 +++
 include/twl4030.h|   98 +
 16 files changed, 1829 insertions(+), 45 deletions(-)
 create mode 100644 board/nokia/rx51/Makefile
 create mode 100644 board/nokia/rx51/lowlevel_init.S
 create mode 100644 board/nokia/rx51/rx51.c
 create mode 100644 board/nokia/rx51/rx51.h
 create mode 100644 common/cmd_clear.c
 create mode 100644 include/configs/nokia_rx51.h

-- 
1.7.9.5

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2 02/11] Add power bus message definitions in twl4030.h

2012-04-28 Thread Pali Rohár
* Code copied from linux kernel 3.0.0 from file include/linux/i2c/twl.h

Signed-off-by: Pali Rohár 
---
Changes since original version:
   - Fixed commit message

 include/twl4030.h |   98 +
 1 file changed, 98 insertions(+)

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_RES0x0 /* 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_ALL0x7 /* 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_SLEEP0x8
+#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_VSIM9
+#define RES_VDAC10
+#define RES_VINTANA111
+#define RES_VINTANA212
+#define RES_VINTDIG 13
+#define RES_VIO 14
+#define RES_VDD115
+#define RES_VDD216
+#define RES_VUSB_1V517
+#define RES_VUSB_1V818
+#define RES_VUSB_3V119
+#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_HFCLKOUT25
+#define RES_32KCLKOUT   26
+#define RES_RESET   27
+/* Power Reference */
+#define RES_Main_Ref28
+
+#define TOTAL_RESOURCES28
+/*
+ * 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
-- 
1.7.9.5

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2 01/11] arm: Optionally use existing atags in bootm.c

2012-04-28 Thread Pali Rohár
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 
0x8100:

setenv atagaddr 0x8100; bootm 0x80008000

Signed-off-by: Pali Rohár 
---
Changes since v1:
   - Rebased on u-boot master

Changes since original version:
   - Added info to README file
   - Added local define CONFIG_SETUP_ANY_TAG
   - Fixed compile warning
   - Fixed commit message
   - Check if atagaddr is not NULL

 README   |2 ++
 arch/arm/lib/bootm.c |   60 --
 2 files changed, 40 insertions(+), 22 deletions(-)

diff --git a/README b/README
index 43074cf..60ad9c2 100644
--- a/README
+++ b/README
@@ -3687,6 +3687,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 599547d..0f3c97b 100644
--- a/arch/arm/lib/bootm.c
+++ b/arch/arm/lib/bootm.c
@@ -42,6 +42,10 @@ DECLARE_GLOBAL_DATA_PTR;
defined(CONFIG_INITRD_TAG) || \
defined(CONFIG_SERIAL_TAG) || \
defined(CONFIG_REVISION_TAG)
+   #define CONFIG_SETUP_ANY_TAG
+#endif
+
+#ifdef CONFIG_SETUP_ANY_TAG
 static struct tag *params;
 #endif
 
@@ -106,11 +110,7 @@ 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)
+#ifdef CONFIG_SETUP_ANY_TAG
 static void setup_start_tag (bd_t *bd)
 {
params = (struct tag *)bd->bi_boot_params;
@@ -217,11 +217,7 @@ void setup_revision_tag(struct tag **in_params)
 }
 #endif
 
-#if defined(CONFIG_SETUP_MEMORY_TAGS) || \
-   defined(CONFIG_CMDLINE_TAG) || \
-   defined(CONFIG_INITRD_TAG) || \
-   defined(CONFIG_SERIAL_TAG) || \
-   defined(CONFIG_REVISION_TAG)
+#ifdef CONFIG_SETUP_ANY_TAG
 static void setup_end_tag(bd_t *bd)
 {
params->hdr.tag = ATAG_NONE;
@@ -280,13 +276,23 @@ static void boot_prep_linux(bootm_headers_t *images)
} else
 #endif
{
-#if defined(CONFIG_SETUP_MEMORY_TAGS) || \
-   defined(CONFIG_CMDLINE_TAG) || \
-   defined(CONFIG_INITRD_TAG) || \
-   defined(CONFIG_SERIAL_TAG) || \
-   defined(CONFIG_REVISION_TAG)
+   char *atagaddr = getenv("atagaddr");
debug("using: ATAGS\n");
-   setup_start_tag(gd->bd);
+
+   if (atagaddr)
+   gd->bd->bi_boot_params = simple_strtoul(atagaddr, NULL, 
16);
+
+   if (gd->bd->bi_boot_params) {
+   printf("Using existing atags at %#lx\n", 
gd->bd->bi_boot_params);
+
+   params = (struct tag *) gd->bd->bi_boot_params;
+   while (params->hdr.size > 0)
+   params = tag_next(params);
+   } else {
+#ifdef CONFIG_SETUP_ANY_TAG
+   setup_start_tag(gd->bd);
+#endif
+   }
 #ifdef CONFIG_SERIAL_TAG
setup_serial_tag(¶ms);
 #endif
@@ -297,18 +303,28 @@ static void boot_prep_linux(bootm_headers_t *images)
setup_revision_tag(¶ms);
 #endif
 #ifdef CONFIG_SETUP_MEMORY_TAGS
-   setup_memory_tags(gd->bd);
+   if (!atagaddr)
+   setup_memory_tags(gd->bd);
 #endif
 #ifdef CONFIG_INITRD_TAG
if (images->rd_start && images->rd_end)
setup_initrd_tag(gd->bd, images->rd_start,
images->rd_end);
 #endif
-   setup_end_tag(gd->bd);
-#else /* all tags */
-   printf("FDT and ATAGS support not compiled in - hanging\n");
-   hang();
-#endif /* all tags */
+   if (atagaddr) {
+   if (params->hdr.size > 0)
+   setup_end_tag(gd->bd);
+   } else {
+#ifdef CONFIG_SETUP_ANY_TAG
+   setup_end_tag(gd->bd);
+#endif
+   }
+#ifndef CONFIG_SETUP_ANY_TAG
+   if (!atagaddr) {
+   printf("FDT and ATAGS support not compiled in - 
hanging\n");
+   hang();
+   }
+#endif
}
 }
 
-- 
1.7.9.5

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2 04/11] cfb_console: Add function console_clear and console_clear_line

2012-04-28 Thread Pali Rohár
 * console_clear - clear full console framebuffer output
 * console_clear_line - clear part of specified line (or full)

Signed-off-by: Pali Rohár 
---
Changes since original version:
   - Fixed commit message

 drivers/video/cfb_console.c |   64 +++
 1 file changed, 52 insertions(+), 12 deletions(-)

diff --git a/drivers/video/cfb_console.c b/drivers/video/cfb_console.c
index 51ea167..0d1e6b2 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)
-- 
1.7.9.5

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2 05/11] cfb_console: Add functions for moving with cursor

2012-04-28 Thread Pali Rohár
 * 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 
---
Changes since original version:
   - Fixed commit message

 drivers/video/cfb_console.c |   64 +++
 1 file changed, 58 insertions(+), 6 deletions(-)

diff --git a/drivers/video/cfb_console.c b/drivers/video/cfb_console.c
index 0d1e6b2..43eb994 100644
--- a/drivers/video/cfb_console.c
+++ b/drivers/video/cfb_console.c
@@ -771,9 +771,54 @@ static void console_back(void)
}
 }
 
-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 */
@@ -782,10 +827,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;
@@ -804,7 +856,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;
 
@@ -813,7 +865,7 @@ void video_putc(const char c)
console_col &= ~0x0007;
 
if (console_col >= CONSOLE_COLS)
-   console_newline();
+   console_newline(1);
break;
 
case 8: /* backspace */
@@ -827,7 +879,7 @@ void video_putc(const char c)
 
/* check for newline */
if (console_col >= CONSOLE_COLS) {
-   console_newline();
+   console_newline(1);
nl = 0;
}
}
-- 
1.7.9.5

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2 03/11] cfb_console: Fix function console_back

2012-04-28 Thread Pali Rohár
 * Do not disable and enable cursor again

Signed-off-by: Pali Rohár 
---
 drivers/video/cfb_console.c |2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/video/cfb_console.c b/drivers/video/cfb_console.c
index 904caf7..51ea167 100644
--- a/drivers/video/cfb_console.c
+++ b/drivers/video/cfb_console.c
@@ -721,7 +721,6 @@ static void console_scrollup(void)
 
 static void console_back(void)
 {
-   CURSOR_OFF;
console_col--;
 
if (console_col < 0) {
@@ -730,7 +729,6 @@ static void console_back(void)
if (console_row < 0)
console_row = 0;
}
-   CURSOR_SET;
 }
 
 static void console_newline(void)
-- 
1.7.9.5

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2 06/11] cfb_console: Add support for some ANSI terminal escape codes

2012-04-28 Thread Pali Rohár
 * 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 
---
Changes since v1:
   - Added support ANSI code show/hide cursor
   - Added info to README

Changes since original version:
   - Fixed commit message

 README  |3 +
 drivers/video/cfb_console.c |  234 ++-
 2 files changed, 234 insertions(+), 3 deletions(-)

diff --git a/README b/README
index 60ad9c2..4a610f7 100644
--- a/README
+++ b/README
@@ -613,6 +613,9 @@ The following options need to be configured:
additional board info beside
the logo
 
+   When CONFIG_CFB_CONSOLE_ANSI is defined, console will have
+   ANSI terminal support. Needed for CONFIG_CMDLINE_EDITING.
+
When CONFIG_CFB_CONSOLE is defined, video console is
default i/o. Serial console can be forced with
environment 'console=serial'.
diff --git a/drivers/video/cfb_console.c b/drivers/video/cfb_console.c
index 43eb994..c9f9765 100644
--- a/drivers/video/cfb_console.c
+++ b/drivers/video/cfb_console.c
@@ -377,6 +377,11 @@ 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 int ansi_cursor_hidden;
+
 static const int video_font_draw_table8[] = {
0x, 0x00ff, 0xff00, 0x,
0x00ff, 0x00ff00ff, 0x0000, 0x00ff,
@@ -602,6 +607,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)
 {
@@ -843,11 +856,12 @@ 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;
 
-   CURSOR_OFF;
+   if (!ansi_cursor_hidden)
+   CURSOR_OFF;
 
switch (c) {
case 13:/* back to first column */
@@ -883,7 +897,221 @@ void video_putc(const char c)
nl = 0;
}
}
-   CURSOR_SET;
+
+   if (!ansi_cursor_hidden)
+   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 if (ansi_buf[i] != '?') {
+   --i;
+   num1 = 1;
+   next = 4;
+   }
+   break;
+
+   case 3:
+   if (ansi_buf[i] >= '0' && ansi_buf[i] <= '9') {
+   num1 *= 10;
+   num1 += ansi_b

[U-Boot] [PATCH v2 07/11] cfb_console: Ignore bell character

2012-04-28 Thread Pali Rohár
Signed-off-by: Pali Rohár 
---
 drivers/video/cfb_console.c |3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/video/cfb_console.c b/drivers/video/cfb_console.c
index c9f9765..dae2178 100644
--- a/drivers/video/cfb_console.c
+++ b/drivers/video/cfb_console.c
@@ -886,6 +886,9 @@ static void parse_putc(const char c)
console_back();
break;
 
+   case 7: /* bell */
+   break;  /* ignored */
+
default:/* draw the char */
video_putchar(console_col * VIDEO_FONT_WIDTH,
  console_row * VIDEO_FONT_HEIGHT, c);
-- 
1.7.9.5

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2 08/11] video: cfb_console: flush dcache for frame buffer in DRAM

2012-04-28 Thread Pali Rohár
From: Anatolij Gustschin 

Data cache flushing is required for frame buffer in RAM to fix the
distorted console text output. Currently this text distortion is
observed with cfb on beageboard and N900 when running with data
cache enabled.

Reported-by: Pali Rohár 
Tested-by: Pali Rohár 
Signed-off-by: Anatolij Gustschin 
---
Changes since original version:
   - Rebased on Nokia RX-51 patch series
   - Call flush_cache in console_clear too

 drivers/video/cfb_console.c |   37 +
 1 file changed, 37 insertions(+)

diff --git a/drivers/video/cfb_console.c b/drivers/video/cfb_console.c
index dae2178..b8416d9 100644
--- a/drivers/video/cfb_console.c
+++ b/drivers/video/cfb_console.c
@@ -360,6 +360,8 @@ void console_cursor(int state);
 extern void video_get_info_str(int line_number,char *info);
 #endif
 
+DECLARE_GLOBAL_DATA_PTR;
+
 /* Locals */
 static GraphicDevice *pGD; /* Pointer to Graphic array */
 
@@ -382,6 +384,8 @@ static int ansi_buf_size;
 static int ansi_colors_need_revert;
 static int ansi_cursor_hidden;
 
+static int cfb_do_flush_cache;
+
 static const int video_font_draw_table8[] = {
0x, 0x00ff, 0xff00, 0x,
0x00ff, 0x00ff00ff, 0x0000, 0x00ff,
@@ -558,6 +562,8 @@ static void video_drawchars(int xx, int yy, unsigned char 
*s, int count)
SWAP32((video_font_draw_table32
[bits & 15][3] & eorx) ^ bgx);
}
+   if (cfb_do_flush_cache)
+   flush_cache((ulong)dest0, 32);
dest0 += VIDEO_FONT_WIDTH * VIDEO_PIXEL_SIZE;
s++;
}
@@ -634,6 +640,8 @@ static void video_invertchar(int xx, int yy)
for (x = firstx; x < lastx; x++) {
u8 *dest = (u8 *)(video_fb_address) + x + y;
*dest = ~*dest;
+   if (cfb_do_flush_cache)
+   flush_cache((ulong)dest, 4);
}
}
 }
@@ -709,6 +717,8 @@ static void console_clear(void)
 #else
memsetl(CONSOLE_ROW_FIRST, CONSOLE_SIZE, bgx);
 #endif
+   if (cfb_do_flush_cache)
+   flush_cache((ulong)CONSOLE_ROW_FIRST, CONSOLE_SIZE);
 }
 
 static void console_clear_line(int line, int begin, int end)
@@ -745,6 +755,8 @@ static void console_clear_line(int line, int begin, int end)
bgx /* fill color */
);
 #endif
+   if (cfb_do_flush_cache)
+   flush_cache((ulong)CONSOLE_ROW_FIRST, CONSOLE_SIZE);
 }
 
 static void console_scrollup(void)
@@ -1972,6 +1984,29 @@ static void *video_logo(void)
 }
 #endif
 
+static int cfb_fb_is_in_dram(void)
+{
+   bd_t *bd = gd->bd;
+   ulong start, end;
+   int i;
+
+   for (i = 0; i < CONFIG_NR_DRAM_BANKS; ++i) {
+#if defined(CONFIG_ARM) || defined(CONFIG_AVR32) || defined(COFNIG_NDS32) || \
+defined(CONFIG_SANDBOX) || defined(CONFIG_X86)
+   start = bd->bi_dram[i].start;
+   end = bd->bi_dram[i].start + bd->bi_dram[i].size - 1;
+#else
+   start = bd->bi_memstart;
+   end = bd->bi_memsize;
+#endif
+
+   if ((ulong)video_fb_address >= start &&
+   (ulong)video_fb_address < end)
+   return 1;
+   }
+   return 0;
+}
+
 static int video_init(void)
 {
unsigned char color8;
@@ -1985,6 +2020,8 @@ static int video_init(void)
video_init_hw_cursor(VIDEO_FONT_WIDTH, VIDEO_FONT_HEIGHT);
 #endif
 
+   cfb_do_flush_cache = cfb_fb_is_in_dram() && dcache_status();
+
/* Init drawing pats */
switch (VIDEO_DATA_FORMAT) {
case GDF__8BIT_INDEX:
-- 
1.7.9.5

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2 09/11] New command clear: Clear the ANSI terminal

2012-04-28 Thread Pali Rohár
 * Command can be enabled by CONFIG_CMD_CLEAR
 * Added some ANSI escape codes definitions in common.h

Signed-off-by: Pali Rohár 
Cc: Marcel Mol 
---
Changes since original version:
   - Renamed command clr to clear
   - Use puts instead printf
   - Move cursor to pos1,1
   - Merged parts of patch "Add some ANSI escape codes definitions in common.h"

 common/Makefile  |1 +
 common/cmd_clear.c   |   42 ++
 include/common.h |7 +++
 include/config_cmd_all.h |1 +
 4 files changed, 51 insertions(+)
 create mode 100644 common/cmd_clear.c

diff --git a/common/Makefile b/common/Makefile
index d9f10f3..0682a49 100644
--- a/common/Makefile
+++ b/common/Makefile
@@ -70,6 +70,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 000..597611e
--- /dev/null
+++ b/common/cmd_clear.c
@@ -0,0 +1,42 @@
+/*
+ * Copyright 2011
+ * Marcel Mol, MESA Consulting, mar...@mesa.nl
+ *
+ * Copyright 2011
+ * Pali Rohár, pali.ro...@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 
+#include 
+
+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/common.h b/include/common.h
index 4b5841e..26bfd95 100644
--- a/include/common.h
+++ b/include/common.h
@@ -743,6 +743,13 @@ void   clear_ctrlc (void); /* clear the Control-C 
condition */
 intdisable_ctrlc (int);/* 1 to disable, 0 to enable Control-C detect */
 
 /*
+ * ANSI terminal
+ */
+
+#define ANSI_CURSOR_POSITION   "\e[%d;%dH"
+#define ANSI_CLEAR_CONSOLE "\e[2J"
+
+/*
  * STDIO based functions (can always be used)
  */
 /* serial stuff */
diff --git a/include/config_cmd_all.h b/include/config_cmd_all.h
index 2c6b829..243098a 100644
--- a/include/config_cmd_all.h
+++ b/include/config_cmd_all.h
@@ -24,6 +24,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 */
-- 
1.7.9.5

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2 10/11] New config variable CONFIG_PREMONITOR

2012-04-28 Thread Pali Rohár
 * if defined run env "premonitor" before Main Loop for Monitor Processing

Signed-off-by: Pali Rohár 
---
Changes since v1:
   - use run_command instead run_command2

Changes since original version:
   - removed #ifdef CONFIG_PREMONITOR in main.c

 common/env_common.c |3 +++
 common/main.c   |4 
 2 files changed, 7 insertions(+)

diff --git a/common/env_common.c b/common/env_common.c
index c33d22d..f1b2e3e 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 3b9e39a..aa5eb72 100644
--- a/common/main.c
+++ b/common/main.c
@@ -397,6 +397,10 @@ void main_loop (void)
 #endif /* CONFIG_MENUKEY */
 #endif /* CONFIG_BOOTDELAY */
 
+   s = getenv("premonitor");
+   if (s)
+   run_command(s, 0);
+
/*
 * Main Loop for Monitor Command Processing
 */
-- 
1.7.9.5

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] video: cfb_console: flush dcache for frame buffer in DRAM

2012-04-28 Thread Mike Frysinger
On Saturday 28 April 2012 11:04:07 Anatolij Gustschin wrote:
> +static int cfb_fb_is_in_dram(void)
> +{
> + bd_t *bd = gd->bd;
> + ulong start, end;
> + int i;
> +
> + for (i = 0; i < CONFIG_NR_DRAM_BANKS; ++i) {
> +#if defined(CONFIG_ARM) || defined(CONFIG_AVR32) || defined(COFNIG_NDS32)
> || \ +defined(CONFIG_SANDBOX) || defined(CONFIG_X86)
> + start = bd->bi_dram[i].start;
> + end = bd->bi_dram[i].start + bd->bi_dram[i].size - 1;
> +#else
> + start = bd->bi_memstart;
> + end = bd->bi_memsize;
> +#endif
> +
> + if ((ulong)video_fb_address >= start &&
> + (ulong)video_fb_address < end)
> + return 1;
> + }
> + return 0;
> +}

is this necessary ?  the cache funcs should take care of this automatically.
-mike


signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2 10/11] New config variable CONFIG_PREMONITOR

2012-04-28 Thread Wolfgang Denk
Dear =?UTF-8?q?Pali=20Roh=C3=A1r?=,

In message <1335634011-9104-11-git-send-email-pali.ro...@gmail.com> you wrote:
>  * if defined run env "premonitor" before Main Loop for Monitor Processing

What would be the difference compared to "preboot" ?

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
There are bugs and then there are bugs.  And then there are bugs.
- Karl Lehenbauer
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2 01/11] arm: Optionally use existing atags in bootm.c

2012-04-28 Thread Wolfgang Denk
Dear =?UTF-8?q?Pali=20Roh=C3=A1r?=,

In message <1335634011-9104-2-git-send-email-pali.ro...@gmail.com> you wrote:
> VGhpcyBwYXRjaCBhZGFwdHMgdGhlIGJvb3RtIGNvbW1hbmQgc28gdGhhdCBpdCBjYW4gdXNlIGFu
> IGV4aXN0aW5nIGF0YWdzIGNvbW1hbmQKc2V0IHVwIGJ5IGEgcHJldmlvdXMgYm9vdGxvYWRlci4g
> SWYgdGhlIGVudmlyb25tZW50IHZhcmlhYmxlICJhdGFnYWRkciIgaXMgdW5zZXQsCmJvb3RtIGJl
> aGF2ZXMgYXMgbm9ybWFsLiBJZiAiYXRhZ2FkZHIiIGlzIHNldCwgYm9vdG0gd2lsbCB1c2UgYXRh
> Z3MgYWRkcmVzcyBmcm9tCmVudmlyb25tZW50IHZhcmlhYmxlIGFuZCBhbHNvIGFwcGVuZCBuZXcg
...

Please stop posting your patches with base64 Content-transfer-encoding;
thanks.

Please also run all your patches through checkpatch _before_ posting,
and fix warnings and errors.

For example, this patch has a number of too long lines which cause
WARNING: line over 80 characters

Please fix all such issues, and resubmit.

Thanks.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
The biggest difference between time and space is that you can't reuse
time. - Merrick Furst
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2 11/11] New board support: Nokia RX-51 aka N900

2012-04-28 Thread Wolfgang Denk
Dear =?UTF-8?q?Pali=20Roh=C3=A1r?=,

In message <1335634011-9104-12-git-send-email-pali.ro...@gmail.com> you wrote:
> VGhpcyBib2FyZCBkZWZpbml0aW9uIHJlc3VsdHMgaW4gYSB1LWJvb3QuYmluIHdoaWNoIGNhbiBi
> ZSBjaGFpbmxvYWRlZApmcm9tIE5PTE8gaW4gcWVtdSBvciBvbiBhIHJlYWwgTjkwMC4gSXQgZG9l
> cyB2ZXJ5IGxpdHRsZSBoYXJkd2FyZSBjb25maWcKYmVjYXVzZSBOT0xPIGhhcyBhbHJlYWR5IGNv
> bmZpZ3VyZWQgdGhlIGJvYXJkLiBPbmx5IG5lZWRlZCBpcyBlbmFibGluZwppbnRlcm5hbCBlTU1D
...

Please stop sending base64 encoded patches!   Send plain text only!


> 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 0x4. 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 
> 
> Default boot order:
> 
>  * 0. if keyboard is closed boot automatically attached kernel image
>  * 1. try boot from external SD card
>  * 2. try boot from internal eMMC memory
>  * 3. try boot from attached 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 sdboot - Boot from external SD card (see boot order)
>  * run emmcboot - Boot from internal eMMC memory (see boot order)
>  * run attachboot - Boot attached kernel image (attached to U-Boot binary)
> 
>  * run scriptload - Load boot script ${mmcscriptfile}
>  * run scriptboot - Run loaded boot script
>  * run kernload - Load kernel image ${mmckernfile}
>  * run initrdload - Load initrd image ${mmcinitrdfile}
>  * run kernboot - Boot loaded kernel image
>  * run kerninitrdboot - Boot loaded kernel image with loaded initrd image
> 
>  * run trymmcscriptboot - Try to load and boot script ${mmcscriptfile}
>  * run trymmckernboot - Try to load and boot kernel image ${mmckernfile}
>  * run trymmckerninitrdboot - Try to load and boot kernel image ${mmckernfile}
>   with initrd image ${mmcinitrdfile}
> 
> Variables for loading files from mmc:
> 
>  * mmc ${mmcnum} (0 - external, 1 - internal)
>  * partition number ${mmcpart} (1 - 4)
>  * parition type ${mmctype} (fat, ext2)

While it is a good idea to provide documentation, this is the wrong
place for it.  Here in the commit message is about the last place
where most of the users will search for it.  Please provide a README
for this board - either in the board directory, or in doc/

BUt also keep in mind that this is a maintenance problem - who will
make sure that this documentation gets updated when someone changes to
code?


>  board/nokia/rx51/Makefile|   46 +
>  board/nokia/rx51/lowlevel_init.S |   71 +++
>  board/nokia/rx51/rx51.c  |  380 
> ++
>  board/nokia/rx51/rx51.h  |  378 +
>  boards.cfg   |1 +
>  include/configs/nokia_rx51.h |  373 +
>  6 files changed, 1249 insertions(+)
>  create mode 100644 board/nokia/rx51/Makefile
>  create mode 100644 board/nokia/rx51/lowlevel_init.S
>  create mode 100644 board/nokia/rx51/rx51.c
>  create mode 100644 board/nokia/rx51/rx51.h
>  create mode 100644 include/configs/nokia_rx51.h

Entry in MAINTAINERS missing.

> +/*
> + * Size of malloc() pool
> + */
> +#define CONFIG_ENV_SIZE  (128 << 10) /* 128 KiB 
> Sector */
> +#define CONFIG_UBI_SIZE  (512 << 10) /* 512 KiB 
> Sector */
> +#define CONFIG_SYS_MALLOC_LEN(CONFIG_ENV_SIZE + 

Re: [U-Boot] [PATCH v2 01/11] arm: Optionally use existing atags in bootm.c

2012-04-28 Thread Marek Vasut
Dear Pali Rohár,

> 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 0x8100:

Won't it be easier to create a preprocessing function that'd fill gd properly, 
so uboot can generate the atags through standard means then?

> 
> setenv atagaddr 0x8100; bootm 0x80008000
> 
> Signed-off-by: Pali Rohár 
> ---
> Changes since v1:
>- Rebased on u-boot master
> 
> Changes since original version:
>- Added info to README file
>- Added local define CONFIG_SETUP_ANY_TAG
>- Fixed compile warning
>- Fixed commit message
>- Check if atagaddr is not NULL
> 
>  README   |2 ++
>  arch/arm/lib/bootm.c |   60
> -- 2 files changed, 40
> insertions(+), 22 deletions(-)
> 
> diff --git a/README b/README
> index 43074cf..60ad9c2 100644
> --- a/README
> +++ b/README
> @@ -3687,6 +3687,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 599547d..0f3c97b 100644
> --- a/arch/arm/lib/bootm.c
> +++ b/arch/arm/lib/bootm.c
> @@ -42,6 +42,10 @@ DECLARE_GLOBAL_DATA_PTR;
>   defined(CONFIG_INITRD_TAG) || \
>   defined(CONFIG_SERIAL_TAG) || \
>   defined(CONFIG_REVISION_TAG)
> + #define CONFIG_SETUP_ANY_TAG
> +#endif
> +
> +#ifdef CONFIG_SETUP_ANY_TAG
>  static struct tag *params;
>  #endif
> 
> @@ -106,11 +110,7 @@ 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)
> +#ifdef CONFIG_SETUP_ANY_TAG
>  static void setup_start_tag (bd_t *bd)
>  {
>   params = (struct tag *)bd->bi_boot_params;
> @@ -217,11 +217,7 @@ void setup_revision_tag(struct tag **in_params)
>  }
>  #endif
> 
> -#if defined(CONFIG_SETUP_MEMORY_TAGS) || \
> - defined(CONFIG_CMDLINE_TAG) || \
> - defined(CONFIG_INITRD_TAG) || \
> - defined(CONFIG_SERIAL_TAG) || \
> - defined(CONFIG_REVISION_TAG)
> +#ifdef CONFIG_SETUP_ANY_TAG
>  static void setup_end_tag(bd_t *bd)
>  {
>   params->hdr.tag = ATAG_NONE;
> @@ -280,13 +276,23 @@ static void boot_prep_linux(bootm_headers_t *images)
>   } else
>  #endif
>   {
> -#if defined(CONFIG_SETUP_MEMORY_TAGS) || \
> - defined(CONFIG_CMDLINE_TAG) || \
> - defined(CONFIG_INITRD_TAG) || \
> - defined(CONFIG_SERIAL_TAG) || \
> - defined(CONFIG_REVISION_TAG)
> + char *atagaddr = getenv("atagaddr");
>   debug("using: ATAGS\n");
> - setup_start_tag(gd->bd);
> +
> + if (atagaddr)
> + gd->bd->bi_boot_params = simple_strtoul(atagaddr, NULL, 
16);
> +
> + if (gd->bd->bi_boot_params) {
> + printf("Using existing atags at %#lx\n", gd->bd-
>bi_boot_params);
> +
> + params = (struct tag *) gd->bd->bi_boot_params;
> + while (params->hdr.size > 0)
> + params = tag_next(params);
> + } else {
> +#ifdef CONFIG_SETUP_ANY_TAG
> + setup_start_tag(gd->bd);
> +#endif
> + }
>  #ifdef CONFIG_SERIAL_TAG
>   setup_serial_tag(¶ms);
>  #endif
> @@ -297,18 +303,28 @@ static void boot_prep_linux(bootm_headers_t *images)
>   setup_revision_tag(¶ms);
>  #endif
>  #ifdef CONFIG_SETUP_MEMORY_TAGS
> - setup_memory_tags(gd->bd);
> + if (!atagaddr)
> + setup_memory_tags(gd->bd);
>  #endif
>  #ifdef CONFIG_INITRD_TAG
>   if (images->rd_start && images->rd_end)
>   setup_initrd_tag(gd->bd, images->rd_start,
>   images->rd_end);
>  #endif
> - setup_end_tag(gd->bd);
> -#else /* all tags */
> - printf("FDT and ATAGS support not compiled in - hanging\n");
> - hang();
> -#endif /* all tags */
> + if (atagaddr) {
> + if (params->hdr.size > 0)
> + setup_end_tag(gd->bd);
> + } else {
> +#ifdef CONFIG_SETUP_ANY_TAG
> + setup_end_tag(gd->bd);
> +#endif
> + }
> +#ifndef CONFIG_SETUP_ANY_TAG
> + if (!atagaddr) {
> + printf("FDT and ATAGS support not

Re: [U-Boot] [PATCH v2 03/11] cfb_console: Fix function console_back

2012-04-28 Thread Marek Vasut
Dear Pali Rohár,

>  * Do not disable and enable cursor again

Can you elaborate please?

> 
> Signed-off-by: Pali Rohár 
> ---
>  drivers/video/cfb_console.c |2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/drivers/video/cfb_console.c b/drivers/video/cfb_console.c
> index 904caf7..51ea167 100644
> --- a/drivers/video/cfb_console.c
> +++ b/drivers/video/cfb_console.c
> @@ -721,7 +721,6 @@ static void console_scrollup(void)
> 
>  static void console_back(void)
>  {
> - CURSOR_OFF;
>   console_col--;
> 
>   if (console_col < 0) {
> @@ -730,7 +729,6 @@ static void console_back(void)
>   if (console_row < 0)
>   console_row = 0;
>   }
> - CURSOR_SET;
>  }
> 
>  static void console_newline(void)

Best regards,
Marek Vasut
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2 04/11] cfb_console: Add function console_clear and console_clear_line

2012-04-28 Thread Marek Vasut
Dear Pali Rohár,

>  * console_clear - clear full console framebuffer output
>  * console_clear_line - clear part of specified line (or full)
> 
> Signed-off-by: Pali Rohár 
> ---
> Changes since original version:
>- Fixed commit message
> 
>  drivers/video/cfb_console.c |   64
> +++ 1 file changed, 52
> insertions(+), 12 deletions(-)
> 
> diff --git a/drivers/video/cfb_console.c b/drivers/video/cfb_console.c
> index 51ea167..0d1e6b2 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 */

Maybe you want to prepare these parameters into some variables at the begining 
of this function? Also, your comments make no sense.

> +   /* FIXME: correct? */
> +   video_logo_height +
> +   CONSOLE_ROW_SIZE * line,  /* dest pos y */
> +   /* FIXME: correct? */

Uh ... fixme ;-)

> +   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)
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2 05/11] cfb_console: Add functions for moving with cursor

2012-04-28 Thread Marek Vasut
Dear Pali Rohár,

>  * 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

How/where do you use these? Documentation entry is missing and there're no 
comments in the code.

> Signed-off-by: Pali Rohár 
> ---
> Changes since original version:
>- Fixed commit message
> 
>  drivers/video/cfb_console.c |   64
> +++ 1 file changed, 58
> insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/video/cfb_console.c b/drivers/video/cfb_console.c
> index 0d1e6b2..43eb994 100644
> --- a/drivers/video/cfb_console.c
> +++ b/drivers/video/cfb_console.c
> @@ -771,9 +771,54 @@ static void console_back(void)
>   }
>  }
> 
> -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 */
> @@ -782,10 +827,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;
> @@ -804,7 +856,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;
> 
> @@ -813,7 +865,7 @@ void video_putc(const char c)
>   console_col &= ~0x0007;
> 
>   if (console_col >= CONSOLE_COLS)
> - console_newline();
> + console_newline(1);
>   break;
> 
>   case 8: /* backspace */
> @@ -827,7 +879,7 @@ void video_putc(const char c)
> 
>   /* check for newline */
>   if (console_col >= CONSOLE_COLS) {
> - console_newline();
> + console_newline(1);
>   nl = 0;
>   }
>   }
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2 06/11] cfb_console: Add support for some ANSI terminal escape codes

2012-04-28 Thread Marek Vasut
Dear Pali Rohár,

>  * 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 
> ---
> Changes since v1:
>- Added support ANSI code show/hide cursor
>- Added info to README
> 
> Changes since original version:
>- Fixed commit message
> 
>  README  |3 +
>  drivers/video/cfb_console.c |  234
> ++- 2 files changed, 234
> insertions(+), 3 deletions(-)
> 
> diff --git a/README b/README
> index 60ad9c2..4a610f7 100644
> --- a/README
> +++ b/README
> @@ -613,6 +613,9 @@ The following options need to be configured:
>   additional board info beside
>   the logo
> 
> + When CONFIG_CFB_CONSOLE_ANSI is defined, console will have
> + ANSI terminal support. Needed for CONFIG_CMDLINE_EDITING.
> +
>   When CONFIG_CFB_CONSOLE is defined, video console is
>   default i/o. Serial console can be forced with
>   environment 'console=serial'.
> diff --git a/drivers/video/cfb_console.c b/drivers/video/cfb_console.c
> index 43eb994..c9f9765 100644
> --- a/drivers/video/cfb_console.c
> +++ b/drivers/video/cfb_console.c
> @@ -377,6 +377,11 @@ 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 int ansi_cursor_hidden;
> +
>  static const int video_font_draw_table8[] = {
>   0x, 0x00ff, 0xff00, 0x,
>   0x00ff, 0x00ff00ff, 0x0000, 0x00ff,
> @@ -602,6 +607,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)
>  {
> @@ -843,11 +856,12 @@ 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;
> 
> - CURSOR_OFF;
> + if (!ansi_cursor_hidden)
> + CURSOR_OFF;
> 
>   switch (c) {
>   case 13:/* back to first column */
> @@ -883,7 +897,221 @@ void video_putc(const char c)
>   nl = 0;
>   }
>   }
> - CURSOR_SET;
> +
> + if (!ansi_cursor_hidden)
> + 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

wrong comment ... did you even run these patches through checkpatch? Run them 
and resubmit please, I'm ending my review here.

> + */
> + 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 if (ansi_buf[i] != '?') {
> + --i;
> + num1 = 1;
> + next = 4;
> + 

[U-Boot] [PATCH 1/2] GCC47: Fix warning in cmd_nand.c

2012-04-28 Thread Marek Vasut
cmd_nand.c: In function ‘arg_off_size’:
cmd_nand.c:216:5: warning: ‘maxsize’ may be used uninitialized in this 
function [-Wmaybe-uninitialized]

Signed-off-by: Marek Vasut 
Cc: Scott Wood 
---
 common/cmd_nand.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/common/cmd_nand.c b/common/cmd_nand.c
index bae630d..0fd3a6c 100644
--- a/common/cmd_nand.c
+++ b/common/cmd_nand.c
@@ -191,7 +191,7 @@ static int arg_off_size(int argc, char *const argv[], int 
*idx,
loff_t *off, loff_t *size)
 {
int ret;
-   loff_t maxsize;
+   loff_t maxsize = 0;
 
if (argc == 0) {
*off = 0;
-- 
1.7.10

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 2/2] GCC47: Fix warning in md5.c

2012-04-28 Thread Marek Vasut
md5.c: In function ‘MD5Final’:
md5.c:156:2: warning: dereferencing type-punned pointer will break 
strict-aliasing rules [-Wstrict-aliasing]
md5.c:157:2: warning: dereferencing type-punned pointer will break 
strict-aliasing rules [-Wstrict-aliasing]

Signed-off-by: Marek Vasut 
Cc: Wolfgang Denk 
---
 include/u-boot/md5.h |5 -
 lib/md5.c|4 ++--
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/include/u-boot/md5.h b/include/u-boot/md5.h
index 08924cc..e09c16a 100644
--- a/include/u-boot/md5.h
+++ b/include/u-boot/md5.h
@@ -11,7 +11,10 @@
 struct MD5Context {
__u32 buf[4];
__u32 bits[2];
-   unsigned char in[64];
+   union {
+   unsigned char in[64];
+   __u32 in32[16];
+   };
 };
 
 /*
diff --git a/lib/md5.c b/lib/md5.c
index 81a09e3..2ae4a06 100644
--- a/lib/md5.c
+++ b/lib/md5.c
@@ -153,8 +153,8 @@ MD5Final(unsigned char digest[16], struct MD5Context *ctx)
byteReverse(ctx->in, 14);
 
/* Append length in bits and transform */
-   ((__u32 *) ctx->in)[14] = ctx->bits[0];
-   ((__u32 *) ctx->in)[15] = ctx->bits[1];
+   ctx->in32[14] = ctx->bits[0];
+   ctx->in32[15] = ctx->bits[1];
 
MD5Transform(ctx->buf, (__u32 *) ctx->in);
byteReverse((unsigned char *) ctx->buf, 4);
-- 
1.7.10

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 1/2] GCC47: Fix warning in cmd_nand.c

2012-04-28 Thread Marek Vasut
Dear Marek Vasut,

> cmd_nand.c: In function ‘arg_off_size’:
> cmd_nand.c:216:5: warning: ‘maxsize’ may be used uninitialized in this
> function [-Wmaybe-uninitialized]

AW CRAP ... ignore this, damn encoding problem.

> 
> Signed-off-by: Marek Vasut 
> Cc: Scott Wood 
> ---
>  common/cmd_nand.c |2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/common/cmd_nand.c b/common/cmd_nand.c
> index bae630d..0fd3a6c 100644
> --- a/common/cmd_nand.c
> +++ b/common/cmd_nand.c
> @@ -191,7 +191,7 @@ static int arg_off_size(int argc, char *const argv[],
> int *idx, loff_t *off, loff_t *size)
>  {
>   int ret;
> - loff_t maxsize;
> + loff_t maxsize = 0;
> 
>   if (argc == 0) {
>   *off = 0;

Best regards,
Marek Vasut
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 1/2] GCC47: Fix warning in cmd_nand.c

2012-04-28 Thread Marek Vasut
cmd_nand.c: In function ‘arg_off_size’:
cmd_nand.c:216:5: warning: ‘maxsize’ may be used uninitialized in this function 
[-Wmaybe-uninitialized]

Signed-off-by: Marek Vasut 
Cc: Scott Wood 
Cc: Wolfgang Denk 
---
 common/cmd_nand.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

NOTE: Why does this emit these blahs about UTF8? I just noticed git started
behaving weird on me, anyone can give me a hint how to disable these?

diff --git a/common/cmd_nand.c b/common/cmd_nand.c
index bae630d..0fd3a6c 100644
--- a/common/cmd_nand.c
+++ b/common/cmd_nand.c
@@ -191,7 +191,7 @@ static int arg_off_size(int argc, char *const argv[], int 
*idx,
loff_t *off, loff_t *size)
 {
int ret;
-   loff_t maxsize;
+   loff_t maxsize = 0;
 
if (argc == 0) {
*off = 0;
-- 
1.7.10

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 2/2] GCC47: Fix warning in md5.c

2012-04-28 Thread Marek Vasut
md5.c: In function ‘MD5Final’:
md5.c:156:2: warning: dereferencing type-punned pointer will break 
strict-aliasing rules [-Wstrict-aliasing]
md5.c:157:2: warning: dereferencing type-punned pointer will break 
strict-aliasing rules [-Wstrict-aliasing]

Signed-off-by: Marek Vasut 
Cc: Wolfgang Denk 
---
 include/u-boot/md5.h |5 -
 lib/md5.c|4 ++--
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/include/u-boot/md5.h b/include/u-boot/md5.h
index 08924cc..e09c16a 100644
--- a/include/u-boot/md5.h
+++ b/include/u-boot/md5.h
@@ -11,7 +11,10 @@
 struct MD5Context {
__u32 buf[4];
__u32 bits[2];
-   unsigned char in[64];
+   union {
+   unsigned char in[64];
+   __u32 in32[16];
+   };
 };
 
 /*
diff --git a/lib/md5.c b/lib/md5.c
index 81a09e3..2ae4a06 100644
--- a/lib/md5.c
+++ b/lib/md5.c
@@ -153,8 +153,8 @@ MD5Final(unsigned char digest[16], struct MD5Context *ctx)
byteReverse(ctx->in, 14);
 
/* Append length in bits and transform */
-   ((__u32 *) ctx->in)[14] = ctx->bits[0];
-   ((__u32 *) ctx->in)[15] = ctx->bits[1];
+   ctx->in32[14] = ctx->bits[0];
+   ctx->in32[15] = ctx->bits[1];
 
MD5Transform(ctx->buf, (__u32 *) ctx->in);
byteReverse((unsigned char *) ctx->buf, 4);
-- 
1.7.10

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2 01/11] arm: Optionally use existing atags in bootm.c

2012-04-28 Thread Mike Frysinger
On Saturday 28 April 2012 13:26:41 Pali Rohár wrote:
>   defined(CONFIG_INITRD_TAG) || \
>   defined(CONFIG_SERIAL_TAG) || \
>   defined(CONFIG_REVISION_TAG)
> + #define CONFIG_SETUP_ANY_TAG

don't indent the "#"
-mike


signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 2/2] GCC47: Fix warning in md5.c

2012-04-28 Thread Mike Frysinger
On Saturday 28 April 2012 18:28:40 Marek Vasut wrote:
> --- a/include/u-boot/md5.h
> +++ b/include/u-boot/md5.h
> @@ -11,7 +11,10 @@
>  struct MD5Context {
>   __u32 buf[4];
>   __u32 bits[2];
> - unsigned char in[64];
> + union {
> + unsigned char in[64];
> + __u32 in32[16];
> + };
>  };
> 
> --- a/lib/md5.c
> +++ b/lib/md5.c
> 
>   /* Append length in bits and transform */
> - ((__u32 *) ctx->in)[14] = ctx->bits[0];
> - ((__u32 *) ctx->in)[15] = ctx->bits[1];
> + ctx->in32[14] = ctx->bits[0];
> + ctx->in32[15] = ctx->bits[1];

nice

Acked-by: Mike Frysinger 
-mike


signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot