Skip to contentSkip to conversation

Homogenise baud rate type to unsigned int

PATCH New Simon Glass 3 participants 17 messages Oct 13, 2012 – Oct 20, 2012

Subsystems (10)
Arm (32-bit) x86 PowerPC MIPS +6 more subsystems
lore
Share & tools
lore
#0 lore raw

cover Homogenise baud rate type to unsigned int

The global_data and bd_info structures for each board have different types for the baudrate and bi_baudrate fields. This series lines them all up to be the same.

There is some discussion on the list about using u32 instead of 'unsigned int'. These are equivalent on all current architectures, and other fields in global_data and bd_info do not use this. However I can change this if required.

Simon Glass (14):
sh: Change bi_baudrate and global data baudrate to int
avr32: Change bi_baudrate and global data baudrate to int
m68k: Change bi_baudrate and global data baudrate to int
microblaze: Change bi_baudrate and global data baudrate to int
nios2: Change bi_baudrate and global data baudrate to int
openrisc: Change bi_baudrate and global data baudrate to int
powerpc: Change bi_baudrate and global data baudrate to int
sparc: Change bi_baudrate and global data baudrate to int
arm: Change global data baudrate to int
blackfin: Change global data baudrate to int
mips: Change global data baudrate to int
nds32: Change global data baudrate to int
x86: Change global data baudrate to int
sandbox: Change global data baudrate to int

 arch/arm/include/asm/global_data.h        |    2 +-
 arch/arm/include/asm/u-boot.h             |    2 +-
 arch/avr32/include/asm/global_data.h      |    2 +-
 arch/avr32/include/asm/u-boot.h           |    2 +-
 arch/blackfin/include/asm/global_data.h   |    2 +-
 arch/blackfin/include/asm/u-boot.h        |    2 +-
 arch/blackfin/lib/board.c                 |    2 +-
 arch/m68k/include/asm/global_data.h       |    2 +-
 arch/m68k/include/asm/u-boot.h            |    2 +-
 arch/microblaze/include/asm/global_data.h |    2 +-
 arch/microblaze/include/asm/u-boot.h      |    2 +-
 arch/mips/include/asm/global_data.h       |    2 +-
 arch/mips/include/asm/u-boot.h            |    2 +-
 arch/nds32/include/asm/global_data.h      |    2 +-
 arch/nds32/include/asm/u-boot.h           |    2 +-
 arch/nios2/include/asm/global_data.h      |    2 +-
 arch/nios2/include/asm/u-boot.h           |    2 +-
 arch/openrisc/include/asm/global_data.h   |    2 +-
 arch/openrisc/include/asm/u-boot.h        |    2 +-
 arch/powerpc/include/asm/global_data.h    |    2 +-
 arch/powerpc/include/asm/u-boot.h         |    2 +-
 arch/sandbox/include/asm/global_data.h    |    2 +-
 arch/sh/include/asm/global_data.h         |    2 +-
 arch/sh/include/asm/u-boot.h              |    2 +-
 arch/sparc/include/asm/global_data.h      |    2 +-
 arch/sparc/include/asm/u-boot.h           |    2 +-
 arch/x86/include/asm/global_data.h        |    2 +-
 common/cmd_bdinfo.c                       |   26 +++++++++++++-------------
 28 files changed, 40 insertions(+), 40 deletions(-)
Signature · 1 line
1.7.7.3
#1 lore raw

PATCH 1/14 sh: Change bi_baudrate and global data baudrate to int

These don't need to be longs, so change them.

---
 arch/sh/include/asm/global_data.h |    2 +-
 arch/sh/include/asm/u-boot.h      |    2 +-
 common/cmd_bdinfo.c               |    2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
arch/sh/include/asm/global_data.h +1 -1
index 6e534ad..9a2c193 100644
@@ -31,7 +31,7 @@ typedef	struct global_data
 {
 	bd_t		*bd;
 	unsigned long	flags;
-	unsigned long	baudrate;
+	unsigned int	baudrate;
 	unsigned long	cpu_clk;	/* CPU clock in Hz! */
 	unsigned long	have_console;	/* serial_init() was called */
 #ifdef CONFIG_PRE_CONSOLE_BUFFER
arch/sh/include/asm/u-boot.h +1 -1
index 6c04daf..2c9c463 100644
@@ -33,7 +33,7 @@ typedef struct bd_info {
 	unsigned long   bi_flashoffset; /* reserved area for startup monitor */
 	unsigned long   bi_sramstart;   /* start of SRAM memory */
 	unsigned long   bi_sramsize;    /* size  of SRAM memory */
-	unsigned long   bi_baudrate;    /* Console Baudrate */
+	unsigned int    bi_baudrate;    /* Console Baudrate */
 	unsigned long	bi_boot_params; /* where this board expects params */
 } bd_t;
 
common/cmd_bdinfo.c +1 -1
index 286c8c8..698826c 100644
@@ -405,7 +405,7 @@ int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 	print_eth(0);
 	printf("ip_addr     = %s\n", getenv("ipaddr"));
 #endif
-	printf("baudrate    = %ld bps\n", (ulong)bd->bi_baudrate);
+	printf("baudrate    = %u bps\n", bd->bi_baudrate);
 	return 0;
 }
 
Signature · 1 line
1.7.7.3
#2 lore raw

PATCH 2/14 avr32: Change bi_baudrate and global data baudrate to int

In reply to Simon Glass

These don't need to be longs, so change them.

---
 arch/avr32/include/asm/global_data.h |    2 +-
 arch/avr32/include/asm/u-boot.h      |    2 +-
 common/cmd_bdinfo.c                  |    2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
arch/avr32/include/asm/global_data.h +1 -1
index 7878bb1..bf661e2 100644
@@ -33,7 +33,7 @@
 typedef	struct	global_data {
 	bd_t		*bd;
 	unsigned long	flags;
-	unsigned long	baudrate;
+	unsigned int	baudrate;
 	unsigned long	stack_end;	/* highest stack address */
 	unsigned long	have_console;	/* serial_init() was called */
 #ifdef CONFIG_PRE_CONSOLE_BUFFER
arch/avr32/include/asm/u-boot.h +1 -1
index 1d2959a..97bbbde 100644
@@ -23,7 +23,7 @@
 #define __ASM_U_BOOT_H__ 1
 
 typedef struct bd_info {
-	unsigned long		bi_baudrate;
+	unsigned int		bi_baudrate;
 	unsigned char		bi_phy_id[4];
 	unsigned long		bi_board_number;
 	void			*bi_boot_params;
common/cmd_bdinfo.c +1 -1
index 698826c..138693e 100644
@@ -344,7 +344,7 @@ int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 
 	print_eth(0);
 	printf("ip_addr     = %s\n", getenv("ipaddr"));
-	printf("baudrate    = %lu bps\n", bd->bi_baudrate);
+	printf("baudrate    = %u bps\n", bd->bi_baudrate);
 
 	return 0;
 }
Signature · 1 line
1.7.7.3
#4 lore raw

PATCH 3/14 m68k: Change bi_baudrate and global data baudrate to int

In reply to Simon Glass

These don't need to be longs, so change them.

---
 arch/m68k/include/asm/global_data.h |    2 +-
 arch/m68k/include/asm/u-boot.h      |    2 +-
 common/cmd_bdinfo.c                 |    2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
arch/m68k/include/asm/global_data.h +1 -1
index cd55b83..0cdb11c 100644
@@ -34,7 +34,7 @@
 typedef	struct	global_data {
 	bd_t		*bd;
 	unsigned long	flags;
-	unsigned long	baudrate;
+	unsigned int	baudrate;
 	unsigned long	cpu_clk;	/* CPU clock in Hz!		*/
 	unsigned long	bus_clk;
 #ifdef CONFIG_PCI
arch/m68k/include/asm/u-boot.h +1 -1
index 973c9ee..8c7c554 100644
@@ -58,7 +58,7 @@ typedef struct bd_info {
 	unsigned long bi_vcofreq;	/* vco Freq in MHz */
 	unsigned long bi_flbfreq;	/* Flexbus Freq in MHz */
 #endif
-	unsigned long bi_baudrate;	/* Console Baudrate */
+	unsigned int bi_baudrate;	/* Console Baudrate */
 } bd_t;
 
 #endif				/* __ASSEMBLY__ */
common/cmd_bdinfo.c +1 -1
index 138693e..d6f14ab 100644
@@ -277,7 +277,7 @@ int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 
 	printf("ip_addr     = %s\n", getenv("ipaddr"));
 #endif
-	printf("baudrate    = %ld bps\n", bd->bi_baudrate);
+	printf("baudrate    = %u bps\n", bd->bi_baudrate);
 
 	return 0;
 }
Signature · 1 line
1.7.7.3
#5 lore raw

PATCH 4/14 microblaze: Change bi_baudrate and global data baudrate to int

In reply to Simon Glass

These don't need to be longs, so change them.

---
 arch/microblaze/include/asm/global_data.h |    2 +-
 arch/microblaze/include/asm/u-boot.h      |    2 +-
 common/cmd_bdinfo.c                       |    2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
arch/microblaze/include/asm/global_data.h +1 -1
index de3b8db..2111c7c 100644
@@ -35,7 +35,7 @@
 typedef	struct	global_data {
 	bd_t		*bd;
 	unsigned long	flags;
-	unsigned long	baudrate;
+	unsigned int	baudrate;
 	unsigned long	have_console;	/* serial_init() was called */
 #ifdef CONFIG_PRE_CONSOLE_BUFFER
 	unsigned long	precon_buf_idx;	/* Pre-Console buffer index */
arch/microblaze/include/asm/u-boot.h +1 -1
index a0b1dbf..8d00658 100644
@@ -40,7 +40,7 @@ typedef struct bd_info {
 	unsigned long	bi_flashoffset; /* reserved area for startup monitor */
 	unsigned long	bi_sramstart;	/* start of SRAM memory */
 	unsigned long	bi_sramsize;	/* size	 of SRAM memory */
-	unsigned long	bi_baudrate;	/* Console Baudrate */
+	unsigned int	bi_baudrate;	/* Console Baudrate */
 } bd_t;
 
 /* For image.h:image_check_target_arch() */
common/cmd_bdinfo.c +1 -1
index d6f14ab..447c0a2 100644
@@ -198,7 +198,7 @@ int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 	print_eth(0);
 	printf("ip_addr     = %s\n", getenv("ipaddr"));
 #endif
-	printf("baudrate    = %ld bps\n", (ulong)bd->bi_baudrate);
+	printf("baudrate    = %u bps\n", (ulong)bd->bi_baudrate);
 	return 0;
 }
 
Signature · 1 line
1.7.7.3
#6 lore raw

PATCH 5/14 nios2: Change bi_baudrate and global data baudrate to int

In reply to Simon Glass

These don't need to be longs, so change them.

---
 arch/nios2/include/asm/global_data.h |    2 +-
 arch/nios2/include/asm/u-boot.h      |    2 +-
 common/cmd_bdinfo.c                  |    2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
arch/nios2/include/asm/global_data.h +1 -1
index 3b0d9e6..413b485 100644
@@ -26,7 +26,7 @@
 typedef	struct	global_data {
 	bd_t		*bd;
 	unsigned long	flags;
-	unsigned long	baudrate;
+	unsigned int	baudrate;
 	unsigned long	cpu_clk;	/* CPU clock in Hz!		*/
 	unsigned long	have_console;	/* serial_init() was called */
 #ifdef CONFIG_PRE_CONSOLE_BUFFER
arch/nios2/include/asm/u-boot.h +1 -1
index 315ef8b..e591237 100644
@@ -39,7 +39,7 @@ typedef struct bd_info {
 	unsigned long	bi_flashoffset; /* reserved area for startup monitor */
 	unsigned long	bi_sramstart;	/* start of SRAM memory */
 	unsigned long	bi_sramsize;	/* size	 of SRAM memory */
-	unsigned long	bi_baudrate;	/* Console Baudrate */
+	unsigned int	bi_baudrate;	/* Console Baudrate */
 } bd_t;
 
 /* For image.h:image_check_target_arch() */
common/cmd_bdinfo.c +1 -1
index 447c0a2..899a216 100644
@@ -175,7 +175,7 @@ int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 	printf("ip_addr     = %s\n", getenv("ipaddr"));
 #endif
 
-	printf("baudrate    = %ld bps\n", bd->bi_baudrate);
+	printf("baudrate    = %u bps\n", bd->bi_baudrate);
 
 	return 0;
 }
Signature · 1 line
1.7.7.3
#7 lore raw

PATCH 6/14 openrisc: Change bi_baudrate and global data baudrate to int

In reply to Simon Glass

These don't need to be longs, so change them.

---
 arch/openrisc/include/asm/global_data.h |    2 +-
 arch/openrisc/include/asm/u-boot.h      |    2 +-
 common/cmd_bdinfo.c                     |    2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
arch/openrisc/include/asm/global_data.h +1 -1
index 6a0c0cc..96f3f1c 100644
@@ -35,7 +35,7 @@
 typedef struct global_data {
 	bd_t		*bd;
 	unsigned long	flags;
-	unsigned long	baudrate;
+	unsigned int	baudrate;
 	unsigned long	cpu_clk;	/* CPU clock in Hz! */
 	unsigned long	have_console;	/* serial_init() was called */
 	phys_size_t	ram_size;	/* RAM size */
arch/openrisc/include/asm/u-boot.h +1 -1
index 76b8132..f2f31d3 100644
@@ -32,7 +32,7 @@
 #define _U_BOOT_H_
 
 typedef struct bd_info {
-	unsigned long	bi_baudrate;	/* serial console baudrate */
+	unsigned int	bi_baudrate;	/* serial console baudrate */
 	unsigned long	bi_arch_number;	/* unique id for this board */
 	unsigned long	bi_boot_params;	/* where this board expects params */
 	unsigned long	bi_memstart;	/* start of DRAM memory */
common/cmd_bdinfo.c +1 -1
index 899a216..5af60e8 100644
@@ -509,7 +509,7 @@ int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 	printf("ip_addr     = %s\n", getenv("ipaddr"));
 #endif
 
-	printf("baudrate    = %ld bps\n", bd->bi_baudrate);
+	printf("baudrate    = %u bps\n", bd->bi_baudrate);
 
 	return 0;
 }
Signature · 1 line
1.7.7.3
#8 lore raw

PATCH 7/14 powerpc: Change bi_baudrate and global data baudrate to int

In reply to Simon Glass

These don't need to be longs, so change them.

---
 arch/powerpc/include/asm/global_data.h |    2 +-
 arch/powerpc/include/asm/u-boot.h      |    2 +-
 common/cmd_bdinfo.c                    |    2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
arch/powerpc/include/asm/global_data.h +1 -1
index 5a5877f..374fc6d 100644
@@ -38,7 +38,7 @@
 typedef	struct	global_data {
 	bd_t		*bd;
 	unsigned long	flags;
-	unsigned long	baudrate;
+	unsigned int	baudrate;
 	unsigned long	cpu_clk;	/* CPU clock in Hz! */
 	unsigned long	bus_clk;
 #if defined(CONFIG_8xx)
arch/powerpc/include/asm/u-boot.h +1 -1
index b2fa2b5..7229a98 100644
@@ -81,7 +81,7 @@ typedef struct bd_info {
 	unsigned long	bi_ipbfreq;	/* IPB Bus Freq, in MHz */
 	unsigned long	bi_pcifreq;	/* PCI Bus Freq, in MHz */
 #endif
-	unsigned long	bi_baudrate;	/* Console Baudrate */
+	unsigned int	bi_baudrate;	/* Console Baudrate */
 #if defined(CONFIG_405)   || \
     defined(CONFIG_405GP) || \
     defined(CONFIG_405CR) || \
common/cmd_bdinfo.c +1 -1
index 5af60e8..6b2f914 100644
@@ -148,7 +148,7 @@ int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 	print_mhz("ethspeed",		bd->bi_ethspeed);
 #endif
 	printf("IP addr     = %s\n", getenv("ipaddr"));
-	printf("baudrate    = %6ld bps\n", bd->bi_baudrate);
+	printf("baudrate    = %6u bps\n", bd->bi_baudrate);
 	print_num("relocaddr", gd->relocaddr);
 	return 0;
 }
Signature · 1 line
1.7.7.3
#9 lore raw

PATCH 8/14 sparc: Change bi_baudrate and global data baudrate to int

In reply to Simon Glass

These don't need to be longs, so change them.

---
 arch/sparc/include/asm/global_data.h |    2 +-
 arch/sparc/include/asm/u-boot.h      |    2 +-
 common/cmd_bdinfo.c                  |    2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
arch/sparc/include/asm/global_data.h +1 -1
index 93d3cc0..aa63b35 100644
@@ -40,7 +40,7 @@
 typedef struct global_data {
 	bd_t *bd;
 	unsigned long flags;
-	unsigned long baudrate;
+	unsigned int baudrate;
 	unsigned long cpu_clk;	/* CPU clock in Hz!             */
 	unsigned long bus_clk;
 
arch/sparc/include/asm/u-boot.h +1 -1
index 8d01118..04c05d4 100644
@@ -54,7 +54,7 @@ typedef struct bd_info {
 	unsigned short bi_ethspeed;	/* Ethernet speed in Mbps */
 	unsigned long bi_intfreq;	/* Internal Freq, in MHz */
 	unsigned long bi_busfreq;	/* Bus Freq, in MHz */
-	unsigned long bi_baudrate;	/* Console Baudrate */
+	unsigned int bi_baudrate;	/* Console Baudrate */
 } bd_t;
 
 #endif				/* __ASSEMBLY__ */
common/cmd_bdinfo.c +1 -1
index 6b2f914..ca05985 100644
@@ -231,7 +231,7 @@ int do_bdinfo(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
 	print_eth(0);
 	printf("ip_addr     = %s\n", getenv("ipaddr"));
 #endif
-	printf("baudrate               = %6ld bps\n", bd->bi_baudrate);
+	printf("baudrate               = %6u bps\n", bd->bi_baudrate);
 	return 0;
 }
 
Signature · 1 line
1.7.7.3
#10 lore raw

PATCH 9/14 arm: Change global data baudrate to int

In reply to Simon Glass

This does not need to be a long, so change it.

Also adjust bi_baudrate to be unsigned.

---
 arch/arm/include/asm/global_data.h |    2 +-
 arch/arm/include/asm/u-boot.h      |    2 +-
 common/cmd_bdinfo.c                |    2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
arch/arm/include/asm/global_data.h +1 -1
index f8088fe..2b9af93 100644
@@ -34,7 +34,7 @@
 typedef	struct	global_data {
 	bd_t		*bd;
 	unsigned long	flags;
-	unsigned long	baudrate;
+	unsigned int	baudrate;
 	unsigned long	have_console;	/* serial_init() was called */
 #ifdef CONFIG_PRE_CONSOLE_BUFFER
 	unsigned long	precon_buf_idx;	/* Pre-Console buffer index */
arch/arm/include/asm/u-boot.h +1 -1
index eac3800..2ba98bc 100644
@@ -37,7 +37,7 @@
 #define _U_BOOT_H_	1
 
 typedef struct bd_info {
-    int			bi_baudrate;	/* serial console baudrate */
+	unsigned int	bi_baudrate;	/* serial console baudrate */
     ulong	        bi_arch_number;	/* unique id for this board */
     ulong	        bi_boot_params;	/* where this board expects params */
 	unsigned long	bi_arm_freq; /* arm frequency */
common/cmd_bdinfo.c +1 -1
index ca05985..7686996 100644
@@ -369,7 +369,7 @@ int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 	print_eth(0);
 	printf("ip_addr     = %s\n", getenv("ipaddr"));
 #endif
-	printf("baudrate    = %d bps\n", bd->bi_baudrate);
+	printf("baudrate    = %u bps\n", bd->bi_baudrate);
 #if !(defined(CONFIG_SYS_ICACHE_OFF) && defined(CONFIG_SYS_DCACHE_OFF))
 	print_num("TLB addr", gd->tlb_addr);
 #endif
Signature · 1 line
1.7.7.3
#11 lore raw

PATCH 10/14 blackfin: Change global data baudrate to int

In reply to Simon Glass

This doesn't need to be a long, so change it.

Also adjust bi_baudrate to be unsigned.

---
 arch/blackfin/include/asm/global_data.h |    2 +-
 arch/blackfin/include/asm/u-boot.h      |    2 +-
 arch/blackfin/lib/board.c               |    2 +-
 common/cmd_bdinfo.c                     |    2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)
arch/blackfin/include/asm/global_data.h +1 -1
index 290a9e7..d91e5a4 100644
@@ -41,7 +41,7 @@ typedef struct global_data {
 	bd_t *bd;
 	unsigned long flags;
 	unsigned long board_type;
-	unsigned long baudrate;
+	unsigned int baudrate;
 	unsigned long have_console;	/* serial_init() was called */
 #ifdef CONFIG_PRE_CONSOLE_BUFFER
 	unsigned long	precon_buf_idx;	/* Pre-Console buffer index */
arch/blackfin/include/asm/u-boot.h +1 -1
index df81183..7abd6c2 100644
@@ -29,7 +29,7 @@
 #define _U_BOOT_H_	1
 
 typedef struct bd_info {
-	int bi_baudrate;		/* serial console baudrate */
+	unsigned int bi_baudrate;	/* serial console baudrate */
 	unsigned long bi_boot_params;	/* where this board expects params */
 	unsigned long bi_memstart;	/* start of DRAM memory */
 	phys_size_t bi_memsize;		/* size  of DRAM memory in bytes */
arch/blackfin/lib/board.c +1 -1
index e47b606..9fbbea0 100644
@@ -78,7 +78,7 @@ static void display_global_data(void)
 	printf(" gd: %p\n", gd);
 	printf(" |-flags: %lx\n", gd->flags);
 	printf(" |-board_type: %lx\n", gd->board_type);
-	printf(" |-baudrate: %lu\n", gd->baudrate);
+	printf(" |-baudrate: %u\n", gd->baudrate);
 	printf(" |-have_console: %lx\n", gd->have_console);
 	printf(" |-ram_size: %lx\n", gd->ram_size);
 	printf(" |-env_addr: %lx\n", gd->env_addr);
common/cmd_bdinfo.c +1 -1
index 7686996..bc737d0 100644
@@ -304,7 +304,7 @@ int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 
 	print_eth(0);
 	printf("ip_addr     = %s\n", getenv("ipaddr"));
-	printf("baudrate    = %d bps\n", bd->bi_baudrate);
+	printf("baudrate    = %u bps\n", bd->bi_baudrate);
 
 	return 0;
 }
Signature · 1 line
1.7.7.3
#12 lore raw

PATCH 11/14 mips: Change global data baudrate to int

In reply to Simon Glass

This doesn't need to be a long, so change it.

Also adjust bi_baudrate to be unsigned.

---
 arch/mips/include/asm/global_data.h |    2 +-
 arch/mips/include/asm/u-boot.h      |    2 +-
 common/cmd_bdinfo.c                 |    2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
arch/mips/include/asm/global_data.h +1 -1
index 6e2cdc7..a735a8a 100644
@@ -48,7 +48,7 @@ typedef	struct	global_data {
 	unsigned long	tbl;
 	unsigned long	lastinc;
 #endif
-	unsigned long	baudrate;
+	unsigned int	baudrate;
 	unsigned long	have_console;	/* serial_init() was called */
 #ifdef CONFIG_PRE_CONSOLE_BUFFER
 	unsigned long	precon_buf_idx;	/* Pre-Console buffer index */
arch/mips/include/asm/u-boot.h +1 -1
index 590649a..5fa4a6a 100644
@@ -32,7 +32,7 @@
 #define _U_BOOT_H_	1
 
 typedef struct bd_info {
-	int		bi_baudrate;	/* serial console baudrate */
+	unsigned int	bi_baudrate;	/* serial console baudrate */
 	unsigned long	bi_arch_number;	/* unique id for this board */
 	unsigned long	bi_boot_params;	/* where this board expects params */
 	unsigned long	bi_memstart;	/* start of DRAM memory */
common/cmd_bdinfo.c +1 -1
index bc737d0..aca54d1 100644
@@ -324,7 +324,7 @@ int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 
 	print_eth(0);
 	printf("ip_addr     = %s\n", getenv("ipaddr"));
-	printf("baudrate    = %d bps\n", bd->bi_baudrate);
+	printf("baudrate    = %u bps\n", bd->bi_baudrate);
 
 	return 0;
 }
Signature · 1 line
1.7.7.3
#13 lore raw

PATCH 12/14 nds32: Change global data baudrate to int

In reply to Simon Glass

This doesn't need to be a long, so change it.

Also adjust bi_baudrate to be unsigned.

---
 arch/nds32/include/asm/global_data.h |    2 +-
 arch/nds32/include/asm/u-boot.h      |    2 +-
 common/cmd_bdinfo.c                  |    2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
arch/nds32/include/asm/global_data.h +1 -1
index 94bd4c2..b1feb2c 100644
@@ -44,7 +44,7 @@
 typedef	struct global_data {
 	bd_t		*bd;
 	unsigned long	flags;
-	unsigned long	baudrate;
+	unsigned int	baudrate;
 	unsigned long	have_console;	/* serial_init() was called */
 
 	unsigned long	reloc_off;	/* Relocation Offset */
arch/nds32/include/asm/u-boot.h +1 -1
index b533fea..7b8d8e4 100644
@@ -39,7 +39,7 @@
 #include <environment.h>
 
 typedef struct bd_info {
-	int		bi_baudrate;	/* serial console baudrate */
+	unsigned int	bi_baudrate;	/* serial console baudrate */
 	unsigned long	bi_arch_number;	/* unique id for this board */
 	unsigned long	bi_boot_params;	/* where this board expects params */
 	unsigned long	bi_memstart;	/* start of DRAM memory */
common/cmd_bdinfo.c +1 -1
index aca54d1..656c565 100644
@@ -487,7 +487,7 @@ int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 	print_eth(0);
 	printf("ip_addr     = %s\n", getenv("ipaddr"));
 #endif
-	printf("baudrate    = %d bps\n", bd->bi_baudrate);
+	printf("baudrate    = %u bps\n", bd->bi_baudrate);
 
 	return 0;
 }
Signature · 1 line
1.7.7.3
#14 lore raw

PATCH 13/14 x86: Change global data baudrate to int

In reply to Simon Glass

This doesn't need to be a long, so change it.

---
 arch/x86/include/asm/global_data.h |    2 +-
 common/cmd_bdinfo.c                |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
arch/x86/include/asm/global_data.h +1 -1
index 6d29c0b..bce999f 100644
@@ -38,7 +38,7 @@ typedef	struct global_data {
 	unsigned long	gd_addr;	/* Location of Global Data */
 	bd_t		*bd;
 	unsigned long	flags;
-	unsigned long	baudrate;
+	unsigned int	baudrate;
 	unsigned long	have_console;	/* serial_init() was called */
 #ifdef CONFIG_PRE_CONSOLE_BUFFER
 	unsigned long	precon_buf_idx;	/* Pre-Console buffer index */
common/cmd_bdinfo.c +1 -1
index 656c565..48cdd16 100644
@@ -439,7 +439,7 @@ int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 	printf("ip_addr     = %s\n", getenv("ipaddr"));
 	print_mhz("ethspeed",	    bd->bi_ethspeed);
 #endif
-	printf("baudrate    = %d bps\n", bd->bi_baudrate);
+	printf("baudrate    = %u bps\n", bd->bi_baudrate);
 
 	return 0;
 }
Signature · 1 line
1.7.7.3
#15 lore raw

PATCH 14/14 sandbox: Change global data baudrate to int

In reply to Simon Glass

This doesn't need to be a long, so change it.

---
 arch/sandbox/include/asm/global_data.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
arch/sandbox/include/asm/global_data.h +1 -1
index 581fd2f..78a751d 100644
@@ -36,7 +36,7 @@
 typedef	struct global_data {
 	bd_t		*bd;
 	unsigned long	flags;
-	unsigned long	baudrate;
+	unsigned int	baudrate;
 	unsigned long	have_console;	/* serial_init() was called */
 	unsigned long	env_addr;	/* Address  of Environment struct */
 	unsigned long	env_valid;	/* Checksum of Environment valid? */
Signature · 1 line
1.7.7.3
#16 lore raw

cover Homogenise baud rate type to unsigned int

In reply to Simon Glass
Quoted 47 lines · Simon Glass

The global_data and bd_info structures for each board have different types for the baudrate and bi_baudrate fields. This series lines them all up to be the same.

There is some discussion on the list about using u32 instead of 'unsigned int'. These are equivalent on all current architectures, and other fields in global_data and bd_info do not use this. However I can change this if required.

Simon Glass (14):
sh: Change bi_baudrate and global data baudrate to int
avr32: Change bi_baudrate and global data baudrate to int
m68k: Change bi_baudrate and global data baudrate to int
microblaze: Change bi_baudrate and global data baudrate to int
nios2: Change bi_baudrate and global data baudrate to int
openrisc: Change bi_baudrate and global data baudrate to int
powerpc: Change bi_baudrate and global data baudrate to int
sparc: Change bi_baudrate and global data baudrate to int
arm: Change global data baudrate to int
blackfin: Change global data baudrate to int
mips: Change global data baudrate to int
nds32: Change global data baudrate to int
x86: Change global data baudrate to int
sandbox: Change global data baudrate to int

 arch/arm/include/asm/global_data.h        |    2 +-
 arch/arm/include/asm/u-boot.h             |    2 +-
 arch/avr32/include/asm/global_data.h      |    2 +-
 arch/avr32/include/asm/u-boot.h           |    2 +-
 arch/blackfin/include/asm/global_data.h   |    2 +-
 arch/blackfin/include/asm/u-boot.h        |    2 +-
 arch/blackfin/lib/board.c                 |    2 +-
 arch/m68k/include/asm/global_data.h       |    2 +-
 arch/m68k/include/asm/u-boot.h            |    2 +-
 arch/microblaze/include/asm/global_data.h |    2 +-
 arch/microblaze/include/asm/u-boot.h      |    2 +-
 arch/mips/include/asm/global_data.h       |    2 +-
 arch/mips/include/asm/u-boot.h            |    2 +-
 arch/nds32/include/asm/global_data.h      |    2 +-
 arch/nds32/include/asm/u-boot.h           |    2 +-
 arch/nios2/include/asm/global_data.h      |    2 +-
 arch/nios2/include/asm/u-boot.h           |    2 +-
 arch/openrisc/include/asm/global_data.h   |    2 +-
 arch/openrisc/include/asm/u-boot.h        |    2 +-
 arch/powerpc/include/asm/global_data.h    |    2 +-
 arch/powerpc/include/asm/u-boot.h         |    2 +-
Quoted 8 lines
 arch/sandbox/include/asm/global_data.h    |    2 +-
 arch/sh/include/asm/global_data.h         |    2 +-
 arch/sh/include/asm/u-boot.h              |    2 +-
 arch/sparc/include/asm/global_data.h      |    2 +-
 arch/sparc/include/asm/u-boot.h           |    2 +-
 arch/x86/include/asm/global_data.h        |    2 +-
 common/cmd_bdinfo.c                       |   26 +++++++++++++-------------
 28 files changed, 40 insertions(+), 40 deletions(-)

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20121020/e5ee9282/attachment.pgp>