palm treo 680 smartphone board support
Subsystems (7)
v2 cover palm treo 680 smartphone board support
Hi,
This patchset adds support for the Palm Treo 680 smartphone. I had to make some minor tweaks to u-boot to get things working. Most of these changes are small, and most only touch the pxa arch.
Thanks for looking.
Changelog:
v2:
- tabs removed in #defines in palmtreo680.h
- use '__weak' macro in pxa_lcd
- remove externs from function prototypes in bitrev.h
- remove commented-out code from docg4.c
- the CONFIG_SYS_LCD_PXA_NO_L_BIAS patch was removed; the same result is accomplished by re-configuring the L_BIAS gpio in the board-specific lcd_enable(), which runs after the driver initialization
- userland utility for programming u-boot to flash moved to tools/palmtreo680
- commit message for patches that add bitrev library and docg4 driver contain the commit and linux version for when the code was added to linux
Mike Dunn (7):
pxa_lcd: add the ACX544AKN lcd device
pxa_lcd: make lcd_enable() a weak pointer
pxa27x_udc: remove call to unimplemented set_GPIO_mode()
arm: bootm: call udc_disable()before booting linux
lib: import bitrev library from the linux kernel
mtd: nand: add driver for diskonchip g4 nand flash add support for palm treo 680 board
CREDITS | 4 + MAINTAINERS | 3 + arch/arm/include/asm/arch-pxa/hardware.h | 11 - arch/arm/include/asm/bootm.h | 1 + arch/arm/lib/bootm.c | 1 + board/palmtreo680/Makefile | 34 + board/palmtreo680/palmtreo680.c | 179 +++++ board/palmtreo680/palmtreo680_spl.lds | 51 ++ boards.cfg | 1 + doc/README.palmtreo680 | 570 ++++++++++++++++ drivers/mtd/nand/Makefile | 2 + drivers/mtd/nand/docg4.c | 1034 ++++++++++++++++++++++++++++++ drivers/mtd/nand/docg4_spl.c | 221 +++++++ drivers/usb/gadget/pxa27x_udc.c | 4 +- drivers/video/pxa_lcd.c | 34 +- include/configs/palmtreo680.h | 296 +++++++++ include/linux/bitrev.h | 23 + include/linux/mtd/docg4.h | 134 ++++ lib/Makefile | 1 + lib/bitrev.c | 59 ++ tools/palmtreo680/flash_u-boot.c | 177 +++++ 21 files changed, 2827 insertions(+), 13 deletions(-) create mode 100644 board/palmtreo680/Makefile create mode 100644 board/palmtreo680/palmtreo680.c create mode 100644 board/palmtreo680/palmtreo680_spl.lds create mode 100644 doc/README.palmtreo680 create mode 100644 drivers/mtd/nand/docg4.c create mode 100644 drivers/mtd/nand/docg4_spl.c create mode 100644 include/configs/palmtreo680.h create mode 100644 include/linux/bitrev.h create mode 100644 include/linux/mtd/docg4.h create mode 100644 lib/bitrev.c create mode 100644 tools/palmtreo680/flash_u-boot.c
Signature · 1 line
1.7.8.6
PATCH v2 1/7 pxa_lcd: add the ACX544AKN lcd device
This adds the definitions required to support the LCD device on the Palm Treo 680.
--- drivers/video/pxa_lcd.c | 32 ++++++++++++++++++++++++++++++++ 1 files changed, 32 insertions(+), 0 deletions(-)
drivers/video/pxa_lcd.c +32 -0
@@ -248,6 +248,38 @@ vidinfo_t panel_info = { };#endif /* CONFIG_ACX517AKN */ +#ifdef CONFIG_ACX544AKN + +# define LCD_BPP LCD_COLOR16 + +/* you have to set lccr0 and lccr3 (including pcd) */ +# define REG_LCCR0 0x003008f9 +# define REG_LCCR3 0x04700007/* 16bpp */ + +vidinfo_t panel_info = { + .vl_col =320 , + .vl_row =320 , + .vl_width =320 , + .vl_height =320 , + .vl_clkp =CONFIG_SYS_LOW , + .vl_oep =CONFIG_SYS_LOW , + .vl_hsp =CONFIG_SYS_LOW , + .vl_vsp =CONFIG_SYS_LOW , + .vl_dp =CONFIG_SYS_LOW , + .vl_bpix =LCD_BPP , + .vl_lbw =0 , + .vl_splt =0 , + .vl_clor =1 , + .vl_tft =1 , + .vl_hpw =0x05 , + .vl_blw =0x13 , + .vl_elw =0x08 , + .vl_vpw =0x02 , + .vl_bfw =0x07 , + .vl_efw =0x05 , +}; +#endif /* CONFIG_ACX544AKN */ +/*----------------------------------------------------------------------*/ #ifdef CONFIG_LQ038J7DH53
Signature · 1 line
1.7.8.6
PATCH v2 1/7 pxa_lcd: add the ACX544AKN lcd device
Dear Mike Dunn,
Quoted 4 lines
This adds the definitions required to support the LCD device on the Palm Treo 680.
Signed-off-by Mike Dunn <[email protected]>
Best regards,
Marek Vasut
PATCH v2 2/7 pxa_lcd: make lcd_enable() a weak pointer
In reply to Mike DunnMake lcd_init() a weak pointer so that boards can overload it if necessary. The palmtreo680 board needs to wiggle some gpios and configure the pwm controller in order to get the lcd and its backlight working.
--- drivers/video/pxa_lcd.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/video/pxa_lcd.c +1 -1
@@ -410,7 +410,7 @@ void lcd_initcolregs (void)#endif /* LCD_MONOCHROME */ /*----------------------------------------------------------------------*/ -void lcd_enable (void ) +__weak void lcd_enable (void ) { }
Signature · 1 line
1.7.8.6
PATCH v2 2/7 pxa_lcd: make lcd_enable() a weak pointer
Dear Mike Dunn,
Quoted 5 lines
Make
lcd_init()a weak pointer so that boards can overload it if necessary.
The palmtreo680 board needs to wiggle some gpios and configure the pwm
controller in order to get the lcd and its backlight working.Signed-off-by Mike Dunn <[email protected]>
Best regards,
Marek Vasut
PATCH v2 3/7 pxa27x_udc: remove call to unimplemented set_GPIO_mode()
In reply to Mike DunnIf CONFIG_USB_DEV_PULLUP_GPIO is defined, a link error occurs because the set_GPIO_mode() helper function is not implemented. This function doesn't do much except make the code a little more readable, so I just manually coded its equivalent and removed the prototype from the header file. It is invoked no where else in the code.
While I was at it, I noticed that two other function prototypes in the same header file are also neither implemented nor invoked anywhere, so I removed them as well.
--- arch/arm/include/asm/arch-pxa/hardware.h | 11 ----------- drivers/usb/gadget/pxa27x_udc.c | 4 +++- 2 files changed, 3 insertions(+), 12 deletions(-)
arch/arm/include/asm/arch-pxa/hardware.h +0 -11
@@ -77,17 +77,6 @@#define GPIO_FALLING_EDGE 1#define GPIO_RISING_EDGE 2#define GPIO_BOTH_EDGES 3 -extern void set_GPIO_IRQ_edge (int gpio_nr,int edge_mask ); - -/* -* Handy routine to set GPIO alternate functions -*/ -extern void set_GPIO_mode (int gpio_mode ); - -/* -* return current lclk frequency in units of 10kHz -*/ -extern unsigned int get_lclk_frequency_10khz (void );#endif
drivers/usb/gadget/pxa27x_udc.c +3 -1
@@ -610,7 +610,9 @@ void udc_connect(void)#ifdef CONFIG_USB_DEV_PULLUP_GPIO /* Turn on the USB connection by enabling the pullup resistor */ -set_GPIO_mode (CONFIG_USB_DEV_PULLUP_GPIO |GPIO_OUT ); +writel (readl (GPDR (CONFIG_USB_DEV_PULLUP_GPIO )) + |GPIO_bit (CONFIG_USB_DEV_PULLUP_GPIO ), +GPDR (CONFIG_USB_DEV_PULLUP_GPIO ));writel (GPIO_bit (CONFIG_USB_DEV_PULLUP_GPIO ),GPSR (CONFIG_USB_DEV_PULLUP_GPIO ));#else /* Host port 2 transceiver D+ pull up enable */
Signature · 1 line
1.7.8.6
PATCH v2 3/7 pxa27x_udc: remove call to unimplemented set_GPIO_mode()
Dear Mike Dunn,
Quoted 11 lines
If
CONFIG_USB_DEV_PULLUP_GPIOis defined, a link error occurs because theset_GPIO_mode()helper function is not implemented. This function doesn't do much except make the code a little more readable, so I just manually coded its equivalent and removed the prototype from the header file. It is invoked no where else in the code.While I was at it, I noticed that two other function prototypes in the same header file are also neither implemented nor invoked anywhere, so I removed them as well.
Signed-off-by Mike Dunn <[email protected]>
Best regards,
Marek Vasut
PATCH v2 4/7 arm: bootm: call udc_disable()before booting linux
In reply to Mike DunnOn the pxa270, if the udc device is not disabled before jumping to linux, the device fails to initialize in linux because it was left in a running state, and the linux driver assumes that it is in a disabled state.
---
Arguably, this is a bug in the linux driver, but it seemed pretty simple and benign to just disable it in u-boot. I'll also send a patch to upstream kernel to fix its driver.
arch/arm/include/asm/bootm.h | 1 + arch/arm/lib/bootm.c | 1 + 2 files changed, 2 insertions(+), 0 deletions(-)
arch/arm/include/asm/bootm.h +1 -0
@@ -21,6 +21,7 @@#ifdef CONFIG_USB_DEVICE extern void udc_disconnect (void ); +extern void udc_disable (void );#endif #endif
arch/arm/lib/bootm.c +1 -0
@@ -105,6 +105,7 @@ static void announce_and_cleanup(void)#ifdef CONFIG_USB_DEVICE udc_disconnect (); +udc_disable ();#endif cleanup_before_linux (); }
Signature · 1 line
1.7.8.6
PATCH v2 4/7 arm: bootm: call udc_disable()before booting linux
Dear Mike Dunn,
Quoted 5 lines
On the pxa270, if the udc device is not disabled before jumping to linux, the device fails to initialize in linux because it was left in a running state, and the linux driver assumes that it is in a disabled state.
Signed-off-by Mike Dunn <[email protected]>
I hope this won't break other platforms. Tom, can you test?
Best regards,
Marek Vasut
PATCH v2 5/7 lib: import bitrev library from the linux kernel
In reply to Mike DunnThis patch adds the bitrev library from the linux kernel. This is a simple algorithm that uses an 8 bit look-up table to reverse the bits in data types of 8, 16, or 32 bit widths. The docg4 nand flash driver uses it.
[port from linux kernel 2.6.20 commit a5cfc1ec58a07074dacb6aa8c79eff864c966d12]
--- include/linux/bitrev.h | 23 ++++++++++++++++++ lib/Makefile | 1 + lib/bitrev.c | 59 ++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 83 insertions(+), 0 deletions(-) create mode 100644 include/linux/bitrev.h create mode 100644 lib/bitrev.c
include/linux/bitrev.h new file +23 -0
@@ -0,0 +1,23 @@ +/* +* This file is released under the terms of GPL v2 and any later version. +* See the file COPYING in the root directory of the source tree for details. +* +* Based on bitrev from the Linux kernel, by Akinobu Mita +*/ + +#ifndef _LINUX_BITREV_H +#define _LINUX_BITREV_H + +#include <linux/types.h> + +extern u8 const byte_rev_table[256 ]; + +static inline u8 bitrev8 (u8 byte) +{ +return byte_rev_table[byte]; +} + +u16 bitrev16 (u16 in); +u32 bitrev32 (u32 in); + +#endif /* _LINUX_BITREV_H */
lib/Makefile +1 -0
@@ -55,6 +55,7 @@ COBJS-$(CONFIG_SHA1) += sha1.o COBJS-$(CONFIG_SHA256) += sha256.o COBJS-y += strmhz.o COBJS-$(CONFIG_RBTREE) += rbtree.o +COBJS-$(CONFIG_BITREVERSE) += bitrev.o endif ifdef CONFIG_SPL_BUILD
lib/bitrev.c new file +59 -0
59 lines not on this page · raw message
Signature · 1 line
1.7.8.6
PATCH v2 5/7 lib: import bitrev library from the linux kernel
Dear Mike Dunn,
Quoted 6 lines
This patch adds the bitrev library from the linux kernel. This is a simple algorithm that uses an 8 bit look-up table to reverse the bits in data types of 8, 16, or 32 bit widths. The docg4 nand flash driver uses it.
[port from linux kernel 2.6.20 commit
a5cfc1ec58a07074dacb6aa8c79eff864c966d12]
Why did you port it from such an ancient kernel? Newer version is not an option?
Best regards,
Marek Vasut
PATCH v2 5/7 lib: import bitrev library from the linux kernel
Quoted 10 lines · Marek Vasut
Dear Mike Dunn,
Quoted 6 lines
This patch adds the bitrev library from the linux kernel. This is a simple algorithm that uses an 8 bit look-up table to reverse the bits in data types of 8, 16, or 32 bit widths. The docg4 nand flash driver uses it.
[port from linux kernel 2.6.20 commit
a5cfc1ec58a07074dacb6aa8c79eff864c966d12]Why did you port it from such an ancient kernel? Newer version is not an option?
Maybe I misunderstood and gave the wrong information (probably, now that I think about it). I took it fom the latest kernel, but reported the commit that added it to the kernel.
In this case, it's a simple algorithm and only a couple trivial changes were made since it was first added to the kernel, so the error is probably inconsequential, but I'll resubmit, reporting the HEAD of the kernel I took it from if you like.
BTW, I did the same for the docg4 driver, but I did the u-boot port a while ago, so in that case it's correct, at least practically. Since I did the port, the kernel docg4 driver had some enhancements (reliable mode) that still need to be brought into u-boot.
Thanks Marek,
Mike
PATCH v2 5/7 lib: import bitrev library from the linux kernel
Dear Mike Dunn,
Quoted 18 lines · Marek Vasut
Quoted 7 lines
Dear Mike Dunn,
Quoted 5 lines
This patch adds the bitrev library from the linux kernel. This is a simple algorithm that uses an 8 bit look-up table to reverse the bits in data types of 8, 16, or 32 bit widths. The docg4 nand flash driver uses it.
Quoted 5 lines
Quoted 2 lines
[port from linux kernel 2.6.20 commit
a5cfc1ec58a07074dacb6aa8c79eff864c966d12]Why did you port it from such an ancient kernel? Newer version is not an option?
Maybe I misunderstood and gave the wrong information (probably, now that I think about it). I took it fom the latest kernel, but reported the commit that added it to the kernel.
Quoted 8 lines
In this case, it's a simple algorithm and only a couple trivial changes were made since it was first added to the kernel, so the error is probably inconsequential, but I'll resubmit, reporting the HEAD of the kernel I took it from if you like.
BTW, I did the same for the docg4 driver, but I did the u-boot port a while ago, so in that case it's correct, at least practically. Since I did the port, the kernel docg4 driver had some enhancements (reliable mode) that
Knowing which tag in linux-stable you pulled it from is a good information too, yes.
Best regards,
Marek Vasut
PATCH v2 5/7 lib: import bitrev library from the linux kernel
In reply to Mike DunnDear Mike Dunn,
Quoted 5 lines · In message <[email protected]> you wrote:
In this case, it's a simple algorithm and only a couple trivial changes were made since it was first added to the kernel, so the error is probably inconsequential, but I'll resubmit, reporting the HEAD of the kernel I took it from if you like.
Please use the git commit ID of the exact kernel version which you used to copy the code from, not any older nor any more recent version.
Thanks.
Best regards,
Wolfgang Denk
Signature · 5 lines
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: wd at denx.de
A good marriage would be between a blind wife and deaf husband.
-- Michel de MontaignePATCH v2 6/7 mtd: nand: add driver for diskonchip g4 nand flash
In reply to Mike DunnThis patch adds a driver for the diskonchip G4 nand flash device. It is based on the driver from the linux kernel.
This also includes a separate SPL driver. A separate SPL driver is used because the device operates in a different mode (reliable mode) when loading a boot image, and also because the storage format of the boot image is different from normal data (pages are stored redundantly). The SPL driver basically mimics how a typical IPL reads data from the device. The special operating mode and storage format are used to compensate for the fact that the IPL does not contain the BCH ecc decoding algorithm (due to size constraints). Although the u-boot SPL *could* use ecc, it operates like an IPL for the sake of simplicity and uniformity, since the IPL and SPL share the task of loading the u-boot image. As a side benefit, the SPL driver is very small.
[port from linux kernel 3.4 commit 570469f3bde7f71cc1ece07a18d54a05b6a8775d]
--- drivers/mtd/nand/Makefile | 2 + drivers/mtd/nand/docg4.c | 1035 ++++++++++++++++++++++++++++++++++++++++++ drivers/mtd/nand/docg4_spl.c | 222 +++++++++ include/linux/mtd/docg4.h | 134 ++++++ 4 files changed, 1393 insertions(+), 0 deletions(-) create mode 100644 drivers/mtd/nand/docg4.c create mode 100644 drivers/mtd/nand/docg4_spl.c create mode 100644 include/linux/mtd/docg4.h
drivers/mtd/nand/Makefile +2 -0
@@ -34,6 +34,7 @@ NORMAL_DRIVERS=y endif COBJS-$(CONFIG_SPL_NAND_AM33XX_BCH) += am335x_spl_bch.o +COBJS-$(CONFIG_SPL_NAND_DOCG4) += docg4_spl.o COBJS-$(CONFIG_SPL_NAND_SIMPLE) += nand_spl_simple.o COBJS-$(CONFIG_SPL_NAND_LOAD) += nand_spl_load.o COBJS-$(CONFIG_SPL_NAND_ECC) += nand_ecc.o
@@ -78,6 +79,7 @@ COBJS-$(CONFIG_NAND_SPEAR) += spr_nand.o COBJS-$(CONFIG_TEGRA_NAND) += tegra_nand.o COBJS-$(CONFIG_NAND_OMAP_GPMC) += omap_gpmc.o COBJS-$(CONFIG_NAND_PLAT) += nand_plat.o +COBJS-$(CONFIG_NAND_DOCG4) += docg4.o else # minimal SPL drivers
drivers/mtd/nand/docg4.c new file +1035 -0
1,035 lines not on this page · raw message
drivers/mtd/nand/docg4_spl.c new file +222 -0
222 lines not on this page · raw message
include/linux/mtd/docg4.h new file +134 -0
134 lines not on this page · raw message
Signature · 1 line
1.7.8.6
PATCH v2 6/7 mtd: nand: add driver for diskonchip g4 nand flash
Dear Mike Dunn,
Quoted 15 lines
This patch adds a driver for the diskonchip G4 nand flash device. It is based on the driver from the linux kernel.
This also includes a separate SPL driver. A separate SPL driver is used because the device operates in a different mode (reliable mode) when loading a boot image, and also because the storage format of the boot image is different from normal data (pages are stored redundantly). The SPL driver basically mimics how a typical IPL reads data from the device. The special operating mode and storage format are used to compensate for the fact that the IPL does not contain the BCH ecc decoding algorithm (due to size constraints). Although the u-boot SPL *could* use ecc, it operates like an IPL for the sake of simplicity and uniformity, since the IPL and SPL share the task of loading the u-boot image. As a side benefit, the SPL driver is very small.
Quoted 2 lines
[port from linux kernel 3.4 commit
570469f3bde7f71cc1ece07a18d54a05b6a8775d]
Scott, this really is your turf.
Best regards,
Marek Vasut
PATCH v2 6/7 mtd: nand: add driver for diskonchip g4 nand flash
Quoted 22 lines · Marek Vasut
Dear Mike Dunn,
Quoted 1 line
This patch adds a driver for the diskonchip G4 nand flash device.
It is
Quoted 3 lines
based on the driver from the linux kernel.
This also includes a separate SPL driver. A separate SPL driver is
used
Quoted 2 lines
because the device operates in a different mode (reliable mode) when loading a boot image, and also because the storage format of the
boot
Quoted 1 line
image is different from normal data (pages are stored
redundantly). The
Quoted 1 line
SPL driver basically mimics how a typical IPL reads data from the
device.
Quoted 1 line
The special operating mode and storage format are used to
compensate for
Quoted 1 line
the fact that the IPL does not contain the BCH ecc decoding
algorithm (due
Quoted 2 lines
to size constraints). Although the u-boot SPL *could* use ecc, it operates like an IPL for the sake of simplicity and uniformity,
since the
Quoted 8 lines
Quoted 1 line
IPL and SPL share the task of loading the u-boot image. As a side
benefit,
Quoted 4 lines
the SPL driver is very small.
[port from linux kernel 3.4 commit
570469f3bde7f71cc1ece07a18d54a05b6a8775d]Scott, this really is your turf.
I already acked it (it's up to Mike what he wants to do with dbg). Feel free to pick it up as part of the larger patchset -- it's a dependency for patch 7/7 that adds the board support.
-Scott
PATCH v2 6/7 mtd: nand: add driver for diskonchip g4 nand flash
In reply to Mike DunnQuoted 38 lines · Mike Dunn
This patch adds a driver for the diskonchip G4 nand flash device. It is based
on the driver from the linux kernel.This also includes a separate SPL driver. A separate SPL driver is used because
the device operates in a different mode (reliable mode) when loading a boot
image, and also because the storage format of the boot image is different from
normal data (pages are stored redundantly). The SPL driver basically mimics how
a typical IPL reads data from the device. The special operating mode and
storage format are used to compensate for the fact that the IPL does not contain
the BCH ecc decoding algorithm (due to size constraints). Although the u-boot
SPL *could* use ecc, it operates like an IPL for the sake of simplicity and
uniformity, since the IPL and SPL share the task of loading the u-boot image.
As a side benefit, the SPL driver is very small.[port from linux kernel 3.4 commit
570469f3bde7f71cc1ece07a18d54a05b6a8775d]Signed-off-by Mike Dunn <[email protected]>--- drivers/mtd/nand/Makefile | 2 + drivers/mtd/nand/docg4.c | 1035 ++++++++++++++++++++++++++++++++++++++++++ drivers/mtd/nand/docg4_spl.c | 222 +++++++++ include/linux/mtd/docg4.h | 134 ++++++ 4 files changed, 1393 insertions(+), 0 deletions(-) create mode 100644 drivers/mtd/nand/docg4.c create mode 100644 drivers/mtd/nand/docg4_spl.c create mode 100644 include/linux/mtd/docg4.h
[snip]
drivers/mtd/nand/docg4.c line 92
Quoted 5 lines
drivers/mtd/nand/docg4.c new file +5
-0+#ifdef DEBUG_DOCG4 +#define dbg(format, arg...) printf("DEBUG: " format, ##arg) +#else +#define dbg(format, arg...) do {} while (0) +#endif
Maybe use MTDDEBUG?
Otherwise:
-Scott
PATCH v2 6/7 mtd: nand: add driver for diskonchip g4 nand flash
Quoted 27 lines · Scott Wood
Quoted 17 lines · Mike Dunn
This patch adds a driver for the diskonchip G4 nand flash device. It is based on the driver from the linux kernel.
This also includes a separate SPL driver. A separate SPL driver is used because the device operates in a different mode (reliable mode) when loading a boot image, and also because the storage format of the boot image is different from normal data (pages are stored redundantly). The SPL driver basically mimics how a typical IPL reads data from the device. The special operating mode and storage format are used to compensate for the fact that the IPL does not contain the BCH ecc decoding algorithm (due to size constraints). Although the u-boot SPL *could* use ecc, it operates like an IPL for the sake of simplicity and uniformity, since the IPL and SPL share the task of loading the u-boot image. As a side benefit, the SPL driver is very small.
[port from linux kernel 3.4 commit
570469f3bde7f71cc1ece07a18d54a05b6a8775d]Signed-off-by Mike Dunn <[email protected]>Quoted 9 lines
--- drivers/mtd/nand/Makefile | 2 + drivers/mtd/nand/docg4.c | 1035 ++++++++++++++++++++++++++++++++++++++++++ drivers/mtd/nand/docg4_spl.c | 222 +++++++++ include/linux/mtd/docg4.h | 134 ++++++ 4 files changed, 1393 insertions(+), 0 deletions(-) create mode 100644 drivers/mtd/nand/docg4.c create mode 100644 drivers/mtd/nand/docg4_spl.c create mode 100644 include/linux/mtd/docg4.h
Quoted 8 lines
[snip]
drivers/mtd/nand/docg4.c line 92
Quoted 5 lines
drivers/mtd/nand/docg4.c new file +5
-0+#ifdef DEBUG_DOCG4 +#define dbg(format, arg...) printf("DEBUG: " format, ##arg) +#else +#define dbg(format, arg...) do {} while (0) +#endif Maybe use MTDDEBUG?
Ok. Alternatively, I wouldn't mind pulling them out entirely. It's been behaving quite nicely, and amyway, in the past I used a JTAG emultor rather than the printfs.
Quoted 3 lines
Otherwise:
Acked-by Scott Wood <[email protected]>
Many thanks Scott,
Mike
PATCH v2 6/7 mtd: nand: add driver for diskonchip g4 nand flash
In reply to Scott WoodDear Scott Wood,
[...]
Quoted 8 lines
[snip]
drivers/mtd/nand/docg4.c line 92
Quoted 5 lines
drivers/mtd/nand/docg4.c new file +5
-0+#ifdef DEBUG_DOCG4 +#define dbg(format, arg...) printf("DEBUG: " format, ##arg) +#else +#define dbg(format, arg...) do {} while (0) +#endif
There already is a debugging facility in include/common.h too. And it does the same thing too. MTDDEBUG might work as well.
Best regards,
Marek Vasut
PATCH v2 6/7 mtd: nand: add driver for diskonchip g4 nand flash
Quoted 6 lines · Marek Vasut
Dear Scott Wood,
[...]
Quoted 3 lines
[snip]
Quoted 9 lines
Quoted 5 lines
drivers/mtd/nand/docg4.c line 92
Quoted 5 lines
drivers/mtd/nand/docg4.c new file +5
-0+#ifdef DEBUG_DOCG4 +#define dbg(format, arg...) printf("DEBUG: " format, ##arg) +#else +#define dbg(format, arg...) do {} while (0) +#endif There already is a debugging facility in
include/common.htoo. And it does the
same thing too. MTDDEBUG might work as well.
I already pointed out MTDDEBUG, though debug() may be a better fit as it doesn't require adding debug levels, and since this driver's usage doesn't correspond to CONFIG_MTD_DEBUG in Linux (which appears to have been removed from Linux -- removal from U-Boot should likely follow).
Mike said he may just remove the debug messages entirely (maybe also from the Linux driver?), making it moot.
-Scott
PATCH v2 7/7 add support for palm treo 680 board
In reply to Mike DunnA quick overview of u-boot implementation on the treo 680...
The treo 680 has a Diskonchip G4 nand flash chip. This device has a 2k region that maps to the system bus at the reset vector in a NOR-like fashion so that it can be used as the boot device. The phone is shipped with this 2k region configured as write-protected (can't be modified) and programmed with an initial program loader (IPL). At power-up, this IPL loads the contents of two flash blocks to SDRAM and jumps to it. The capacity of the two blocks is not large enough to hold all of u-boot, so a u-boot SPL is used. To conserve flash space, these two blocks and the necessary number of subsequent blocks are programmed with a concatenated spl + u-boot image. That way, the IPL will also load a portion of u-boot proper, and when the spl runs, it relocates the portion of u-boot that the IPL has already loaded, and then resumes loading the remaining part of u-boot before jumping to it.
The default_environment is used (CONFIG_ENV_IS_NOWHERE) because I didn't think that having a writable environment was worth the cost of a flash block, although adding it would be straightforward. I abuse the CONFIG_EXTRA_ENV_SETTINGS option to specify the usbtty for the console (CONFIG_SYS_CONSOLE_IS_IN_ENV).
Support for the LCD is included, but currently it is only useful for displaying the u-boot splash screen. But if u-boot is built without the usbtty console, it does display the auto-boot progress nicely.
--- CREDITS | 4 + MAINTAINERS | 3 + board/palmtreo680/Makefile | 34 ++ board/palmtreo680/palmtreo680.c | 179 +++++++++++ board/palmtreo680/palmtreo680_spl.lds | 51 +++ boards.cfg | 1 + doc/README.palmtreo680 | 570 +++++++++++++++++++++++++++++++++ include/configs/palmtreo680.h | 295 +++++++++++++++++ tools/palmtreo680/flash_u-boot.c | 177 ++++++++++ 9 files changed, 1314 insertions(+), 0 deletions(-) create mode 100644 board/palmtreo680/Makefile create mode 100644 board/palmtreo680/palmtreo680.c create mode 100644 board/palmtreo680/palmtreo680_spl.lds create mode 100644 doc/README.palmtreo680 create mode 100644 include/configs/palmtreo680.h create mode 100644 tools/palmtreo680/flash_u-boot.c
CREDITS +4 -0
@@ -124,6 +124,10 @@ N: James F. Dougherty E: jfd at GigabitNetworks.COM D: Port to the MOUSSE board +N: Mike Dunn +E: mikedunn at newsguy.com +D: Palmtreo680 board, docg4 nand flash driver + N: Dave Ellis E: DGE at sixnetio.com D: EEPROM Speedup, SXNI855T port
MAINTAINERS +3 -0
@@ -650,6 +650,9 @@ Wolfgang Denk <[email protected]> imx27lite i.MX27 qong i.MX31 +Mike Dunn <[email protected]> + palmtreo680 pxa270 + Kristoffer Ericson <[email protected]> jornada SA1110
board/palmtreo680/Makefile new file +34 -0
@@ -0,0 +1,34 @@ +# +# Palm Treo680 Support +# +# Copyright (C) 2013 Mike Dunn <[email protected]> +# +# This file is released under the terms of GPL v2 and any later version. +# See the file COPYING in the root directory of the source tree for details. + +include $(TOPDIR)/config.mk + +LIB = $(obj)lib$(BOARD).o + +COBJS := palmtreo680.o + +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 + +#########################################################################
board/palmtreo680/palmtreo680.c new file +179 -0
179 lines not on this page · raw message
board/palmtreo680/palmtreo680_spl.lds new file +51 -0
51 lines not on this page · raw message
boards.cfg +1 -0
@@ -331,6 +331,7 @@ h2200 arm pxa lubbock arm pxa palmld arm pxa palmtc arm pxa +palmtreo680 arm pxa polaris arm pxa trizepsiv - - trizepsiv:POLARIS pxa255_idp arm pxa trizepsiv arm pxa
doc/README.palmtreo680 new file +570 -0
570 lines not on this page · raw message
include/configs/palmtreo680.h new file +295 -0
295 lines not on this page · raw message
tools/palmtreo680/flash_u-boot.c new file +177 -0
177 lines not on this page · raw message
Signature · 1 line
1.7.8.6
PATCH v2 7/7 add support for palm treo 680 board
Dear Mike Dunn,
Quoted 22 lines
A quick overview of u-boot implementation on the treo 680...
The treo 680 has a Diskonchip G4 nand flash chip. This device has a 2k region that maps to the system bus at the reset vector in a NOR-like fashion so that it can be used as the boot device. The phone is shipped with this 2k region configured as write-protected (can't be modified) and programmed with an initial program loader (IPL). At power-up, this IPL loads the contents of two flash blocks to SDRAM and jumps to it. The capacity of the two blocks is not large enough to hold all of u-boot, so a u-boot SPL is used. To conserve flash space, these two blocks and the necessary number of subsequent blocks are programmed with a concatenated spl + u-boot image. That way, the IPL will also load a portion of u-boot proper, and when the spl runs, it relocates the portion of u-boot that the IPL has already loaded, and then resumes loading the remaining part of u-boot before jumping to it.
The
default_environmentis used (CONFIG_ENV_IS_NOWHERE) because I didn't think that having a writable environment was worth the cost of a flash block, although adding it would be straightforward. I abuse theCONFIG_EXTRA_ENV_SETTINGSoption to specify the usbtty for the console (CONFIG_SYS_CONSOLE_IS_IN_ENV).
Quoted 5 lines
Support for the LCD is included, but currently it is only useful for displaying the u-boot splash screen. But if u-boot is built without the usbtty console, it does display the auto-boot progress nicely.
Signed-off-by Mike Dunn <[email protected]>
I think the tool shall really go as a separate patch. Besides, can the tool not be implemented as a part of u-boot's mkimage infrastructure?
PATCH v2 7/7 add support for palm treo 680 board
Quoted 24 lines · Marek Vasut
Dear Mike Dunn,
Quoted 22 lines
A quick overview of u-boot implementation on the treo 680...
The treo 680 has a Diskonchip G4 nand flash chip. This device has a 2k region that maps to the system bus at the reset vector in a NOR-like fashion so that it can be used as the boot device. The phone is shipped with this 2k region configured as write-protected (can't be modified) and programmed with an initial program loader (IPL). At power-up, this IPL loads the contents of two flash blocks to SDRAM and jumps to it. The capacity of the two blocks is not large enough to hold all of u-boot, so a u-boot SPL is used. To conserve flash space, these two blocks and the necessary number of subsequent blocks are programmed with a concatenated spl + u-boot image. That way, the IPL will also load a portion of u-boot proper, and when the spl runs, it relocates the portion of u-boot that the IPL has already loaded, and then resumes loading the remaining part of u-boot before jumping to it.
The
default_environmentis used (CONFIG_ENV_IS_NOWHERE) because I didn't think that having a writable environment was worth the cost of a flash block, although adding it would be straightforward. I abuse theCONFIG_EXTRA_ENV_SETTINGSoption to specify the usbtty for the console (CONFIG_SYS_CONSOLE_IS_IN_ENV).
Quoted 8 lines
Quoted 5 lines
Support for the LCD is included, but currently it is only useful for displaying the u-boot splash screen. But if u-boot is built without the usbtty console, it does display the auto-boot progress nicely.
Signed-off-by Mike Dunn <[email protected]>I think the tool shall really go as a separate patch. Besides, can the tool not be implemented as a part of u-boot's mkimage infrastructure?
OK, I can make the flash_u-boot utility (which writes u-boot to the flash boot blocks) a separate patch.
As for making it part of mkimage... I didn't really consider that because based on my (limited) knowledge, I figured they are unrelated. As I understand it, mkimage creates an OS image file that u-boot can parse and load. flash_u-boot is a utility that performs the task of writing u-boot itself to flash.
I figured that mine was a special case, since u-boot must be written in a special format (redundant pages) and in a special manner (alternate 4k regions skipped), with the flash device in a special mode, and so it can not be done in the normal manner; e.g., 'nandwrite' from mtd-utils, or its u-boot 'nand write' equivalent, even if you first ran the u-boot image through a separate utility that simply converted the format of the image.
Hope that makes sense. Any insight appreciated. I'll take a look at what's in the tools directory.
Thanks Marek,
Mike
PATCH v2 7/7 add support for palm treo 680 board
Dear Mike Dunn,
Quoted 34 lines · Marek Vasut
Quoted 24 lines
Dear Mike Dunn,
Quoted 22 lines
A quick overview of u-boot implementation on the treo 680...
The treo 680 has a Diskonchip G4 nand flash chip. This device has a 2k region that maps to the system bus at the reset vector in a NOR-like fashion so that it can be used as the boot device. The phone is shipped with this 2k region configured as write-protected (can't be modified) and programmed with an initial program loader (IPL). At power-up, this IPL loads the contents of two flash blocks to SDRAM and jumps to it. The capacity of the two blocks is not large enough to hold all of u-boot, so a u-boot SPL is used. To conserve flash space, these two blocks and the necessary number of subsequent blocks are programmed with a concatenated spl + u-boot image. That way, the IPL will also load a portion of u-boot proper, and when the spl runs, it relocates the portion of u-boot that the IPL has already loaded, and then resumes loading the remaining part of u-boot before jumping to it.
The
default_environmentis used (CONFIG_ENV_IS_NOWHERE) because I didn't think that having a writable environment was worth the cost of a flash block, although adding it would be straightforward. I abuse theCONFIG_EXTRA_ENV_SETTINGSoption to specify the usbtty for the console (CONFIG_SYS_CONSOLE_IS_IN_ENV).Quoted 8 lines
Quoted 5 lines
Support for the LCD is included, but currently it is only useful for displaying the u-boot splash screen. But if u-boot is built without the usbtty console, it does display the auto-boot progress nicely.
Signed-off-by Mike Dunn <[email protected]>I think the tool shall really go as a separate patch. Besides, can the tool not be implemented as a part of u-boot's mkimage infrastructure?
Quoted 8 lines
OK, I can make the flash_u-boot utility (which writes u-boot to the flash boot blocks) a separate patch.
As for making it part of mkimage... I didn't really consider that because based on my (limited) knowledge, I figured they are unrelated. As I understand it, mkimage creates an OS image file that u-boot can parse and load. flash_u-boot is a utility that performs the task of writing u-boot itself to flash.
It can create an bootloader image that can be written to flash using standard mtd utilities. Does this not cut it for you? Why do you need a separate flasher, because the G4 is special ?
Quoted 9 lines
I figured that mine was a special case, since u-boot must be written in a special format (redundant pages) and in a special manner (alternate 4k regions skipped), with the flash device in a special mode, and so it can not be done in the normal manner; e.g., 'nandwrite' from mtd-utils, or its u-boot 'nand write' equivalent, even if you first ran the u-boot image through a separate utility that simply converted the format of the image.
Hope that makes sense. Any insight appreciated. I'll take a look at what's in the tools directory.
I see ... so the G4 is such a horrible beast :( OK
Best regards,
Marek Vasut
v2 cover palm treo 680 smartphone board support
In reply to Mike DunnHi Mike,
Quoted 7 lines
Hi,
This patchset adds support for the Palm Treo 680 smartphone. I had to make some minor tweaks to u-boot to get things working. Most of these changes are small, and most only touch the pxa arch.
Thanks for looking.
I pushed what I considered ok to u-boot-pxa/master, please start your reworks on top of that.
Thanks!
Best regards,
Marek Vasut
v2 cover palm treo 680 smartphone board support
Quoted 4 lines · Marek Vasut
Hi Mike,
Quoted 2 lines
Hi,
Quoted 8 lines
Quoted 5 lines
This patchset adds support for the Palm Treo 680 smartphone. I had to make some minor tweaks to u-boot to get things working. Most of these changes are small, and most only touch the pxa arch.
Thanks for looking.
I pushed what I considered ok to u-boot-pxa/master, please start your reworks on top of that.
Will do. Thanks a lot for your time and effort in reviewing!
I forgot to add 'v3' to the subject line of patch 5/8 in the last set I sent:
[PATCH 5/8] lib: import bitrev library from the linux kernel
Don't know if that will cause problems or not. The contents of the patch are unchanged from v2, but the description added the HEAD commit from the kernel I took the code from, as we discussed.
Thanks again,
Mike
v2 cover palm treo 680 smartphone board support
Dear Mike Dunn,
Quoted 16 lines · Marek Vasut
Quoted 4 lines
Hi Mike,
Quoted 2 lines
Hi,
Quoted 8 lines
Quoted 5 lines
This patchset adds support for the Palm Treo 680 smartphone. I had to make some minor tweaks to u-boot to get things working. Most of these changes are small, and most only touch the pxa arch.
Thanks for looking.
I pushed what I considered ok to u-boot-pxa/master, please start your reworks on top of that.
Will do. Thanks a lot for your time and effort in reviewing!
Quoted 8 lines
I forgot to add 'v3' to the subject line of patch 5/8 in the last set I sent:
[PATCH 5/8] lib: import bitrev library from the linux kernel
Don't know if that will cause problems or not. The contents of the patch are unchanged from v2, but the description added the HEAD commit from the kernel I took the code from, as we discussed.
Don't worry, I picked most of them already.
Best regards,
Marek Vasut