Skip to content

Commit

Permalink
litex_soc_ctrl: switch to exclusively 32-bit CSR alignment
Browse files Browse the repository at this point in the history
Signed-off-by: Gabriel Somlo <gsomlo@gmail.com>
  • Loading branch information
gsomlo committed Jun 1, 2020
1 parent 584f7b3 commit 2a20a88
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 17 deletions.
6 changes: 1 addition & 5 deletions drivers/soc/litex/litex_soc_ctrl.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,8 @@
#include <linux/errno.h>
#include <linux/io.h>

/* scratch register located one CPU x-len past the base address */
#ifdef CONFIG_64BIT
#define SCRATCH_REG_OFF 8
#else
/* scratch register located one "simple CSR" past the base address */
#define SCRATCH_REG_OFF 4
#endif

#define SCRATCH_REG_VALUE 0x12345678
#define SCRATCH_TEST_VALUE 0xdeadbeef
Expand Down
12 changes: 0 additions & 12 deletions include/linux/litex.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,7 @@
#error LiteX subregister size (LITEX_SUBREG_SIZE) must be 4 or 1!
#endif

#ifdef CONFIG_64BIT
#define LITEX_SUBREG_ALIGN 8
#else
#define LITEX_SUBREG_ALIGN 4
#endif

#define LITEX_SUBREG_SIZE_BIT (LITEX_SUBREG_SIZE * 8)

Expand All @@ -36,20 +32,12 @@ int litex_check_accessors(void);

static inline ulong _readu_cpu(const volatile void __iomem *addr)
{
#ifdef CONFIG_64BIT
return cpu_to_le64(readq(addr));
#else
return cpu_to_le32(readl(addr));
#endif
}

static inline void _writeu_cpu(volatile void __iomem *addr, ulong value)
{
#ifdef CONFIG_64BIT
writeq(le64_to_cpu(value), addr);
#else
writel(le32_to_cpu(value), addr);
#endif
}

/* number of LiteX subregisters needed to store a register of given reg_size */
Expand Down

0 comments on commit 2a20a88

Please sign in to comment.