Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 02b08045 authored by Michal Simek's avatar Michal Simek
Browse files

microblaze: Add support for little-endian Microblaze



Microblaze little-endian toolchain exports __MICROBLAZEEL__
which is used in the kernel to identify little/big endian.

The most of the changes are in loading values from DTB which
is always big endian.

Little endian platforms are based on new AXI bus which has
impact to early uartlite initialization.

Signed-off-by: default avatarMichal Simek <monstr@monstr.eu>
parent e4f29092
Loading
Loading
Loading
Loading
+4 −0
Original line number Original line Diff line number Diff line
#ifndef _ASM_MICROBLAZE_BYTEORDER_H
#ifndef _ASM_MICROBLAZE_BYTEORDER_H
#define _ASM_MICROBLAZE_BYTEORDER_H
#define _ASM_MICROBLAZE_BYTEORDER_H


#ifdef __MICROBLAZEEL__
#include <linux/byteorder/little_endian.h>
#else
#include <linux/byteorder/big_endian.h>
#include <linux/byteorder/big_endian.h>
#endif


#endif /* _ASM_MICROBLAZE_BYTEORDER_H */
#endif /* _ASM_MICROBLAZE_BYTEORDER_H */
+7 −2
Original line number Original line Diff line number Diff line
@@ -24,8 +24,13 @@ csum_tcpudp_nofold(__be32 saddr, __be32 daddr, unsigned short len,
		"addc %0, %0, %3\n\t"
		"addc %0, %0, %3\n\t"
		"addc %0, %0, r0\n\t"
		"addc %0, %0, r0\n\t"
		: "+&d" (sum)
		: "+&d" (sum)
		: "d" (saddr), "d" (daddr), "d" (len + proto));
		: "d" (saddr), "d" (daddr),

#ifdef __MICROBLAZEEL__
	"d" ((len + proto) << 8)
#else
	"d" (len + proto)
#endif
);
	return sum;
	return sum;
}
}


+2 −1
Original line number Original line Diff line number Diff line
@@ -98,7 +98,8 @@ void set_cpuinfo_pvr_full(struct cpuinfo *ci, struct device_node *cpu);
static inline unsigned int fcpu(struct device_node *cpu, char *n)
static inline unsigned int fcpu(struct device_node *cpu, char *n)
{
{
	int *val;
	int *val;
	return (val = (int *) of_get_property(cpu, n, NULL)) ? *val : 0;
	return (val = (int *) of_get_property(cpu, n, NULL)) ?
							be32_to_cpup(val) : 0;
}
}


#endif /* _ASM_MICROBLAZE_CPUINFO_H */
#endif /* _ASM_MICROBLAZE_CPUINFO_H */
+1 −1
Original line number Original line Diff line number Diff line
@@ -71,7 +71,7 @@ typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG];


#define ELF_ET_DYN_BASE         (0x08000000)
#define ELF_ET_DYN_BASE         (0x08000000)


#ifdef __LITTLE_ENDIAN__
#ifdef __MICROBLAZEEL__
#define ELF_DATA	ELFDATA2LSB
#define ELF_DATA	ELFDATA2LSB
#else
#else
#define ELF_DATA	ELFDATA2MSB
#define ELF_DATA	ELFDATA2MSB
+9 −3
Original line number Original line Diff line number Diff line
@@ -12,12 +12,18 @@


# ifdef __KERNEL__
# ifdef __KERNEL__


# include <linux/unaligned/be_struct.h>
# include <linux/unaligned/be_byteshift.h>
# include <linux/unaligned/le_byteshift.h>
# include <linux/unaligned/le_byteshift.h>
# include <linux/unaligned/generic.h>
# include <linux/unaligned/generic.h>



#  ifdef __MICROBLAZEEL__
#   define get_unaligned	__get_unaligned_le
#   define put_unaligned	__put_unaligned_le
#  else
#   define get_unaligned	__get_unaligned_be
#   define get_unaligned	__get_unaligned_be
#   define put_unaligned	__put_unaligned_be
#   define put_unaligned	__put_unaligned_be
#  endif


# endif	/* __KERNEL__ */
# endif	/* __KERNEL__ */
#endif /* _ASM_MICROBLAZE_UNALIGNED_H */
#endif /* _ASM_MICROBLAZE_UNALIGNED_H */
Loading