Skip to contentSkip to conversation

ATSTK1000 LCD panel support

PATCH New Haavard Skinnemoen 3 participants 14 messages Sep 2, 2008 – Sep 4, 2008 Arm/Microchip (AT91) SoC support

lore
Share & tools
lore
#0 lore raw

cover ATSTK1000 LCD panel support

The following series adds support for the LCD panel on the ATSTK1000. To use this, you must first apply both of the following series:

http://lists.denx.de/pipermail/u-boot/2008-September/039826.html
http://lists.denx.de/pipermail/u-boot/2008-September/039833.html

I'm a bit unsure what to do about this. While I certainly want LCD support out of the box on all boards that support it, this patchset brings the U-Boot image size dangerously close to 128k, which is the space we currently have available with the current MTD partitioning layout hardcoded into the kernel. With NAND flash support added on top of this, the ATSTK1006 image ends up at almost 150k, and there are still other features I'd like to support in the future, e.g. libfdt, Hush parser, USB, etc.

So this means I can either merge this as-is but disabled by default (which is bad from a testing perspective), disable some other features, or change the partitioning. Doing the latter will also make it possible to introduce redundant environment, but it means current kernels will break.

Since the ATSTK1000 doesn't actually ship with a filesystem in flash by default, the breakage will probably be limited to a handful of customized boards, but people who have done this kind of customization probably won't like that the flash layout changes behind their back.

What do everyone think about this? Is redundant environment and a boatload of features worth breaking compatibility with current kernels?

Haavard

Shortlog and diffstat for the whole series follows.

Haavard Skinnemoen (6):
ATSTK1000: Make the MACBs individually selectable
avr32: Add clk and portmux infrastructure for the LCDC
avr32: Reserve memory for LCD framebuffer
spi: Add spi_xfer_single() convenience wrapper
ATSTK1000: Add driver for the onboard LCD panel
ATSTK1000: LCD support

 board/atmel/atstk1000/Makefile                    |    1 +
 board/atmel/atstk1000/atstk1000.c                 |  105 ++++++++++++++-
 board/atmel/atstk1000/ltv350qv.c                  |  157 +++++++++++++++++++++
 board/atmel/atstk1000/ltv350qv.h                  |   95 +++++++++++++
 cpu/at32ap/at32ap700x/portmux.c                   |   14 ++
 include/asm-avr32/arch-at32ap700x/chip-features.h |    5 +
 include/asm-avr32/arch-at32ap700x/clk.h           |    6 +
 include/asm-avr32/arch-at32ap700x/portmux.h       |    3 +
 include/asm-avr32/global_data.h                   |    1 +
 include/configs/atstk1002.h                       |   25 ++++
 include/configs/atstk1006.h                       |   26 ++++
 include/spi.h                                     |   15 ++-
 lib_avr32/board.c                                 |    6 +
 13 files changed, 457 insertions(+), 2 deletions(-)
 create mode 100644 board/atmel/atstk1000/ltv350qv.c
 create mode 100644 board/atmel/atstk1000/ltv350qv.h
#1 lore raw

PATCH 1/6 ATSTK1000: Make the MACBs individually selectable

Make it possible to enable just one of the two ethernet interfaces on the ATSTK1000. This is necessary for LCD support since MACB1 conflicts with the LCD controller.

---
 board/atmel/atstk1000/atstk1000.c |    8 +++++++-
 include/configs/atstk1002.h       |    3 +++
 include/configs/atstk1006.h       |    3 +++
 3 files changed, 13 insertions(+), 1 deletions(-)
board/atmel/atstk1000/atstk1000.c +7 -1
index 7be3993..31174d3 100644
@@ -79,8 +79,10 @@ int board_early_init_f(void)
 
 	portmux_enable_ebi(sdram_config.data_bits, 23, 0, PORTMUX_DRIVE_HIGH);
 	portmux_enable_usart1(PORTMUX_DRIVE_MIN);
-#if defined(CONFIG_MACB)
+#if defined(CONFIG_ATSTK1000_MACB0)
 	portmux_enable_macb0(PORTMUX_MACB_MII, PORTMUX_DRIVE_LOW);
+#endif
+#if defined(CONFIG_ATSTK1000_MACB1)
 	portmux_enable_macb1(PORTMUX_MACB_MII, PORTMUX_DRIVE_LOW);
 #endif
 #if defined(CONFIG_MMC)
@@ -122,8 +124,12 @@ extern int macb_eth_initialize(int id, void *regs, unsigned int phy_addr);
 #ifdef CONFIG_CMD_NET
 int board_eth_init(bd_t *bi)
 {
+#ifdef CONFIG_ATSTK1000_MACB0
 	macb_eth_initialize(0, (void *)MACB0_BASE, bi->bi_phy_id[0]);
+#endif
+#ifdef CONFIG_ATSTK1000_MACB1
 	macb_eth_initialize(1, (void *)MACB1_BASE, bi->bi_phy_id[1]);
+#endif
 	return 0;
 }
 #endif
include/configs/atstk1002.h +3 -0
index 85cedb2..4509416 100644
@@ -149,6 +149,9 @@
 
 #define CONFIG_ATMEL_USART		1
 #define CONFIG_MACB			1
+/* Enable both MACs by default */
+#define CONFIG_ATSTK1000_MACB0		1
+#define CONFIG_ATSTK1000_MACB1		1
 #define CONFIG_PORTMUX_PIO		1
 #define CFG_NR_PIOS			5
 #define CFG_HSDRAMC			1
include/configs/atstk1006.h +3 -0
index d4b2f12..8a6c044 100644
@@ -149,6 +149,9 @@
 
 #define CONFIG_ATMEL_USART		1
 #define CONFIG_MACB			1
+/* Enable both MACs by default */
+#define CONFIG_ATSTK1000_MACB0		1
+#define CONFIG_ATSTK1000_MACB1		1
 #define CONFIG_PORTMUX_PIO		1
 #define CFG_NR_PIOS			5
 #define CFG_HSDRAMC			1
Signature · 1 line
1.5.6.3
#2 lore raw

PATCH 2/6 avr32: Add clk and portmux infrastructure for the LCDC

---
 cpu/at32ap/at32ap700x/portmux.c                   |   14 ++++++++++++++
 include/asm-avr32/arch-at32ap700x/chip-features.h |    5 +++++
 include/asm-avr32/arch-at32ap700x/clk.h           |    6 ++++++
 include/asm-avr32/arch-at32ap700x/portmux.h       |    3 +++
 4 files changed, 28 insertions(+), 0 deletions(-)
cpu/at32ap/at32ap700x/portmux.c +14 -0
index 2a3b004..da0c9c5 100644
@@ -202,3 +202,17 @@ void portmux_enable_spi1(unsigned long cs_mask, unsigned long drive_strength)
 			PORTMUX_DIR_OUTPUT | PORTMUX_INIT_HIGH);
 }
 #endif
+
+#ifdef AT32AP700x_CHIP_HAS_LCDC
+void portmux_enable_lcdc(void)
+{
+	/*
+	 * FIXME: We want to allow the board much more control over
+	 * which pins to enable
+	 */
+	portmux_select_peripheral(PORTMUX_PORT_C, 0xfff80000,
+			PORTMUX_FUNC_A, 0);
+	portmux_select_peripheral(PORTMUX_PORT_D, 0x0003ffff,
+			PORTMUX_FUNC_A, 0);
+}
+#endif
include/asm-avr32/arch-at32ap700x/chip-features.h +5 -0
index c47107e..b6bd1cd 100644
@@ -32,4 +32,9 @@
 #define AT32AP700x_CHIP_HAS_MACB
 #endif
 
+/* AP7001 doesn't have a LCD controller */
+#if defined(CONFIG_AT32AP7000) || defined(CONFIG_AT32AP7002)
+#define AT32AP700x_CHIP_HAS_LCDC
+#endif
+
 #endif /* __ASM_AVR32_ARCH_CHIP_FEATURES_H__ */
include/asm-avr32/arch-at32ap700x/clk.h +6 -0
index 21545a3..83a76f2 100644
@@ -82,6 +82,12 @@ static inline unsigned long get_spi_clk_rate(unsigned int dev_id)
 	return get_pba_clk_rate();
 }
 #endif
+#ifdef AT32AP700x_CHIP_HAS_LCDC
+static inline unsigned long get_lcdc_clk_rate(unsigned int dev_id)
+{
+	return CONFIG_LCDC_PIXCLK_RATE;
+}
+#endif
 
 extern void clk_init(void);
 
include/asm-avr32/arch-at32ap700x/portmux.h +3 -0
index 96fe70d..491d588 100644
@@ -85,5 +85,8 @@ void portmux_enable_mmci(unsigned int slot, unsigned long flags,
 void portmux_enable_spi0(unsigned long cs_mask, unsigned long drive_strength);
 void portmux_enable_spi1(unsigned long cs_mask, unsigned long drive_strength);
 #endif
+#ifdef AT32AP700x_CHIP_HAS_LCDC
+void portmux_enable_lcdc(void);
+#endif
 
 #endif /* __ASM_AVR32_ARCH_PORTMUX_H__ */
Signature · 1 line
1.5.6.3
#3 lore raw

PATCH 3/6 avr32: Reserve memory for LCD framebuffer

Use lcd_setmem() to reserve memory for the LCD framebuffer before relocation.

---
 include/asm-avr32/global_data.h |    1 +
 lib_avr32/board.c               |    6 ++++++
 2 files changed, 7 insertions(+), 0 deletions(-)
include/asm-avr32/global_data.h +1 -0
index 007cfe4..7510401 100644
@@ -41,6 +41,7 @@ typedef	struct	global_data {
 	unsigned long	reloc_off;	/* Relocation Offset */
 	unsigned long	env_addr;	/* Address of env struct */
 	unsigned long	env_valid;	/* Checksum of env valid? */
+	unsigned long	fb_base;	/* Base address of frame buffer */
 	unsigned long	cpu_hz;		/* cpu core clock frequency */
 	void		**jt;		/* jump table */
 } gd_t;
lib_avr32/board.c +6 -0
index 4ed6c96..9bc475c 100644
@@ -238,6 +238,12 @@ void board_init_f(ulong board_type)
 	addr -= CFG_DMA_ALLOC_LEN;
 #endif
 
+#ifdef CONFIG_LCD
+	/* Reserve memory for LCD display (always full pages) */
+	addr = lcd_setmem(addr);
+	gd->fb_base = addr;
+#endif
+
 	/* Allocate a Board Info struct on a word boundary */
 	addr -= sizeof(bd_t);
 	addr &= ~3UL;
Signature · 1 line
1.5.6.3
#4 lore raw

PATCH 4/6 spi: Add spi_xfer_single() convenience wrapper

Quite often, you only want to do a single SPI transfer with chip select toggling before and after. Add a simple convenience wrapper for this purpose. For more "advanced" usage, the spi_xfer() function is still available.

---
 include/spi.h |   15 ++++++++++++++-
 1 files changed, 14 insertions(+), 1 deletions(-)
include/spi.h +14 -1
index 320e50e..be87173 100644
@@ -176,6 +176,19 @@ void spi_cs_activate(struct spi_slave *slave);
 void spi_cs_deactivate(struct spi_slave *slave);
 
 /*-----------------------------------------------------------------------
+ * Single SPI Transfer
+ *
+ * Convenience wrapper for doing a single SPI transfer, i.e. asserting
+ * CS before, and deasserting it after the transfer.
+ */
+static inline int spi_xfer_single(struct spi_slave *slave,
+		unsigned int bitlen, const void *dout, void *din)
+{
+	return spi_xfer(slave, bitlen, dout, din,
+			SPI_XFER_BEGIN | SPI_XFER_END);
+}
+
+/*-----------------------------------------------------------------------
  * Write 8 bits, then read 8 bits.
  *   slave:	The SPI slave we're communicating with
  *   byte:	Byte to be written
@@ -193,7 +206,7 @@ static inline int spi_w8r8(struct spi_slave *slave, unsigned char byte)
 	dout[0] = byte;
 	dout[1] = 0;
 
-	ret = spi_xfer(slave, 16, dout, din, SPI_XFER_BEGIN | SPI_XFER_END);
+	ret = spi_xfer_single(slave, 16, dout, din);
 	return ret < 0 ? ret : din[1];
 }
 
Signature · 1 line
1.5.6.3
#5 lore raw

PATCH 5/6 ATSTK1000: Add driver for the onboard LCD panel

From: Haavard Skinnemoen <[email protected]>

This adds mode definitions and initialization code for the on-board Samsung LTV350QV panel.

---
 board/atmel/atstk1000/Makefile   |    1 +
 board/atmel/atstk1000/ltv350qv.c |  157 ++++++++++++++++++++++++++++++++++++++
 board/atmel/atstk1000/ltv350qv.h |   95 +++++++++++++++++++++++
 3 files changed, 253 insertions(+), 0 deletions(-)
 create mode 100644 board/atmel/atstk1000/ltv350qv.c
 create mode 100644 board/atmel/atstk1000/ltv350qv.h
board/atmel/atstk1000/Makefile +1 -0
index f9b26e5..8d4f32c 100644
@@ -28,6 +28,7 @@ LIB			:= $(obj)lib$(BOARD).a
 
 COBJS-y			+= $(BOARD).o
 COBJS-y			+= flash.o
+COBJS-$(CONFIG_LCD)	+= ltv350qv.o
 
 SRCS			:= $(SOBJS-y:.o=.S) $(COBJS-y:.o=.c)
 OBJS			:= $(addprefix $(obj),$(SOBJS-y) $(COBJS-y))
board/atmel/atstk1000/ltv350qv.c new file +157 -0

157 lines not on this page · raw message

board/atmel/atstk1000/ltv350qv.h new file +95 -0

95 lines not on this page · raw message

Signature · 1 line
1.5.6.3
#6 lore raw

PATCH 6/6 ATSTK1000: LCD support

Add the necessary glue and enable LCD support on ATSTK1002 and ATSTK1006.

---
 board/atmel/atstk1000/atstk1000.c |   97 +++++++++++++++++++++++++++++++++++++
 include/configs/atstk1002.h       |   22 ++++++++
 include/configs/atstk1006.h       |   23 +++++++++
 3 files changed, 142 insertions(+), 0 deletions(-)
board/atmel/atstk1000/atstk1000.c +97 -0
index 31174d3..d88db5d 100644
@@ -24,6 +24,7 @@
 #include <asm/io.h>
 #include <asm/sdram.h>
 #include <asm/arch/clk.h>
+#include <asm/arch/gpio.h>
 #include <asm/arch/hmatrix.h>
 #include <asm/arch/portmux.h>
 
@@ -72,8 +73,59 @@ static const struct sdram_config sdram_config = {
 #endif
 };
 
+#ifdef CONFIG_LCD
+#include <lcd.h>
+#include <atmel_lcdc.h>
+
+vidinfo_t panel_info = {
+	.vl_col			= 320,
+	.vl_row			= 240,
+	.vl_clk			= 6891000,
+	.vl_sync		= ATMEL_LCDC_INVCLK_INVERTED
+					| ATMEL_LCDC_INVFRAME_INVERTED
+					| ATMEL_LCDC_INVLINE_INVERTED,
+	.vl_bpix		= LCD_BPP,
+	.vl_tft			= 1,
+	.vl_hsync_len		= 16,
+	.vl_left_margin		= 17,
+	.vl_right_margin	= 33,
+	.vl_vsync_len		= 1,
+	.vl_upper_margin	= 10,
+	.vl_lower_margin	= 10,
+	.mmio			= LCDC_BASE,
+};
+
+#ifdef CONFIG_LCD_INFO
+#include <version.h>
+
+void lcd_show_board_info(void)
+{
+	unsigned int i;
+	unsigned long dram_size = 0;
+	char mhz[32];
+
+	lcd_printf("%s\n", U_BOOT_VERSION);
+	lcd_printf("%s (C) 2008 Atmel Corporation\n", CFG_BOARD_NAME);
+	lcd_printf("%s CPU at %s MHz\n", CFG_CPU_NAME, strmhz(mhz, gd->cpu_hz));
+	for (i = 0; i < CONFIG_NR_DRAM_BANKS; i++)
+		dram_size += gd->bd->bi_dram[i].size;
+	lcd_printf("  %ld MiB SDRAM, %ld MiB Flash\n",
+			dram_size >> 20, gd->bd->bi_flashsize >> 20);
+}
+#endif
+
+int board_postclk_init(void)
+{
+	gclk_set_rate(GCLK_LCDC_PIXCLK, GCLK_PARENT_PLL0,
+			CONFIG_LCDC_PIXCLK_RATE);
+	return 0;
+}
+#endif
+
 int board_early_init_f(void)
 {
+	unsigned int spi_cs_mask = 0;
+
 	/* Enable SDRAM in the EBI mux */
 	hmatrix_slave_write(EBI, SFR, HMATRIX_BIT(EBI_SDRAM_ENABLE));
 
@@ -88,6 +140,16 @@ int board_early_init_f(void)
 #if defined(CONFIG_MMC)
 	portmux_enable_mmci(0, PORTMUX_MMCI_4BIT, PORTMUX_DRIVE_LOW);
 #endif
+#if defined(CONFIG_ATMEL_SPI)
+#if defined(CONFIG_LCD)
+	spi_cs_mask |= 1 << CFG_LCD_NPCS;
+#endif
+#endif
+	if (spi_cs_mask)
+		portmux_enable_spi0(spi_cs_mask, PORTMUX_DRIVE_LOW);
+#if defined(CONFIG_LCD)
+	portmux_enable_lcdc();
+#endif
 
 	return 0;
 }
@@ -133,3 +195,38 @@ int board_eth_init(bd_t *bi)
 	return 0;
 }
 #endif
+
+#ifdef CONFIG_ATMEL_SPI
+#include <spi.h>
+
+int spi_cs_is_valid(unsigned int bus, unsigned int cs)
+{
+#if defined(CONFIG_LCD)
+	if (bus == 0 && cs == CFG_LCD_NPCS)
+		return 1;
+#endif
+	return 0;
+}
+
+void spi_cs_activate(struct spi_slave *slave)
+{
+	switch (slave->cs) {
+#ifdef CONFIG_LCD
+	case CFG_LCD_NPCS:
+		gpio_set_value(CFG_LCD_NPCS_PIN, 0);
+		break;
+#endif
+	}
+}
+
+void spi_cs_deactivate(struct spi_slave *slave)
+{
+	switch (slave->cs) {
+#ifdef CONFIG_LCD
+	case CFG_LCD_NPCS:
+		gpio_set_value(CFG_LCD_NPCS_PIN, 1);
+		break;
+#endif
+	}
+}
+#endif /* CONFIG_ATMEL_SPI */
include/configs/atstk1002.h +22 -0
index 4509416..dc20620 100644
@@ -32,6 +32,9 @@
 #define CONFIG_ATSTK1002		1
 #define CONFIG_ATSTK1000		1
 
+#define CFG_CPU_NAME			"AT32AP7000"
+#define CFG_BOARD_NAME			"ATSTK1002"
+
 #define CONFIG_ATSTK1000_EXT_FLASH	1
 
 /*
@@ -129,6 +132,8 @@
 #define CONFIG_BOOTP_SUBNETMASK
 #define CONFIG_BOOTP_GATEWAY
 
+/* LCD support. This will affect a few other settings */
+#define CONFIG_LCD			1
 
 /*
  * Command line configuration.
@@ -158,6 +163,23 @@
 #define CONFIG_MMC			1
 #define CONFIG_ATMEL_MCI		1
 
+#ifdef CONFIG_LCD
+/* Second MACB conflicts with LCD signals */
+#undef CONFIG_ATSTK1000_MACB1
+#define CONFIG_ATMEL_SPI		1
+#define CFG_LCD_NPCS			1
+#define CFG_LCD_NPCS_PIN		GPIO_PIN_PA(4)
+#define CONFIG_ATMEL_LCD		1
+#define CONFIG_LCDC_PIXCLK_RATE		PLL0_RATE
+#define CONFIG_ATMEL_LCD_BGR555		1
+#define LCD_BPP				LCD_COLOR8
+#define CONFIG_LCD_LOGO			1
+#define CONFIG_LCD_INFO			1
+#define CONFIG_LCD_INFO_BELOW_LOGO	1
+#define CFG_WHITE_ON_BLACK		1
+#define CFG_CONSOLE_IS_IN_ENV		1
+#endif
+
 #define CFG_DCACHE_LINESZ		32
 #define CFG_ICACHE_LINESZ		32
 
include/configs/atstk1006.h +23 -0
index 8a6c044..b97032f 100644
@@ -32,6 +32,9 @@
 #define CONFIG_ATSTK1006		1
 #define CONFIG_ATSTK1000		1
 
+#define CFG_CPU_NAME			"AT32AP7000"
+#define CFG_BOARD_NAME			"ATSTK1006"
+
 #define CONFIG_ATSTK1000_EXT_FLASH	1
 
 /*
@@ -130,6 +133,9 @@
 #define CONFIG_BOOTP_GATEWAY
 
 
+/* LCD support. This will affect a few other settings */
+#define CONFIG_LCD			1
+
 /*
  * Command line configuration.
  */
@@ -158,6 +164,23 @@
 #define CONFIG_MMC			1
 #define CONFIG_ATMEL_MCI		1
 
+#ifdef CONFIG_LCD
+/* Second MACB conflicts with LCD signals */
+#undef CONFIG_ATSTK1000_MACB1
+#define CONFIG_ATMEL_SPI		1
+#define CFG_LCD_NPCS			1
+#define CFG_LCD_NPCS_PIN		GPIO_PIN_PA(4)
+#define CONFIG_ATMEL_LCD		1
+#define CONFIG_LCDC_PIXCLK_RATE		PLL0_RATE
+#define CONFIG_ATMEL_LCD_BGR555		1
+#define LCD_BPP				LCD_COLOR8
+#define CONFIG_LCD_LOGO			1
+#define CONFIG_LCD_INFO			1
+#define CONFIG_LCD_INFO_BELOW_LOGO	1
+#define CFG_WHITE_ON_BLACK		1
+#define CFG_CONSOLE_IS_IN_ENV		1
+#endif
+
 #define CFG_DCACHE_LINESZ		32
 #define CFG_ICACHE_LINESZ		32
 
Signature · 1 line
1.5.6.3
#7 lore raw

cover ATSTK1000 LCD panel support

In reply to Haavard Skinnemoen
Quoted 26 lines

The following series adds support for the LCD panel on the ATSTK1000. To use this, you must first apply both of the following series:

http://lists.denx.de/pipermail/u-boot/2008-September/039826.html
http://lists.denx.de/pipermail/u-boot/2008-September/039833.html

I'm a bit unsure what to do about this. While I certainly want LCD support out of the box on all boards that support it, this patchset brings the U-Boot image size dangerously close to 128k, which is the space we currently have available with the current MTD partitioning layout hardcoded into the kernel. With NAND flash support added on top of this, the ATSTK1006 image ends up at almost 150k, and there are still other features I'd like to support in the future, e.g. libfdt, Hush parser, USB, etc.

So this means I can either merge this as-is but disabled by default (which is bad from a testing perspective), disable some other features, or change the partitioning. Doing the latter will also make it possible to introduce redundant environment, but it means current kernels will break.

Since the ATSTK1000 doesn't actually ship with a filesystem in flash by default, the breakage will probably be limited to a handful of customized boards, but people who have done this kind of customization probably won't like that the flash layout changes behind their back.

Quoted 6 lines

What do everyone think about this? Is redundant environment and a boatload of features worth breaking compatibility with current kernels?

Haavard

I would prefer more testing over user/developer compability.

But if you resize the partition for u-boot be sure to resize to 256k and not 192k, since this would cause a lot more problems than needed for us using flash chips with 128k block size. Not a big problem but an issue.

I would love to see USB support implemented.

Regards
Eirik Aanonsen

#8 lore raw

cover ATSTK1000 LCD panel support

Quoted 1 line · Eirik Aanonsen

I would prefer more testing over user/developer compability.

Yes. I don't feel good about merging something which no boards use by default.

Quoted 3 lines

But if you resize the partition for u-boot be sure to resize to 256k and not 192k, since this would cause a lot more problems than needed for us using flash chips with 128k block size. Not a big problem but an issue.

I'm talking about changing the partitioning specifically on ATSTK1000. Other boards can do whatever they want. But it may be a good idea to reserve 256k anyway since it becomes less likely that we'll have to do the same thing all over again in the future.

Also note that we're not talking about increasing the size of the boot loader in general -- if you have a custom board and don't want to spend 256k of flash on the boot loader, you'll just have to not enable these space-consuming features.

I have to say I was a bit surprised by the size of the NAND code though. The LCD code is sort of excused since it sucks in a big uncompressed logo...

Quoted 1 line

I would love to see USB support implemented.

Yeah...maybe I shouldn't have said that ;-) It would be cool to be able to run console over USB, but I don't know if U-Boot has any USB gadget support...so it might take a while to implement.

Haavard

#9 lore raw

cover ATSTK1000 LCD panel support

Quoted 6 lines
Quoted 1 line

I would prefer more testing over user/developer compability.

Yes. I don't feel good about merging something which no boards use by default.

Quoted 1 line

But if you resize the partition for u-boot be sure to resize to 256k

and

Quoted 1 line

not 192k, since this would cause a lot more problems than needed for

Quoted 8 lines

us

Quoted 1 line

using flash chips with 128k block size. Not a big problem but an

issue.

I'm talking about changing the partitioning specifically on ATSTK1000. Other boards can do whatever they want. But it may be a good idea to reserve 256k anyway since it becomes less likely that we'll have to do the same thing all over again in the future.

But making it more likely to have equal partitions makes it easier to test kernels on different boards for debugging. I use my kernel on both the stk1000 and my own custom board. Then again no big deal but makes compliance/testing easier.

...

Quoted 4 lines

I have to say I was a bit surprised by the size of the NAND code though. The LCD code is sort of excused since it sucks in a big uncompressed logo...

Is there any plans for supporting the UBI/UBIFS, or is it planned? ( prob. not but yes it is large, but too large? )

Quoted 5 lines
Quoted 1 line

I would love to see USB support implemented.

Yeah...maybe I shouldn't have said that ;-) It would be cool to be able to run console over USB, but I don't know if U-Boot has any USB gadget support...so it might take a while to implement.

I think besides a usb core there is not much useful released relating to gadget drivers at least.
No, pressure :)

Quoted 2 lines

Haavard

Eirik Aa

#10 lore raw

cover ATSTK1000 LCD panel support

Quoted 9 lines · Eirik Aanonsen
Quoted 4 lines

I'm talking about changing the partitioning specifically on ATSTK1000. Other boards can do whatever they want. But it may be a good idea to reserve 256k anyway since it becomes less likely that we'll have to do the same thing all over again in the future.

But making it more likely to have equal partitions makes it easier to test kernels on different boards for debugging. I use my kernel on both the stk1000 and my own custom board. Then again no big deal but makes compliance/testing easier.

Right. I was thinking maybe we could extend the boot protocol to pass partitioning information from u-boot to the kernel -- that should make it possible to run the same kernel on boards with different flash layout as long as the in-flash u-boot is consistent with the flash layout.

One problem this doesn't solve is that if you load an older kernel which doesn't understand the extended boot protocol, it will keep using the old flash layout.

Quoted 6 lines
Quoted 3 lines

I have to say I was a bit surprised by the size of the NAND code though. The LCD code is sort of excused since it sucks in a big uncompressed logo...

Is there any plans for supporting the UBI/UBIFS, or is it planned? ( prob. not but yes it is large, but too large? )

I've seen some discussions with patches on the upstream u-boot list. Would be very nice to have.

I suspect some of the problem with the NAND code is all the default ops which aren't used by anything but can't be garbage collected by the linker because they are referenced by nand_set_defaults().

Haavard

#11 lore raw

cover ATSTK1000 LCD panel support

Quoted 5 lines · Haavard Skinnemoen

Right. I was thinking maybe we could extend the boot protocol to pass partitioning information from u-boot to the kernel -- that should make it possible to run the same kernel on boards with different flash layout as long as the in-flash u-boot is consistent with the flash layout.

If we do end up with libfdt on avr32 then we solve our problems here too, we can encapsulate this partitioning in the fdt image. But, as I understand it, that involves not only the actual libfdt support but making all avr32 driver nice and OF compatible. At least, if we want the fdt support to be _useful_ then that needs to happen (CMIIW).

Quoted 4 lines

One problem this doesn't solve is that if you load an older kernel which doesn't understand the extended boot protocol, it will keep using the old flash layout.

Doesn't the MTD system have facility to override partitioning information from the boot arguments? If so then any big u-boots can just ship with such a clause in their default bootargs, job done. Have to look in to that...

	--Ben.
#12 lore raw

cover ATSTK1000 LCD panel support

Quoted 10 lines · Ben Nizette
Quoted 5 lines · Haavard Skinnemoen

Right. I was thinking maybe we could extend the boot protocol to pass partitioning information from u-boot to the kernel -- that should make it possible to run the same kernel on boards with different flash layout as long as the in-flash u-boot is consistent with the flash layout.

If we do end up with libfdt on avr32 then we solve our problems here too, we can encapsulate this partitioning in the fdt image.

Yes, we can probably do that. I guess it all depends on what we want to do first.

Quoted 4 lines

But, as I
understand it, that involves not only the actual libfdt support but making all avr32 driver nice and OF compatible. At least, if we want the fdt support to be _useful_ then that needs to happen (CMIIW).

Or we could just add a glue layer which creates platform_devices based on the fdt information. Perhaps pass along a pointer to the device tree node for drivers that want to peek at it. PowerPC has a of_node in struct dev_archdata for this purpose I believe.

Quoted 8 lines
Quoted 3 lines

One problem this doesn't solve is that if you load an older kernel which doesn't understand the extended boot protocol, it will keep using the old flash layout.

Doesn't the MTD system have facility to override partitioning information from the boot arguments? If so then any big u-boots can just ship with such a clause in their default bootargs, job done. Have to look in to that...

Yes. But it won't fix boards which already have a valid environment and just want to upgrade u-boot. We could perhaps fix up the bootargs and add partitioning information when preparing to boot the kernel...

Haavard

#13 lore raw

cover ATSTK1000 LCD panel support

Quoted 11 lines · Haavard Skinnemoen
Quoted 5 lines · Ben Nizette

Doesn't the MTD system have facility to override partitioning information from the boot arguments? If so then any big u-boots can just ship with such a clause in their default bootargs, job done. Have to look in to that...

Yes. But it won't fix boards which already have a valid environment and just want to upgrade u-boot. We could perhaps fix up the bootargs and add partitioning information when preparing to boot the kernel...

Hmm, I don't think anything we do will fix the case of people just trying to upgrade u-boot but keeping an old environment. Fixing the partitioning information as the kernel sees it won't alter the actual partition layout in flash, we're going to need the user's help there, and if they're repartitioning their flash there's a good chance they just nuked their old environment anyway.

Right, I give in, prolly best to just keep the LCD support disabled by default, stick a page on the 'freaks wiki explaining all the steps to turn it on and try and point as many people towards that as possible.

	--Ben.