diff options
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/Kconfig | 19 | ||||
-rw-r--r-- | arch/arm/cpu/armv8/Kconfig | 2 | ||||
-rw-r--r-- | arch/arm/dts/Makefile | 2 | ||||
-rw-r--r-- | arch/arm/dts/kirkwood-db-88f6281-spi.dts | 48 | ||||
-rw-r--r-- | arch/arm/dts/kirkwood-db-88f6281.dts | 26 | ||||
-rw-r--r-- | arch/arm/dts/kirkwood-db.dtsi | 94 | ||||
-rw-r--r-- | arch/arm/mach-imx/mxs/Kconfig | 4 | ||||
-rw-r--r-- | arch/arm/mach-kirkwood/Kconfig | 4 | ||||
-rw-r--r-- | arch/powerpc/cpu/mpc85xx/Kconfig | 15 | ||||
-rw-r--r-- | arch/powerpc/cpu/mpc86xx/Kconfig | 13 | ||||
-rw-r--r-- | arch/sh/Kconfig | 43 | ||||
-rw-r--r-- | arch/sh/include/asm/cpu_sh4.h | 25 | ||||
-rw-r--r-- | arch/sh/include/asm/system.h | 23 | ||||
-rw-r--r-- | arch/sh/include/asm/unaligned-sh4a.h | 258 | ||||
-rw-r--r-- | arch/sh/include/asm/unaligned.h | 7 |
15 files changed, 2 insertions, 581 deletions
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 95557d6ed6..d51abbeaf0 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -621,11 +621,6 @@ config TARGET_FLEA3 bool "Support flea3" select CPU_ARM1136 -config TARGET_MX35PDK - bool "Support mx35pdk" - select BOARD_LATE_INIT - select CPU_ARM1136 - config ARCH_BCM283X bool "Broadcom BCM283X family" select DM @@ -1226,18 +1221,6 @@ config TARGET_LS2080A_EMU development platform that supports the QorIQ LS2080A Layerscape Architecture processor. -config TARGET_LS2080A_SIMU - bool "Support ls2080a_simu" - select ARCH_LS2080A - select ARM64 - select ARMV8_MULTIENTRY - select BOARD_LATE_INIT - help - Support for Freescale LS2080A_SIMU platform. - The LS2080A Development System (QDS) is a pre silicon - development platform that supports the QorIQ LS2080A - Layerscape Architecture processor. - config TARGET_LS1088AQDS bool "Support ls1088aqds" select ARCH_LS1088A @@ -1997,7 +1980,6 @@ source "board/cavium/thunderx/Kconfig" source "board/cirrus/edb93xx/Kconfig" source "board/eets/pdu001/Kconfig" source "board/emulation/qemu-arm/Kconfig" -source "board/freescale/ls2080a/Kconfig" source "board/freescale/ls2080aqds/Kconfig" source "board/freescale/ls2080ardb/Kconfig" source "board/freescale/ls1088a/Kconfig" @@ -2015,7 +1997,6 @@ source "board/freescale/ls1012aqds/Kconfig" source "board/freescale/ls1012ardb/Kconfig" source "board/freescale/ls1012afrdm/Kconfig" source "board/freescale/lx2160a/Kconfig" -source "board/freescale/mx35pdk/Kconfig" source "board/freescale/s32v234evb/Kconfig" source "board/grinn/chiliboard/Kconfig" source "board/hisilicon/hikey/Kconfig" diff --git a/arch/arm/cpu/armv8/Kconfig b/arch/arm/cpu/armv8/Kconfig index f2474413cc..9cd6a8d642 100644 --- a/arch/arm/cpu/armv8/Kconfig +++ b/arch/arm/cpu/armv8/Kconfig @@ -104,7 +104,7 @@ config PSCI_RESET default y select ARM_SMCCC if OF_CONTROL depends on !ARCH_EXYNOS7 && !ARCH_BCM283X && \ - !TARGET_LS2080A_SIMU && !TARGET_LS2080AQDS && \ + !TARGET_LS2080AQDS && \ !TARGET_LS2080ARDB && !TARGET_LS2080A_EMU && \ !TARGET_LS1088ARDB && !TARGET_LS1088AQDS && \ !TARGET_LS1012ARDB && !TARGET_LS1012AFRDM && \ diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile index af2842a0f8..33e483f4fb 100644 --- a/arch/arm/dts/Makefile +++ b/arch/arm/dts/Makefile @@ -39,8 +39,6 @@ dtb-$(CONFIG_ARCH_KIRKWOOD) += \ kirkwood-atl-sbx81lifxcat.dtb \ kirkwood-blackarmor-nas220.dtb \ kirkwood-d2net.dtb \ - kirkwood-db-88f6281.dtb \ - kirkwood-db-88f6281-spi.dtb \ kirkwood-dns325.dtb \ kirkwood-dockstar.dtb \ kirkwood-dreamplug.dtb \ diff --git a/arch/arm/dts/kirkwood-db-88f6281-spi.dts b/arch/arm/dts/kirkwood-db-88f6281-spi.dts deleted file mode 100644 index 50b1b0d4a5..0000000000 --- a/arch/arm/dts/kirkwood-db-88f6281-spi.dts +++ /dev/null @@ -1,48 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0 -/* - * Marvell DB-88F6281-BP Development Board Setup - * - * Saeed Bishara <saeed@marvell.com> - * Thomas Petazzoni <thomas.petazzoni@free-electrons.com> - * - */ - -/dts-v1/; - -#include "kirkwood-db-88f6281.dts" - -/ { - aliases { - spi0 = &spi0; - }; -}; - -&spi0 { - status = "okay"; - - flash@0 { - #address-cells = <1>; - #size-cells = <1>; - compatible = "st,m25p128", "jedec,spi-nor", "spi-flash"; - reg = <0>; - spi-max-frequency = <50000000>; - mode = <0>; - - partition@u-boot { - reg = <0x00000000 0x00c00000>; - label = "u-boot"; - }; - partition@u-boot-env { - reg = <0x00c00000 0x00040000>; - label = "u-boot-env"; - }; - partition@unused { - reg = <0x00100000 0x00f00000>; - label = "unused"; - }; - }; -}; - -&nand { - status = "disabled"; -}; diff --git a/arch/arm/dts/kirkwood-db-88f6281.dts b/arch/arm/dts/kirkwood-db-88f6281.dts deleted file mode 100644 index 2adb17c955..0000000000 --- a/arch/arm/dts/kirkwood-db-88f6281.dts +++ /dev/null @@ -1,26 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0 -/* - * Marvell DB-88F6281-BP Development Board Setup - * - * Saeed Bishara <saeed@marvell.com> - * Thomas Petazzoni <thomas.petazzoni@free-electrons.com> - * - */ - -/dts-v1/; - -#include "kirkwood-db.dtsi" -#include "kirkwood-6281.dtsi" - -/ { - model = "Marvell DB-88F6281-BP Development Board"; - compatible = "marvell,db-88f6281-bp", "marvell,kirkwood-88f6281", "marvell,kirkwood"; -}; - -&pciec { - status = "okay"; -}; - -&pcie0 { - status = "okay"; -}; diff --git a/arch/arm/dts/kirkwood-db.dtsi b/arch/arm/dts/kirkwood-db.dtsi deleted file mode 100644 index b81d8e8298..0000000000 --- a/arch/arm/dts/kirkwood-db.dtsi +++ /dev/null @@ -1,94 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0 -/* - * Marvell DB-{88F6281,88F6282}-BP Development Board Setup - * - * Saeed Bishara <saeed@marvell.com> - * Thomas Petazzoni <thomas.petazzoni@free-electrons.com> - * - * This file contains the definitions that are common between the 6281 - * and 6282 variants of the Marvell Kirkwood Development Board. - */ - -#include "kirkwood.dtsi" - -/ { - memory { - device_type = "memory"; - reg = <0x00000000 0x20000000>; /* 512 MB */ - }; - - chosen { - bootargs = "console=ttyS0,115200n8 earlyprintk"; - stdout-path = &uart0; - }; - - aliases { - ethernet0 = ð0; - spi0 = &spi0; - }; - - ocp@f1000000 { - pin-controller@10000 { - pmx_sdio_gpios: pmx-sdio-gpios { - marvell,pins = "mpp37", "mpp38"; - marvell,function = "gpio"; - }; - }; - - serial@12000 { - status = "okay"; - }; - - sata@80000 { - nr-ports = <2>; - status = "okay"; - }; - - ehci@50000 { - status = "okay"; - }; - - mvsdio@90000 { - pinctrl-0 = <&pmx_sdio_gpios>; - pinctrl-names = "default"; - wp-gpios = <&gpio1 5 GPIO_ACTIVE_HIGH>; - cd-gpios = <&gpio1 6 GPIO_ACTIVE_HIGH>; - status = "okay"; - }; - }; -}; - -&nand { - chip-delay = <25>; - status = "okay"; - - partition@0 { - label = "uboot"; - reg = <0x0 0x100000>; - }; - - partition@100000 { - label = "uImage"; - reg = <0x100000 0x400000>; - }; - - partition@500000 { - label = "root"; - reg = <0x500000 0x1fb00000>; - }; -}; - -&mdio { - status = "okay"; - - ethphy0: ethernet-phy@8 { - reg = <8>; - }; -}; - -ð0 { - status = "okay"; - ethernet0-port@0 { - phy-handle = <ðphy0>; - }; -}; diff --git a/arch/arm/mach-imx/mxs/Kconfig b/arch/arm/mach-imx/mxs/Kconfig index b90d7b6e41..bcd8400af9 100644 --- a/arch/arm/mach-imx/mxs/Kconfig +++ b/arch/arm/mach-imx/mxs/Kconfig @@ -44,9 +44,6 @@ choice prompt "MX28 board select" optional -config TARGET_APX4DEVKIT - bool "Support apx4devkit" - config TARGET_BG0900 bool "Support bg0900" @@ -68,7 +65,6 @@ endchoice config SYS_SOC default "mxs" -source "board/bluegiga/apx4devkit/Kconfig" source "board/freescale/mx28evk/Kconfig" source "board/liebherr/xea/Kconfig" source "board/ppcag/bg0900/Kconfig" diff --git a/arch/arm/mach-kirkwood/Kconfig b/arch/arm/mach-kirkwood/Kconfig index ae44cb665e..cb4e9f29ef 100644 --- a/arch/arm/mach-kirkwood/Kconfig +++ b/arch/arm/mach-kirkwood/Kconfig @@ -62,9 +62,6 @@ config TARGET_SBx81LIFKW config TARGET_SBx81LIFXCAT bool "Allied Telesis SBx81GP24/SBx81GT24" -config TARGET_DB_88F6281_BP - bool "Marvell DB-88F6281-BP" - endchoice config SYS_SOC @@ -89,6 +86,5 @@ source "board/Seagate/nas220/Kconfig" source "board/zyxel/nsa310s/Kconfig" source "board/alliedtelesis/SBx81LIFKW/Kconfig" source "board/alliedtelesis/SBx81LIFXCAT/Kconfig" -source "board/Marvell/db-88f6281-bp/Kconfig" endif diff --git a/arch/powerpc/cpu/mpc85xx/Kconfig b/arch/powerpc/cpu/mpc85xx/Kconfig index c1a3770671..870ab800e8 100644 --- a/arch/powerpc/cpu/mpc85xx/Kconfig +++ b/arch/powerpc/cpu/mpc85xx/Kconfig @@ -52,11 +52,6 @@ config TARGET_MPC8541CDS bool "Support MPC8541CDS" select ARCH_MPC8541 -config TARGET_MPC8544DS - bool "Support MPC8544DS" - select ARCH_MPC8544 - imply PANIC_HANG - config TARGET_MPC8548CDS bool "Support MPC8548CDS" select ARCH_MPC8548 @@ -73,14 +68,6 @@ config TARGET_MPC8569MDS bool "Support MPC8569MDS" select ARCH_MPC8569 -config TARGET_MPC8572DS - bool "Support MPC8572DS" - select ARCH_MPC8572 -# Use DDR3 controller with DDR2 DIMMs on this board - select SYS_FSL_DDRC_GEN3 - imply SCSI - imply PANIC_HANG - config TARGET_P1010RDB_PA bool "Support P1010RDB_PA" select ARCH_P1010 @@ -1443,12 +1430,10 @@ config SYS_FSL_LBC_CLK_DIV source "board/freescale/corenet_ds/Kconfig" source "board/freescale/mpc8541cds/Kconfig" -source "board/freescale/mpc8544ds/Kconfig" source "board/freescale/mpc8548cds/Kconfig" source "board/freescale/mpc8555cds/Kconfig" source "board/freescale/mpc8568mds/Kconfig" source "board/freescale/mpc8569mds/Kconfig" -source "board/freescale/mpc8572ds/Kconfig" source "board/freescale/p1010rdb/Kconfig" source "board/freescale/p1_p2_rdb_pc/Kconfig" source "board/freescale/p2041rdb/Kconfig" diff --git a/arch/powerpc/cpu/mpc86xx/Kconfig b/arch/powerpc/cpu/mpc86xx/Kconfig index 0f253051f2..7de42b5f25 100644 --- a/arch/powerpc/cpu/mpc86xx/Kconfig +++ b/arch/powerpc/cpu/mpc86xx/Kconfig @@ -13,17 +13,6 @@ config TARGET_SBC8641D select ARCH_MPC8641 select BOARD_EARLY_INIT_F -config TARGET_MPC8610HPCD - bool "Support MPC8610HPCD" - select ARCH_MPC8610 - select BOARD_EARLY_INIT_F - -config TARGET_MPC8641HPCN - bool "Support MPC8641HPCN" - select ARCH_MPC8641 - select FSL_DDR_INTERACTIVE - imply SCSI - config TARGET_XPEDITE517X bool "Support xpedite517x" select ARCH_MPC8641 @@ -62,8 +51,6 @@ config SYS_FSL_NUM_LAWS Number of local access windows. This is fixed per SoC. If not sure, do not change. -source "board/freescale/mpc8610hpcd/Kconfig" -source "board/freescale/mpc8641hpcn/Kconfig" source "board/sbc8641d/Kconfig" source "board/xes/xpedite517x/Kconfig" diff --git a/arch/sh/Kconfig b/arch/sh/Kconfig index 91002a9be0..7836869c55 100644 --- a/arch/sh/Kconfig +++ b/arch/sh/Kconfig @@ -4,51 +4,14 @@ menu "SuperH architecture" config CPU_SH4 bool -config CPU_SH4A - bool - select CPU_SH4 - -config SH_32BIT - bool "32bit mode" - depends on CPU_SH4A - default n - help - SH4A has 2 physical memory maps. This use 32bit mode. - And this is board specific. Please check your board if you - want to use this. - choice prompt "Target select" optional -config TARGET_MIGOR - bool "Migo-R" - select CPU_SH4 - config TARGET_R2DPLUS bool "Renesas R2D-PLUS" select CPU_SH4 -config TARGET_R7780MP - bool "R7780MP board" - select CPU_SH4A - -config TARGET_SH7752EVB - bool "SH7752EVB" - select CPU_SH4A - -config TARGET_SH7753EVB - bool "SH7753EVB" - select CPU_SH4 - -config TARGET_SH7757LCR - bool "SH7757LCR" - select CPU_SH4A - -config TARGET_SH7763RDP - bool "SH7763RDP" - select CPU_SH4 - endchoice config SYS_ARCH @@ -59,12 +22,6 @@ config SYS_CPU source "arch/sh/lib/Kconfig" -source "board/renesas/MigoR/Kconfig" source "board/renesas/r2dplus/Kconfig" -source "board/renesas/r7780mp/Kconfig" -source "board/renesas/sh7752evb/Kconfig" -source "board/renesas/sh7753evb/Kconfig" -source "board/renesas/sh7757lcr/Kconfig" -source "board/renesas/sh7763rdp/Kconfig" endmenu diff --git a/arch/sh/include/asm/cpu_sh4.h b/arch/sh/include/asm/cpu_sh4.h index 5fc9c962d8..ed7c243b3b 100644 --- a/arch/sh/include/asm/cpu_sh4.h +++ b/arch/sh/include/asm/cpu_sh4.h @@ -46,29 +46,4 @@ # error "Unknown SH4 variant" #endif -#if defined(CONFIG_SH_32BIT) -#define PMB_ADDR_ARRAY 0xf6100000 -#define PMB_ADDR_ENTRY 8 -#define PMB_VPN 24 - -#define PMB_DATA_ARRAY 0xf7100000 -#define PMB_DATA_ENTRY 8 -#define PMB_PPN 24 -#define PMB_UB 9 /* Buffered write */ -#define PMB_V 8 /* Valid */ -#define PMB_SZ1 7 /* Page size (upper bit) */ -#define PMB_SZ0 4 /* Page size (lower bit) */ -#define PMB_C 3 /* Cacheability */ -#define PMB_WT 0 /* Write-through */ - -#define PMB_ADDR_BASE(entry) (PMB_ADDR_ARRAY + (entry << PMB_ADDR_ENTRY)) -#define PMB_DATA_BASE(entry) (PMB_DATA_ARRAY + (entry << PMB_DATA_ENTRY)) -#define mk_pmb_addr_val(vpn) ((vpn << PMB_VPN)) -#define mk_pmb_data_val(ppn, ub, v, sz1, sz0, c, wt) \ - ((ppn << PMB_PPN) | (ub << PMB_UB) | \ - (v << PMB_V) | (sz1 << PMB_SZ1) | \ - (sz0 << PMB_SZ0) | (c << PMB_C) | \ - (wt << PMB_WT)) -#endif - #endif /* _ASM_CPU_SH4_H_ */ diff --git a/arch/sh/include/asm/system.h b/arch/sh/include/asm/system.h index 24b5ce8e30..ccc79b3c91 100644 --- a/arch/sh/include/asm/system.h +++ b/arch/sh/include/asm/system.h @@ -70,18 +70,6 @@ static inline void sched_cacheflush(void) { } -#ifdef CONFIG_CPU_SH4A -#define __icbi() \ -{ \ - unsigned long __addr; \ - __addr = 0xa8000000; \ - __asm__ __volatile__( \ - "icbi %0\n\t" \ - : /* no output */ \ - : "m" (__m(__addr))); \ -} -#endif - static inline unsigned long tas(volatile int *m) { unsigned long retval; @@ -100,25 +88,14 @@ static inline unsigned long tas(volatile int *m) * effect. On newer cores (like the sh4a and sh5) this is accomplished * with icbi. * - * Also note that on sh4a in the icbi case we can forego a synco for the - * write barrier, as it's not necessary for control registers. - * * Historically we have only done this type of barrier for the MMUCR, but * it's also necessary for the CCR, so we make it generic here instead. */ -#ifdef CONFIG_CPU_SH4A -#define mb() __asm__ __volatile__ ("synco": : :"memory") -#define rmb() mb() -#define wmb() __asm__ __volatile__ ("synco": : :"memory") -#define ctrl_barrier() __icbi() -#define read_barrier_depends() do { } while(0) -#else #define mb() __asm__ __volatile__ ("": : :"memory") #define rmb() mb() #define wmb() __asm__ __volatile__ ("": : :"memory") #define ctrl_barrier() __asm__ __volatile__ ("nop;nop;nop;nop;nop;nop;nop;nop") #define read_barrier_depends() do { } while(0) -#endif #ifdef CONFIG_SMP #define smp_mb() mb() diff --git a/arch/sh/include/asm/unaligned-sh4a.h b/arch/sh/include/asm/unaligned-sh4a.h deleted file mode 100644 index 9f4dd252c9..0000000000 --- a/arch/sh/include/asm/unaligned-sh4a.h +++ /dev/null @@ -1,258 +0,0 @@ -#ifndef __ASM_SH_UNALIGNED_SH4A_H -#define __ASM_SH_UNALIGNED_SH4A_H - -/* - * SH-4A has support for unaligned 32-bit loads, and 32-bit loads only. - * Support for 64-bit accesses are done through shifting and masking - * relative to the endianness. Unaligned stores are not supported by the - * instruction encoding, so these continue to use the packed - * struct. - * - * The same note as with the movli.l/movco.l pair applies here, as long - * as the load is gauranteed to be inlined, nothing else will hook in to - * r0 and we get the return value for free. - * - * NOTE: Due to the fact we require r0 encoding, care should be taken to - * avoid mixing these heavily with other r0 consumers, such as the atomic - * ops. Failure to adhere to this can result in the compiler running out - * of spill registers and blowing up when building at low optimization - * levels. See http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34777. - */ -#include <linux/types.h> -#include <asm/byteorder.h> - -static __always_inline u32 __get_unaligned_cpu32(const u8 *p) -{ - unsigned long unaligned; - - __asm__ __volatile__ ( - "movua.l @%1, %0\n\t" - : "=z" (unaligned) - : "r" (p) - ); - - return unaligned; -} - -struct __una_u16 { u16 x __attribute__((packed)); }; -struct __una_u32 { u32 x __attribute__((packed)); }; -struct __una_u64 { u64 x __attribute__((packed)); }; - -static inline u16 __get_unaligned_cpu16(const u8 *p) -{ -#ifdef __LITTLE_ENDIAN - return p[0] | p[1] << 8; -#else - return p[0] << 8 | p[1]; -#endif -} - -/* - * Even though movua.l supports auto-increment on the read side, it can - * only store to r0 due to instruction encoding constraints, so just let - * the compiler sort it out on its own. - */ -static inline u64 __get_unaligned_cpu64(const u8 *p) -{ -#ifdef __LITTLE_ENDIAN - return (u64)__get_unaligned_cpu32(p + 4) << 32 | - __get_unaligned_cpu32(p); -#else - return (u64)__get_unaligned_cpu32(p) << 32 | - __get_unaligned_cpu32(p + 4); -#endif -} - -static inline u16 get_unaligned_le16(const void *p) -{ - return le16_to_cpu(__get_unaligned_cpu16(p)); -} - -static inline u32 get_unaligned_le32(const void *p) -{ - return le32_to_cpu(__get_unaligned_cpu32(p)); -} - -static inline u64 get_unaligned_le64(const void *p) -{ - return le64_to_cpu(__get_unaligned_cpu64(p)); -} - -static inline u16 get_unaligned_be16(const void *p) -{ - return be16_to_cpu(__get_unaligned_cpu16(p)); -} - -static inline u32 get_unaligned_be32(const void *p) -{ - return be32_to_cpu(__get_unaligned_cpu32(p)); -} - -static inline u64 get_unaligned_be64(const void *p) -{ - return be64_to_cpu(__get_unaligned_cpu64(p)); -} - -static inline void __put_le16_noalign(u8 *p, u16 val) -{ - *p++ = val; - *p++ = val >> 8; -} - -static inline void __put_le32_noalign(u8 *p, u32 val) -{ - __put_le16_noalign(p, val); - __put_le16_noalign(p + 2, val >> 16); -} - -static inline void __put_le64_noalign(u8 *p, u64 val) -{ - __put_le32_noalign(p, val); - __put_le32_noalign(p + 4, val >> 32); -} - -static inline void __put_be16_noalign(u8 *p, u16 val) -{ - *p++ = val >> 8; - *p++ = val; -} - -static inline void __put_be32_noalign(u8 *p, u32 val) -{ - __put_be16_noalign(p, val >> 16); - __put_be16_noalign(p + 2, val); -} - -static inline void __put_be64_noalign(u8 *p, u64 val) -{ - __put_be32_noalign(p, val >> 32); - __put_be32_noalign(p + 4, val); -} - -static inline void put_unaligned_le16(u16 val, void *p) -{ -#ifdef __LITTLE_ENDIAN - ((struct __una_u16 *)p)->x = val; -#else - __put_le16_noalign(p, val); -#endif -} - -static inline void put_unaligned_le32(u32 val, void *p) -{ -#ifdef __LITTLE_ENDIAN - ((struct __una_u32 *)p)->x = val; -#else - __put_le32_noalign(p, val); -#endif -} - -static inline void put_unaligned_le64(u64 val, void *p) -{ -#ifdef __LITTLE_ENDIAN - ((struct __una_u64 *)p)->x = val; -#else - __put_le64_noalign(p, val); -#endif -} - -static inline void put_unaligned_be16(u16 val, void *p) -{ -#ifdef __BIG_ENDIAN - ((struct __una_u16 *)p)->x = val; -#else - __put_be16_noalign(p, val); -#endif -} - -static inline void put_unaligned_be32(u32 val, void *p) -{ -#ifdef __BIG_ENDIAN - ((struct __una_u32 *)p)->x = val; -#else - __put_be32_noalign(p, val); -#endif -} - -static inline void put_unaligned_be64(u64 val, void *p) -{ -#ifdef __BIG_ENDIAN - ((struct __una_u64 *)p)->x = val; -#else - __put_be64_noalign(p, val); -#endif -} - -/* - * Cause a link-time error if we try an unaligned access other than - * 1,2,4 or 8 bytes long - */ -extern void __bad_unaligned_access_size(void); - -#define __get_unaligned_le(ptr) ((__force typeof(*(ptr)))({ \ - __builtin_choose_expr(sizeof(*(ptr)) == 1, *(ptr), \ - __builtin_choose_expr(sizeof(*(ptr)) == 2, get_unaligned_le16((ptr)), \ - __builtin_choose_expr(sizeof(*(ptr)) == 4, get_unaligned_le32((ptr)), \ - __builtin_choose_expr(sizeof(*(ptr)) == 8, get_unaligned_le64((ptr)), \ - __bad_unaligned_access_size())))); \ - })) - -#define __get_unaligned_be(ptr) ((__force typeof(*(ptr)))({ \ - __builtin_choose_expr(sizeof(*(ptr)) == 1, *(ptr), \ - __builtin_choose_expr(sizeof(*(ptr)) == 2, get_unaligned_be16((ptr)), \ - __builtin_choose_expr(sizeof(*(ptr)) == 4, get_unaligned_be32((ptr)), \ - __builtin_choose_expr(sizeof(*(ptr)) == 8, get_unaligned_be64((ptr)), \ - __bad_unaligned_access_size())))); \ - })) - -#define __put_unaligned_le(val, ptr) ({ \ - void *__gu_p = (ptr); \ - switch (sizeof(*(ptr))) { \ - case 1: \ - *(u8 *)__gu_p = (__force u8)(val); \ - break; \ - case 2: \ - put_unaligned_le16((__force u16)(val), __gu_p); \ - break; \ - case 4: \ - put_unaligned_le32((__force u32)(val), __gu_p); \ - break; \ - case 8: \ - put_unaligned_le64((__force u64)(val), __gu_p); \ - break; \ - default: \ - __bad_unaligned_access_size(); \ - break; \ - } \ - (void)0; }) - -#define __put_unaligned_be(val, ptr) ({ \ - void *__gu_p = (ptr); \ - switch (sizeof(*(ptr))) { \ - case 1: \ - *(u8 *)__gu_p = (__force u8)(val); \ - break; \ - case 2: \ - put_unaligned_be16((__force u16)(val), __gu_p); \ - break; \ - case 4: \ - put_unaligned_be32((__force u32)(val), __gu_p); \ - break; \ - case 8: \ - put_unaligned_be64((__force u64)(val), __gu_p); \ - break; \ - default: \ - __bad_unaligned_access_size(); \ - break; \ - } \ - (void)0; }) - -#ifdef __LITTLE_ENDIAN -# 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 /* __ASM_SH_UNALIGNED_SH4A_H */ diff --git a/arch/sh/include/asm/unaligned.h b/arch/sh/include/asm/unaligned.h index 06096eeac5..5acf081962 100644 --- a/arch/sh/include/asm/unaligned.h +++ b/arch/sh/include/asm/unaligned.h @@ -3,11 +3,7 @@ /* Copy from linux-kernel. */ -#ifdef CONFIG_CPU_SH4A -/* SH-4A can handle unaligned loads in a relatively neutered fashion. */ -#include <asm/unaligned-sh4a.h> -#else -/* Otherwise, SH can't handle unaligned accesses. */ +/* Other than SH4A, SH can't handle unaligned accesses. */ #include <linux/compiler.h> #if defined(__BIG_ENDIAN__) #define get_unaligned __get_unaligned_be @@ -20,6 +16,5 @@ #include <linux/unaligned/le_byteshift.h> #include <linux/unaligned/be_byteshift.h> #include <linux/unaligned/generic.h> -#endif #endif /* _ASM_SH_UNALIGNED_H */ |