[U-Boot] [PATCH] microblaze: Fix unaligned.h for endians

Based on ARM unaligned.h.
Signed-off-by: Michal Simek monstr@monstr.eu --- arch/microblaze/include/asm/unaligned.h | 18 +++++++++--------- 1 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/arch/microblaze/include/asm/unaligned.h b/arch/microblaze/include/asm/unaligned.h index 785c2e9..faf1b02 100644 --- a/arch/microblaze/include/asm/unaligned.h +++ b/arch/microblaze/include/asm/unaligned.h @@ -1,16 +1,16 @@ #ifndef _ASM_MICROBLAZE_UNALIGNED_H #define _ASM_MICROBLAZE_UNALIGNED_H
-#ifdef __KERNEL__ - -/* - * The Microblaze can do unaligned accesses itself in big endian mode. - */ -#include <linux/unaligned/access_ok.h> +#include <linux/unaligned/le_byteshift.h> +#include <linux/unaligned/be_byteshift.h> #include <linux/unaligned/generic.h>
-#define get_unaligned __get_unaligned_be -#define put_unaligned __put_unaligned_be +#ifdef __MICROBLAZEEL__ +# define get_unaligned __get_unaligned_le +# define put_unaligned __put_unaligned_le +#else +# define get_unaligned __get_unaligned_be +# define put_unaligned __put_unaligned_be +#endif
-#endif /* __KERNEL__ */ #endif /* _ASM_MICROBLAZE_UNALIGNED_H */

Undefined network functionality for systems without ethernet and disable NFS support.
Signed-off-by: Michal Simek monstr@monstr.eu --- include/configs/microblaze-generic.h | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/include/configs/microblaze-generic.h b/include/configs/microblaze-generic.h index 090ab3b..8cdd72a 100644 --- a/include/configs/microblaze-generic.h +++ b/include/configs/microblaze-generic.h @@ -60,6 +60,7 @@ /*#define CONFIG_SYS_RESET_ADDRESS CONFIG_SYS_TEXT_BASE*/
/* ethernet */ +#undef CONFIG_SYS_ENET #ifdef XILINX_EMACLITE_BASEADDR # define CONFIG_XILINX_EMACLITE 1 # define CONFIG_SYS_ENET @@ -243,6 +244,7 @@ #ifndef CONFIG_SYS_ENET # undef CONFIG_CMD_NET # undef CONFIG_NET_MULTI +# undef CONFIG_CMD_NFS #else # define CONFIG_CMD_PING # define CONFIG_CMD_DHCP

U-Boot BSP handle 0x3 offset for big endian systems. Little endian Microblaze systems don't use any offset.
Signed-off-by: Michal Simek monstr@monstr.eu --- include/configs/microblaze-generic.h | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/include/configs/microblaze-generic.h b/include/configs/microblaze-generic.h index 8cdd72a..a334110 100644 --- a/include/configs/microblaze-generic.h +++ b/include/configs/microblaze-generic.h @@ -44,7 +44,7 @@ # define CONFIG_SYS_NS16550_REG_SIZE -4 # define CONFIG_CONS_INDEX 1 # define CONFIG_SYS_NS16550_COM1 \ - (XILINX_UART16550_BASEADDR + 0x1000 + 0x3) + (XILINX_UART16550_BASEADDR + 0x1000) # define CONFIG_SYS_NS16550_CLK XILINX_UART16550_CLOCK_HZ # define CONFIG_BAUDRATE 115200

Remove compilation warning for systems without network support.
Warning log: microblaze-generic.c: In function 'board_eth_init': microblaze-generic.c:82: warning: no return statement in function returning non-void
Signed-off-by: Michal Simek monstr@monstr.eu --- .../xilinx/microblaze-generic/microblaze-generic.c | 10 ++++------ 1 files changed, 4 insertions(+), 6 deletions(-)
diff --git a/board/xilinx/microblaze-generic/microblaze-generic.c b/board/xilinx/microblaze-generic/microblaze-generic.c index 183e4dc..5c07fdb 100644 --- a/board/xilinx/microblaze-generic/microblaze-generic.c +++ b/board/xilinx/microblaze-generic/microblaze-generic.c @@ -71,12 +71,10 @@ int fsl_init2 (void) {
int board_eth_init(bd_t *bis) { - /* - * This board either has PCI NICs or uses the CPU's TSECs - * pci_eth_init() will return 0 if no NICs found, so in that case - * returning -1 will force cpu_eth_init() to be called. - */ + int ret = 0; + #ifdef CONFIG_XILINX_EMACLITE - return xilinx_emaclite_initialize(bis, XILINX_EMACLITE_BASEADDR); + ret |= xilinx_emaclite_initialize(bis, XILINX_EMACLITE_BASEADDR); #endif + return ret; }
participants (1)
-
Michal Simek