Collected fixes and improvements
Subsystems (6)
v2 cover Collected fixes and improvements
This series contains a hodge-podge of minor fixes and improvements in various areas. They were found while adjusting mainline Nyan-big to work with Chrome OS verified boot.
Rather than send a large number of individual patches I decide to collect them into a series. They should all be independent so can be applied without coordination.
Sample of areas covered:
- Detect a USB device being connected/disconnected
- TPM support with CONFIG_DM_I2C
- Detect when U-Boot is started from SPL
- ARM binary output and boot tweaks
- Small LCD BMP-drawing improvement
- Tegra removable MMC support
- Various small nits in driver model, sandbox, etc.
Changes in v2:
- Fix use of 'hub' instead of 'dev' in usb_detect_change()
- Clarify that this commit provides only the API, not the implementation
- Rename constant to UBOOT_NOT_LOADED_FROM_SPL
- Add new patch to remove typedefs from bmp_layout.h
- Rename constant to UBOOT_NOT_LOADED_FROM_SPL
- Use tegra-pinmux-scripts to update the pinmux
- Drop applied patches from the series
Simon Glass (9):
dm: usb: Implement usb_detect_change() for driver model
arm: spl: Add an API to detect when U-Boot is started from SPL
arm: Allow cleanup_before_linux() without disabling caches
sandbox: Add an implementation for cleanup_before_linux_select() Remove typedefs from bmp_layout.h
lcd: Support colour lookup table on 16bpp display in BMP images
tegra124: Implement spl_was_boot_source()
tegra: nyan-big: Allow TPM on I2C
tegra124: Expand SPL space by 8KB
arch/arm/cpu/armv7/cpu.c | 47 ++++++++++++++++---------- arch/arm/mach-tegra/board.c | 16 +++++++++ arch/sandbox/cpu/cpu.c | 5 +++ board/nvidia/nyan-big/pinmux-config-nyan-big.h | 8 ++--- common/cmd_bmp.c | 16 ++++----- common/lcd.c | 33 +++++++++++++----- drivers/usb/host/usb-uclass.c | 43 +++++++++++++++++++++++ drivers/video/atmel_lcdfb.c | 4 +-- drivers/video/bus_vcxk.c | 4 +-- drivers/video/cfb_console.c | 10 +++--- include/bmp_layout.h | 17 +++++----- include/common.h | 15 ++++++++ include/configs/tegra124-common.h | 2 +- include/spl.h | 13 +++++++ 14 files changed, 176 insertions(+), 57 deletions(-)
Signature · 1 line
2.2.0.rc0.207.ga3a616c
PATCH v2 1/9 dm: usb: Implement usb_detect_change() for driver model
Support this function with driver model also (CONFIG_DM_USB).
---
Changes in v2:
- Fix use of 'hub' instead of 'dev' in usb_detect_change()
drivers/usb/host/usb-uclass.c | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+)
drivers/usb/host/usb-uclass.c +43 -0
@@ -628,6 +628,49 @@ int usb_scan_device(struct udevice *parent, int port,return 0 ; } +/* +* Detect if a USB device has been plugged or unplugged. +*/ +int usb_detect_change (void ) +{ +struct udevice *hub; +struct uclass *uc; +int change =0 ; +int ret; + + ret =uclass_get (UCLASS_USB_HUB , &uc); +if (ret) +return ret; + + uclass_foreach_dev(hub, uc) { +struct usb_device *udev; +struct udevice *dev; + +if (!device_active (hub)) +continue ; +for (device_find_first_child (hub, &dev); + dev; +device_find_next_child (&dev)) { +struct usb_port_status status; + +if (!device_active (dev)) +continue ; + + udev =dev_get_parentdata (dev); +if (usb_get_port_status (udev, udev->portnr, &status) + <0 ) +/* USB request failed */ +continue ; + +if (le16_to_cpu (status.wPortChange) & +USB_PORT_STAT_C_CONNECTION ) + change++; + } + } + +return change; +} +int usb_child_post_bind (struct udevice *dev) {struct usb_dev_platdata *plat =dev_get_parent_platdata (dev);
Signature · 1 line
2.2.0.rc0.207.ga3a616c
PATCH v2 1/9 dm: usb: Implement usb_detect_change() for driver model
Quoted 10 lines · Simon Glass
Support this function with driver model also (
CONFIG_DM_USB).Signed-off-by Simon Glass <[email protected]>---
Changes in v2:
- Fix use of 'hub' instead of 'dev' inusb_detect_change()drivers/usb/host/usb-uclass.c | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+)
Applied to u-boot-dm.
PATCH v2 2/9 arm: spl: Add an API to detect when U-Boot is started from SPL
In reply to Simon GlassFor secure boot systems it is common to have a read-only U-Boot which starts the machine and jumps to a read-write U-Boot for actual booting the OS. This allows the read-write U-Boot to be upgraded without risk of permanently bricking the machine. In the event that the read-write U-Boot is corrupted, the read-only U-Boot can detect this with a checksum and boot into a recovery flow.
To support this, add a way to detect when U-Boot is run from SPL as opposed to some other method, such as booted directly (no SPL) or started from another source (e.g. a primary U-Boot). This works by putting a special value in r0.
For now we rely on board-specific code to actually check the register and set a flag. At some point this could be generalised, perhaps by using a spare register and passing a flag to _main and/or board_init_f().
This commit does not implement any feature, but merely provides the API for boards to implement.
---
Changes in v2:
- Clarify that this commit provides only the API, not the implementation
- Rename constant to UBOOT_NOT_LOADED_FROM_SPL
include/spl.h | 13 +++++++++++++ 1 file changed, 13 insertions(+)
include/spl.h +13 -0
@@ -11,6 +11,8 @@#include <linux/compiler.h> #include <asm/spl.h> +/* Value in r0 indicates we booted from U-Boot */ +#define UBOOT_NOT_LOADED_FROM_SPL 0x13578642/* Boot type */ #define MMCSD_MODE_UNDEFINED 0
@@ -82,4 +84,15 @@ int spl_load_image_ext_os(block_dev_desc_t *block_dev, int partition);#ifdef CONFIG_SPL_BOARD_INIT void spl_board_init (void );#endif + +/** +* spl_was_boot_source() - check if U-Boot booted from SPL +* +* This will normally be true, but if U-Boot jumps to second U-Boot, it will +* be false. This should be implemented by board-specific code. +* +* @return true if U-Boot booted from SPL, else false +*/ +bool spl_was_boot_source (void ); +#endif
Signature · 1 line
2.2.0.rc0.207.ga3a616c
PATCH v2 2/9 arm: spl: Add an API to detect when U-Boot is started from SPL
Quoted 20 lines · Simon Glass
For secure boot systems it is common to have a read-only U-Boot which starts the machine and jumps to a read-write U-Boot for actual booting the OS. This allows the read-write U-Boot to be upgraded without risk of permanently bricking the machine. In the event that the read-write U-Boot is corrupted, the read-only U-Boot can detect this with a checksum and boot into a recovery flow.
To support this, add a way to detect when U-Boot is run from SPL as opposed to some other method, such as booted directly (no SPL) or started from another source (e.g. a primary U-Boot). This works by putting a special value in r0.
For now we rely on board-specific code to actually check the register and set a flag. At some point this could be generalised, perhaps by using a spare register and passing a flag to
_mainand/orboard_init_f().This commit does not implement any feature, but merely provides the API for boards to implement.
Signed-off-by Simon Glass <[email protected]>
Quoted 8 lines
---
Changes in v2:
- Clarify that this commit provides only the API, not the implementation
- Rename constant toUBOOT_NOT_LOADED_FROM_SPLinclude/spl.h | 13 +++++++++++++ 1 file changed, 13 insertions(+)
Applied to u-boot-dm.
PATCH v2 3/9 arm: Allow cleanup_before_linux() without disabling caches
In reply to Simon GlassThis function is used before jumping to U-Boot, but in that case we don't always want to disable caches.
---
Changes in v2: None
arch/arm/cpu/armv7/cpu.c | 47 +++++++++++++++++++++++++++++------------------ include/common.h | 15 +++++++++++++++ 2 files changed, 44 insertions(+), 18 deletions(-)
arch/arm/cpu/armv7/cpu.c +29 -18
@@ -24,7 +24,7 @@void __weak cpu_cache_initialization (void ){} -int cleanup_before_linux (void ) +int cleanup_before_linux_select (int flags) {/* * this function is called just before we call linux
@@ -42,24 +42,30 @@ int cleanup_before_linux(void)icache_disable ();invalidate_icache_all (); -/* -* turn off D-cache -* dcache_disable() in turn flushes the d-cache and disables MMU -*/ -dcache_disable (); -v7_outer_cache_disable (); +if (flags &CBL_DISABLE_CACHES ) { +/* +* turn off D-cache +* dcache_disable() in turn flushes the d-cache and disables MMU +*/ +dcache_disable (); +v7_outer_cache_disable (); -/* -* After D-cache is flushed and before it is disabled there may -* be some new valid entries brought into the cache. We are sure -* that these lines are not dirty and will not affect our execution. -* (because unwinding the call-stack and setting a bit in CP15 SCTLR -* is all we did during this. We have not pushed anything on to the -* stack. Neither have we affected any static data) -* So just invalidate the entire d-cache again to avoid coherency -* problems for kernel -*/ -invalidate_dcache_all (); +/* +* After D-cache is flushed and before it is disabled there may +* be some new valid entries brought into the cache. We are +* sure that these lines are not dirty and will not affect our +* execution. (because unwinding the call-stack and setting a +* bit in CP15 SCTRL is all we did during this. We have not +* pushed anything on to the stack. Neither have we affected +* any static data) So just invalidate the entire d-cache again +* to avoid coherency problems for kernel +*/ +invalidate_dcache_all (); + }else { +flush_dcache_all (); +invalidate_icache_all (); +icache_enable (); + }/* * Some CPU need more cache attention before starting the kernel.
@@ -68,3 +74,8 @@ int cleanup_before_linux(void)return 0 ; } + +int cleanup_before_linux (void ) +{ +return cleanup_before_linux_select (CBL_ALL ); +}
include/common.h +15 -0
@@ -714,6 +714,21 @@ void invalidate_dcache_range(unsigned long start, unsigned long stop);void invalidate_dcache_all (void );void invalidate_icache_all (void ); +enum { +/* Disable caches (else flush caches but leave them active) */ +CBL_DISABLE_CACHES =1 <<0 , +CBL_SHOW_BOOTSTAGE_REPORT =1 <<1 , + +CBL_ALL =3 , +}; + +/** +* Clean up ready for linux +* +* @param flags Flags to control what is done +*/ +int cleanup_before_linux_select (int flags); +/* arch/$(ARCH)/lib/ticks.S */ uint64_t get_ticks (void );void wait_ticks (unsigned long );
Signature · 1 line
2.2.0.rc0.207.ga3a616c
PATCH v2 3/9 arm: Allow cleanup_before_linux() without disabling caches
Quoted 5 lines · Simon Glass
This function is used before jumping to U-Boot, but in that case we don't always want to disable caches.
Signed-off-by Simon Glass <[email protected]>Signed-off-by Vadim Bendebury <[email protected]>
Quoted 7 lines
---
Changes in v2: None
arch/arm/cpu/armv7/cpu.c | 47 +++++++++++++++++++++++++++++------------------ include/common.h | 15 +++++++++++++++ 2 files changed, 44 insertions(+), 18 deletions(-)
Applied to u-boot-dm.
PATCH v2 4/9 sandbox: Add an implementation for cleanup_before_linux_select()
In reply to Simon GlassSupport this function so we can use Chrome OS verified boot with sandbox.
---
Changes in v2: None
arch/sandbox/cpu/cpu.c | 5 +++++ 1 file changed, 5 insertions(+)
arch/sandbox/cpu/cpu.c +5 -0
@@ -50,6 +50,11 @@ int cleanup_before_linux(void)return 0 ; } +int cleanup_before_linux_select (int flags) +{ +return 0 ; +} +void *map_physmem (phys_addr_t paddr,unsigned long len,unsigned long flags) {#ifdef CONFIG_PCI
Signature · 1 line
2.2.0.rc0.207.ga3a616c
PATCH v2 4/9 sandbox: Add an implementation for cleanup_before_linux_select()
Quoted 9 lines · Simon Glass
Support this function so we can use Chrome OS verified boot with sandbox.
Signed-off-by Simon Glass <[email protected]>---
Changes in v2: None
arch/sandbox/cpu/cpu.c | 5 +++++ 1 file changed, 5 insertions(+)
Applied to u-boot-dm.
PATCH v2 5/9 Remove typedefs from bmp_layout.h
In reply to Simon GlassWe try to avoid typedefs and these ones are easy enough to remove. Before changing this header in the next patch, remove the typedefs.
---
Changes in v2:
- Add new patch to remove typedefs from bmp_layout.h
common/cmd_bmp.c | 16 ++++++++-------- common/lcd.c | 10 +++++----- drivers/video/atmel_lcdfb.c | 4 ++-- drivers/video/bus_vcxk.c | 4 ++-- drivers/video/cfb_console.c | 10 +++++----- include/bmp_layout.h | 17 ++++++++--------- 6 files changed, 30 insertions(+), 31 deletions(-)
common/cmd_bmp.c +8 -8
@@ -34,12 +34,12 @@ static int bmp_info (ulong addr);* didn't contain a valid BMP signature. */ #ifdef CONFIG_VIDEO_BMP_GZIP -bmp_image_t *gunzip_bmp (unsigned long addr,unsigned long *lenp, -void **alloc_addr) +struct bmp_image *gunzip_bmp (unsigned long addr,unsigned long *lenp, +void **alloc_addr) {void *dst;unsigned long len; -bmp_image_t *bmp; +struct bmp_image *bmp;/* * Decompress bmp image
@@ -55,7 +55,7 @@ bmp_image_t *gunzip_bmp(unsigned long addr, unsigned long *lenp, bmp = dst;/* align to 32-bit-aligned-address + 2 */ - bmp = (bmp_image_t *)((((unsigned int )dst +1 ) & ~3 ) +2 ); + bmp = (struct bmp_image *)((((unsigned int )dst +1 ) & ~3 ) +2 );if (gunzip (bmp,CONFIG_SYS_VIDEO_LOGO_MAX_SIZE , (uchar *)addr, &len) !=0 ) {free (dst);
@@ -80,8 +80,8 @@ bmp_image_t *gunzip_bmp(unsigned long addr, unsigned long *lenp, return bmp; }#else -bmp_image_t *gunzip_bmp (unsigned long addr,unsigned long *lenp, -void **alloc_addr) +struct bmp_image *gunzip_bmp (unsigned long addr,unsigned long *lenp, +void **alloc_addr) {return NULL ; }
@@ -187,7 +187,7 @@ U_BOOT_CMD(*/ static int bmp_info (ulong addr) { -bmp_image_t *bmp=(bmp_image_t *)addr; +struct bmp_image *bmp = (struct bmp_image *)addr;void *bmp_alloc_addr =NULL ;unsigned long len;
@@ -224,7 +224,7 @@ static int bmp_info(ulong addr)int bmp_display (ulong addr,int x,int y) {int ret; -bmp_image_t *bmp = (bmp_image_t *)addr; +struct bmp_image *bmp = (struct bmp_image *)addr;void *bmp_alloc_addr =NULL ;unsigned long len;
common/lcd.c +5 -5
@@ -448,8 +448,8 @@ static void draw_encoded_bitmap(ushort **fbp, ushort c, int cnt)/* * Do not call this function directly, must be called from lcd_display_bitmap. */ -static void lcd_display_rle8_bitmap (bmp_image_t *bmp,ushort *cmap,uchar *fb, -int x_off,int y_off) +static void lcd_display_rle8_bitmap (struct bmp_image *bmp,ushort *cmap, +uchar *fb,int x_off,int y_off) {uchar *bmap;ulong width, height;
@@ -548,10 +548,10 @@ __weak void fb_put_word(uchar **fb, uchar **from) }#endif /* CONFIG_BMP_16BPP */ -__weak void lcd_set_cmap (bmp_image_t *bmp,unsigned colors) +__weak void lcd_set_cmap (struct bmp_image *bmp,unsigned colors) {int i; -bmp_color_table_entry_t cte; +struct bmp_color_table_entry cte;ushort *cmap =configuration_get_cmap ();for (i =0 ; i < colors; ++i) {
@@ -572,7 +572,7 @@ int lcd_display_bitmap(ulong bmp_image, int x, int y)ushort *cmap_base =NULL ;ushort i, j;uchar *fb; -bmp_image_t *bmp = (bmp_image_t *)map_sysmem (bmp_image,0 ); +struct bmp_image *bmp = (struct bmp_image *)map_sysmem (bmp_image,0 );uchar *bmap;ushort padded_width;unsigned long width, height, byte_width;
drivers/video/atmel_lcdfb.c +2 -2
@@ -81,12 +81,12 @@ void lcd_setcolreg(ushort regno, ushort red, ushort green, ushort blue)#endif } -void lcd_set_cmap (bmp_image_t *bmp,unsigned colors) +void lcd_set_cmap (struct bmp_image *bmp,unsigned colors) {int i;for (i =0 ; i < colors; ++i) { -bmp_color_table_entry_t cte = bmp->color_table[i]; +struct bmp_color_table_entry cte = bmp->color_table[i];lcd_setcolreg (i, cte.red, cte.green, cte.blue); } }
drivers/video/bus_vcxk.c +2 -2
@@ -358,7 +358,7 @@ void vcxk_draw_mono(unsigned char *dataptr, unsigned long linewidth,int vcxk_display_bitmap (ulong addr,int x,int y) { -bmp_image_t *bmp; +struct bmp_image *bmp;unsigned long width;unsigned long height;unsigned long bpp;
@@ -369,7 +369,7 @@ int vcxk_display_bitmap(ulong addr, int x, int y)unsigned long c_height;unsigned char *dataptr; - bmp = (bmp_image_t *) addr; + bmp = (struct bmp_image *)addr;if ((bmp->header.signature[0 ] =='B' ) && (bmp->header.signature[1 ] =='M' )) { width =le32_to_cpu (bmp->header.width);
drivers/video/cfb_console.c +5 -5
@@ -1295,7 +1295,7 @@ static void draw_bitmap(uchar **fb, uchar *bm, struct palette *p, *fb = (uchar *) addr;/* return modified address */ } -static int display_rle8_bitmap (bmp_image_t *img,int xoff,int yoff, +static int display_rle8_bitmap (struct bmp_image *img,int xoff,int yoff,int width,int height) {unsigned char *bm;
@@ -1304,7 +1304,7 @@ static int display_rle8_bitmap(bmp_image_t *img, int xoff, int yoff,int decode =1 ;int x, y, bpp, i, ncolors;struct palette p[256 ]; -bmp_color_table_entry_t cte; +struct bmp_color_table_entry cte;int green_shift, red_off;int limit =VIDEO_COLS *VIDEO_ROWS ;int pixels =0 ;
@@ -1447,13 +1447,13 @@ int video_display_bitmap(ulong bmp_image, int x, int y) {ushort xcount, ycount;uchar *fb; -bmp_image_t *bmp = (bmp_image_t *) bmp_image; +struct bmp_image *bmp = (struct bmp_image *)bmp_image;uchar *bmap;ushort padded_line;unsigned long width, height, bpp;unsigned colors;unsigned long compression; -bmp_color_table_entry_t cte; +struct bmp_color_table_entry cte;#ifdef CONFIG_VIDEO_BMP_GZIP unsigned char *dst =NULL ;
@@ -1495,7 +1495,7 @@ int video_display_bitmap(ulong bmp_image, int x, int y)/* * Set addr to decompressed image */ - bmp = (bmp_image_t *)(dst+2 ); + bmp = (struct bmp_image *)(dst+2 );if (!((bmp->header.signature[0 ] =='B' ) && (bmp->header.signature[1 ] =='M' ))) {
include/bmp_layout.h +8 -9
@@ -11,17 +11,17 @@#ifndef _BMP_H_#define _BMP_H_ -typedef struct bmp_color_table_entry { +struct __packed bmp_color_table_entry {__u8 blue;__u8 green;__u8 red;__u8 reserved; -} __attribute__ ((packed)) bmp_color_table_entry_t; +};/* When accessing these fields, remember that they are stored in little endian format, so use linux macros, e.g. le32_to_cpu(width) */ -typedef struct bmp_header { +struct __packed bmp_header {/* Header */ char signature[2 ];__u32 file_size;
@@ -40,15 +40,14 @@ typedef struct bmp_header {__u32 colors_used;__u32 colors_important;/* ColorTable */ +}; -} __attribute__ ((packed)) bmp_header_t; - -typedef struct bmp_image { -bmp_header_t header; +struct bmp_image { +struct bmp_header header;/* We use a zero sized array just as a placeholder for variable sized array */ -bmp_color_table_entry_t color_table[0 ]; -}bmp_image_t ; +struct bmp_color_table_entry color_table[0 ]; +};/* Data in the bmp_image is aligned to this length */ #define BMP_DATA_ALIGN 4
Signature · 1 line
2.2.0.rc0.207.ga3a616c
PATCH v2 5/9 Remove typedefs from bmp_layout.h
Hi Simon,
Quoted 6 lines · Simon Glass
We try to avoid typedefs and these ones are easy enough to remove. Before changing this header in the next patch, remove the typedefs.
Signed-off-by Simon Glass <[email protected]>Suggested-by Joe Hershberger <[email protected]>---
Thanks,
-Joe
PATCH v2 5/9 Remove typedefs from bmp_layout.h
Quoted 6 lines · Joe Hershberger
Hi Simon,
Quoted 3 lines · Simon Glass
We try to avoid typedefs and these ones are easy enough to remove. Before changing this header in the next patch, remove the typedefs.
Quoted 8 lines
Quoted 3 lines
Signed-off-by Simon Glass <[email protected]>Suggested-by Joe Hershberger <[email protected]>---
Acked-by Joe Hershberger <[email protected]>Thanks,
-Joe
Applied to u-boot-dm.
PATCH v2 6/9 lcd: Support colour lookup table on 16bpp display in BMP images
In reply to Simon GlassFor 16-bit-per-pixel displays it is useful to support 8 bit-per-pixel images to reduce image size. Add support for this when drawing BMP images.
---
Changes in v2: None
common/lcd.c | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-)
common/lcd.c +20 -3
@@ -578,6 +578,8 @@ int lcd_display_bitmap(ulong bmp_image, int x, int y)unsigned long width, height, byte_width;unsigned long pwidth = panel_info.vl_col;unsigned colors, bpix, bmp_bpix; +int hdr_size; +struct bmp_color_table_entry *palette = bmp->color_table;if (!bmp || !(bmp->header.signature[0 ] =='B' && bmp->header.signature[1 ] =='M' )) {
@@ -589,6 +591,8 @@ int lcd_display_bitmap(ulong bmp_image, int x, int y) width =get_unaligned_le32 (&bmp->header.width); height =get_unaligned_le32 (&bmp->header.height); bmp_bpix =get_unaligned_le16 (&bmp->header.bit_count); + hdr_size =get_unaligned_le16 (&bmp->header.size); +debug ("hdr_size=%d, bmp_bpix=%d\n" , hdr_size, bmp_bpix); colors =1 << bmp_bpix;
@@ -613,8 +617,8 @@ int lcd_display_bitmap(ulong bmp_image, int x, int y)return 1 ; } -debug ("Display-bmp: %d x %d with %d colors\n" , - (int )width, (int )height, (int )colors); +debug ("Display-bmp: %d x %d with %d colors, display %d\n" , + (int )width, (int )height, (int )colors,1 << bpix);if (bmp_bpix ==8 )lcd_set_cmap (bmp, colors);
@@ -641,6 +645,7 @@ int lcd_display_bitmap(ulong bmp_image, int x, int y) cmap_base =configuration_get_cmap ();#ifdef CONFIG_LCD_BMP_RLE8 u32 compression =get_unaligned_le32 (&bmp->header.compression); +debug ("compressed %d %d\n" , compression,BMP_BI_RLE8 );if (compression ==BMP_BI_RLE8 ) {if (bpix !=16 ) {/* TODO implement render code for bpix != 16 */
@@ -663,7 +668,19 @@ int lcd_display_bitmap(ulong bmp_image, int x, int y)if (bpix !=16 ) {fb_put_byte (&fb, &bmap); }else { - *(uint16_t *)fb = cmap_base[*(bmap++)]; +struct bmp_color_table_entry *entry; +uint val; + +if (cmap_base) { + val = cmap_base[*bmap]; + }else { + entry = &palette[*bmap]; + val = entry->blue >>3 | + entry->green >>2 <<5 | + entry->red >>3 <<11 ; + } + *(uint16_t *)fb = val; + bmap++; fb +=sizeof (uint16_t ) /sizeof (*fb); } }
Signature · 1 line
2.2.0.rc0.207.ga3a616c
PATCH v2 6/9 lcd: Support colour lookup table on 16bpp display in BMP images
Quoted 10 lines · Simon Glass
For 16-bit-per-pixel displays it is useful to support 8 bit-per-pixel images to reduce image size. Add support for this when drawing BMP images.
Signed-off-by Simon Glass <[email protected]>---
Changes in v2: None
common/lcd.c | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-)
Applied to u-boot-dm.
PATCH v2 7/9 tegra124: Implement spl_was_boot_source()
In reply to Simon GlassAdd an implementation of this function for Tegra.
---
Changes in v2:
- Rename constant to UBOOT_NOT_LOADED_FROM_SPL
arch/arm/mach-tegra/board.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+)
arch/arm/mach-tegra/board.c +16 -0
@@ -6,6 +6,7 @@*/ #include <common.h> +#include <spl.h> #include <asm/io.h> #include <asm/arch/clock.h> #include <asm/arch/funcmux.h>
@@ -29,6 +30,21 @@ enum { UART_COUNT = 5, }; +static bool from_spl __attribute__ ((section(".data"))); + +#ifndef CONFIG_SPL_BUILD +void save_boot_params (u32 r0,u32 r1,u32 r2,u32 r3) +{ + from_spl = r0 !=UBOOT_NOT_LOADED_FROM_SPL ; +save_boot_params_ret (); +} +#endif + +bool spl_was_boot_source (void ) +{ +return from_spl; +} +#if defined(CONFIG_TEGRA_SUPPORT_NON_SECURE )#if !defined(CONFIG_TEGRA124 )#error tegra_cpu_is_non_secure has only been validated on Tegra124
Signature · 1 line
2.2.0.rc0.207.ga3a616c
PATCH v2 8/9 tegra: nyan-big: Allow TPM on I2C
In reply to Simon GlassEnable the I2C3 pins so that the TPM can be used.
Note: There is an DP change also, caused by running board-to-uboot.py script in the latest tegra-pinmux-script tree.
---
Changes in v2:
- Use tegra-pinmux-scripts to update the pinmux
board/nvidia/nyan-big/pinmux-config-nyan-big.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
board/nvidia/nyan-big/pinmux-config-nyan-big.h +4 -4
@@ -1,5 +1,5 @@/* -* Copyright (c) 2014, NVIDIA CORPORATION. All rights reserved. +* Copyright (c) 2015, NVIDIA CORPORATION. All rights reserved. * * SPDX-License-Identifier: GPL-2.0+ */
@@ -234,8 +234,8 @@ static const struct pmux_pingrp_config nyan_big_pingrps[] = {PINCFG (SDMMC4_DAT6_PAA6 ,SDMMC4 ,UP ,NORMAL ,INPUT ,DEFAULT ,DEFAULT ),PINCFG (SDMMC4_DAT7_PAA7 ,SDMMC4 ,UP ,NORMAL ,INPUT ,DEFAULT ,DEFAULT ),PINCFG (PBB0 ,VGP6 ,DOWN ,TRISTATE ,OUTPUT ,DEFAULT ,DEFAULT ), -PINCFG (CAM_I2C_SCL_PBB1 ,RSVD3 ,DOWN ,TRISTATE ,OUTPUT ,DISABLE ,DEFAULT ), -PINCFG (CAM_I2C_SDA_PBB2 ,RSVD3 ,DOWN ,TRISTATE ,OUTPUT ,DISABLE ,DEFAULT ), +PINCFG (CAM_I2C_SCL_PBB1 ,I2C3 ,NORMAL ,NORMAL ,INPUT ,ENABLE ,DEFAULT ), +PINCFG (CAM_I2C_SDA_PBB2 ,I2C3 ,NORMAL ,NORMAL ,INPUT ,ENABLE ,DEFAULT ),PINCFG (PBB3 ,VGP3 ,DOWN ,TRISTATE ,OUTPUT ,DEFAULT ,DEFAULT ),PINCFG (PBB4 ,VGP4 ,DOWN ,TRISTATE ,OUTPUT ,DEFAULT ,DEFAULT ), PINCFG(PBB5, RSVD3, DOWN, TRISTATE, OUTPUT, DEFAULT, DEFAULT),
@@ -257,7 +257,7 @@ static const struct pmux_pingrp_config nyan_big_pingrps[] = {PINCFG (HDMI_CEC_PEE3 ,CEC ,NORMAL ,NORMAL ,INPUT ,ENABLE ,DEFAULT ),PINCFG (SDMMC3_CLK_LB_OUT_PEE4 ,SDMMC3 ,NORMAL ,NORMAL ,OUTPUT ,DEFAULT ,DEFAULT ),PINCFG (SDMMC3_CLK_LB_IN_PEE5 ,SDMMC3 ,UP ,NORMAL ,INPUT ,DEFAULT ,DEFAULT ), -PINCFG (DP_HPD_PFF0 ,DP ,UP ,NORMAL ,INPUT ,DEFAULT ,DEFAULT ), +PINCFG (DP_HPD_PFF0 ,DP ,NORMAL ,NORMAL ,INPUT ,DEFAULT ,DEFAULT ),PINCFG (USB_VBUS_EN2_PFF1 ,RSVD2 ,DOWN ,TRISTATE ,OUTPUT ,DISABLE ,DEFAULT ),PINCFG (PFF2 ,RSVD2 ,DOWN ,TRISTATE ,OUTPUT ,DISABLE ,DEFAULT ), PINCFG(CORE_PWR_REQ, PWRON, NORMAL, NORMAL, OUTPUT, DEFAULT, DEFAULT),
Signature · 1 line
2.2.0.rc0.207.ga3a616c
PATCH v2 8/9 tegra: nyan-big: Allow TPM on I2C
Quoted 4 lines · Simon Glass
Enable the I2C3 pins so that the TPM can be used.
Note: There is an DP change also, caused by running
board-to-uboot.pyscript in the latest tegra-pinmux-script tree.
I didn't get the patch for tegra-pinmux-scripts. What was the send time/date and patch title?
PATCH v2 8/9 tegra: nyan-big: Allow TPM on I2C
Hi Stephen,
Quoted 10 lines · Stephen Warren
Quoted 5 lines · Simon Glass
Enable the I2C3 pins so that the TPM can be used.
Note: There is an DP change also, caused by running
board-to-uboot.pyscript in the latest tegra-pinmux-script tree.I didn't get the patch for tegra-pinmux-scripts. What was the send time/date and patch title?
It will be in the future :-) I need to transfer it via github as I don't have a proper git mirror in-house.
Regards,
Simon
PATCH v2 8/9 tegra: nyan-big: Allow TPM on I2C
Quoted 9 lines · Simon Glass
Hi Stephen,
Quoted 6 lines · Stephen Warren
Quoted 5 lines · Simon Glass
Enable the I2C3 pins so that the TPM can be used.
Note: There is an DP change also, caused by running
board-to-uboot.pyscript in the latest tegra-pinmux-script tree.
This also means that the version that got checked into U-Boot wasn't generated from the config file that first got checked into tegra-pinmux-scripts:-( Tomeu made this DP change when he submitted support to tegra-pinmux-scripts. We should make sure that boards are added to tegra-pinmux-scripts before sending U-Boot/kernel patches for a board to avoid this.
Quoted 5 lines
Quoted 2 lines
I didn't get the patch for tegra-pinmux-scripts. What was the send time/date and patch title?
It will be in the future :-) I need to transfer it via github as I don't have a proper git mirror in-house.
Ah, I should have looked at the email time; I didn't notice it'd only just arrived.
Assuming there are no objections to the tegra-pinmux-scripts patch and I apply it on Friday as I expect, then this patch looks fine too.
PATCH v2 8/9 tegra: nyan-big: Allow TPM on I2C
Hi Tom,
Quoted 31 lines · Stephen Warren
Quoted 12 lines · Simon Glass
Hi Stephen,
Quoted 8 lines · Stephen Warren
Quoted 6 lines · Simon Glass
Enable the I2C3 pins so that the TPM can be used.
Note: There is an DP change also, caused by running
board-to-uboot.pyscript in the latest tegra-pinmux-script tree.This also means that the version that got checked into U-Boot wasn't generated from the config file that first got checked into tegra-pinmux-scripts:-( Tomeu made this DP change when he submitted support to tegra-pinmux-scripts. We should make sure that boards are added to tegra-pinmux-scripts before sending U-Boot/kernel patches for a board to avoid this.
Quoted 7 lines
Quoted 3 lines
I didn't get the patch for tegra-pinmux-scripts. What was the send time/date
and patch title?It will be in the future :-) I need to transfer it via github as I don't have a proper git mirror in-house.
Quoted 7 lines
Ah, I should have looked at the email time; I didn't notice it'd only just arrived.
Assuming there are no objections to the tegra-pinmux-scripts patch and I apply it on Friday as I expect, then this patch looks fine too.
Acked-by Stephen Warren <[email protected]>
I think three patches got missed, including this one:
http://patchwork.ozlabs.org/patch/471865/
http://patchwork.ozlabs.org/patch/471871/
http://patchwork.ozlabs.org/patch/471869/
Can you please take a look?
Regards,
Simon
PATCH v2 9/9 tegra124: Expand SPL space by 8KB
In reply to Simon GlassWe are getting very close to running out of space in SPL, and with the currently Chrome OS gcc 4.9 we exceed the limit. Add a litle more space.
---
Changes in v2:
- Drop applied patches from the series
include/configs/tegra124-common.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/configs/tegra124-common.h +1 -1
@@ -30,7 +30,7 @@/*----------------------------------------------------------------------- * Physical Memory Map */ -#define CONFIG_SYS_TEXT_BASE 0x8010E000 +#define CONFIG_SYS_TEXT_BASE 0x80110000/* * Memory layout for where various images get loaded by boot scripts:
Signature · 1 line
2.2.0.rc0.207.ga3a616c