diff options
Diffstat (limited to 'arch/arm/include/asm')
-rw-r--r-- | arch/arm/include/asm/arch-am33xx/cpu.h | 39 | ||||
-rw-r--r-- | arch/arm/include/asm/arch-am33xx/hardware_am33xx.h | 1 | ||||
-rw-r--r-- | arch/arm/include/asm/atomic.h | 68 | ||||
-rw-r--r-- | arch/arm/include/asm/memory.h | 4 | ||||
-rw-r--r-- | arch/arm/include/asm/setjmp.h | 32 | ||||
-rw-r--r-- | arch/arm/include/asm/setup.h | 2 | ||||
-rw-r--r-- | arch/arm/include/asm/spl.h | 9 | ||||
-rw-r--r-- | arch/arm/include/asm/system.h | 4 | ||||
-rw-r--r-- | arch/arm/include/asm/ti-common/keystone_net.h | 4 |
9 files changed, 129 insertions, 34 deletions
diff --git a/arch/arm/include/asm/arch-am33xx/cpu.h b/arch/arm/include/asm/arch-am33xx/cpu.h index 62bca8c..dbed776 100644 --- a/arch/arm/include/asm/arch-am33xx/cpu.h +++ b/arch/arm/include/asm/arch-am33xx/cpu.h @@ -43,7 +43,8 @@ #define HS_DEVICE 0x2 #define GP_DEVICE 0x3 -/* cpu-id for AM33XX and TI81XX family */ +/* cpu-id for AM43XX AM33XX and TI81XX family */ +#define AM437X 0xB98C #define AM335X 0xB944 #define TI81XX 0xB81E #define DEVICE_ID (CTRL_BASE + 0x0600) @@ -579,6 +580,8 @@ struct pwmss_regs { }; #define ECAP_CLK_EN BIT(0) #define ECAP_CLK_STOP_REQ BIT(1) +#define EPWM_CLK_EN BIT(8) +#define EPWM_CLK_STOP_REQ BIT(9) struct pwmss_ecap_regs { unsigned int tsctr; @@ -592,6 +595,40 @@ struct pwmss_ecap_regs { unsigned short ecctl2; }; +struct pwmss_epwm_regs { + unsigned short tbctl; + unsigned short tbsts; + unsigned short tbphshr; + unsigned short tbphs; + unsigned short tbcnt; + unsigned short tbprd; + unsigned short res1; + unsigned short cmpctl; + unsigned short cmpahr; + unsigned short cmpa; + unsigned short cmpb; + unsigned short aqctla; + unsigned short aqctlb; + unsigned short aqsfrc; + unsigned short aqcsfrc; + unsigned short dbctl; + unsigned short dbred; + unsigned short dbfed; + unsigned short tzsel; + unsigned short tzctl; + unsigned short tzflg; + unsigned short tzclr; + unsigned short tzfrc; + unsigned short etsel; + unsigned short etps; + unsigned short etflg; + unsigned short etclr; + unsigned short etfrc; + unsigned short pcctl; + unsigned int res2[66]; + unsigned short hrcnfg; +}; + /* Capture Control register 2 */ #define ECTRL2_SYNCOSEL_MASK (0x03 << 6) #define ECTRL2_MDSL_ECAP BIT(9) diff --git a/arch/arm/include/asm/arch-am33xx/hardware_am33xx.h b/arch/arm/include/asm/arch-am33xx/hardware_am33xx.h index d1aed58..fa9b84f 100644 --- a/arch/arm/include/asm/arch-am33xx/hardware_am33xx.h +++ b/arch/arm/include/asm/arch-am33xx/hardware_am33xx.h @@ -67,5 +67,6 @@ /* PWMSS */ #define PWMSS0_BASE 0x48300000 #define AM33XX_ECAP0_BASE 0x48300100 +#define AM33XX_EPWM_BASE 0x48300200 #endif /* __AM33XX_HARDWARE_AM33XX_H */ diff --git a/arch/arm/include/asm/atomic.h b/arch/arm/include/asm/atomic.h index 9b79506..171f4d9 100644 --- a/arch/arm/include/asm/atomic.h +++ b/arch/arm/include/asm/atomic.h @@ -21,6 +21,11 @@ #endif typedef struct { volatile int counter; } atomic_t; +#if BITS_PER_LONG == 32 +typedef struct { volatile long long counter; } atomic64_t; +#else /* BIT_PER_LONG == 32 */ +typedef struct { volatile long counter; } atomic64_t; +#endif #define ATOMIC_INIT(i) { (i) } @@ -28,7 +33,9 @@ typedef struct { volatile int counter; } atomic_t; #include <asm/proc-armv/system.h> #define atomic_read(v) ((v)->counter) -#define atomic_set(v,i) (((v)->counter) = (i)) +#define atomic_set(v, i) (((v)->counter) = (i)) +#define atomic64_read(v) atomic_read(v) +#define atomic64_set(v, i) atomic_set(v, i) static inline void atomic_add(int i, volatile atomic_t *v) { @@ -101,6 +108,65 @@ static inline void atomic_clear_mask(unsigned long mask, unsigned long *addr) local_irq_restore(flags); } +#if BITS_PER_LONG == 32 + +static inline void atomic64_add(long long i, volatile atomic64_t *v) +{ + unsigned long flags = 0; + + local_irq_save(flags); + v->counter += i; + local_irq_restore(flags); +} + +static inline void atomic64_sub(long long i, volatile atomic64_t *v) +{ + unsigned long flags = 0; + + local_irq_save(flags); + v->counter -= i; + local_irq_restore(flags); +} + +#else /* BIT_PER_LONG == 32 */ + +static inline void atomic64_add(long i, volatile atomic64_t *v) +{ + unsigned long flags = 0; + + local_irq_save(flags); + v->counter += i; + local_irq_restore(flags); +} + +static inline void atomic64_sub(long i, volatile atomic64_t *v) +{ + unsigned long flags = 0; + + local_irq_save(flags); + v->counter -= i; + local_irq_restore(flags); +} +#endif + +static inline void atomic64_inc(volatile atomic64_t *v) +{ + unsigned long flags = 0; + + local_irq_save(flags); + v->counter += 1; + local_irq_restore(flags); +} + +static inline void atomic64_dec(volatile atomic64_t *v) +{ + unsigned long flags = 0; + + local_irq_save(flags); + v->counter -= 1; + local_irq_restore(flags); +} + /* Atomic operations are already serializing on ARM */ #define smp_mb__before_atomic_dec() barrier() #define smp_mb__after_atomic_dec() barrier() diff --git a/arch/arm/include/asm/memory.h b/arch/arm/include/asm/memory.h index 1864ab9..6b46078 100644 --- a/arch/arm/include/asm/memory.h +++ b/arch/arm/include/asm/memory.h @@ -45,7 +45,7 @@ static inline void *phys_to_virt(unsigned long x) /* * Virtual <-> DMA view memory address translations * Again, these are *only* valid on the kernel direct mapped RAM - * memory. Use of these is *depreciated*. + * memory. Use of these is *deprecated*. */ #define virt_to_bus(x) (__virt_to_bus((unsigned long)(x))) #define bus_to_virt(x) ((void *)(__bus_to_virt((unsigned long)(x)))) @@ -127,7 +127,7 @@ static inline void *phys_to_virt(unsigned long x) #endif /* - * We should really eliminate virt_to_bus() here - it's depreciated. + * We should really eliminate virt_to_bus() here - it's deprecated. */ #define page_to_bus(page) (virt_to_bus(page_address(page))) diff --git a/arch/arm/include/asm/setjmp.h b/arch/arm/include/asm/setjmp.h index f7b97ef..df9934b 100644 --- a/arch/arm/include/asm/setjmp.h +++ b/arch/arm/include/asm/setjmp.h @@ -11,29 +11,26 @@ struct jmp_buf_data { ulong target; ulong regs[5]; + int ret; }; typedef struct jmp_buf_data jmp_buf[1]; static inline int setjmp(jmp_buf jmp) { - long r = 0; + jmp->ret = 0; #ifdef CONFIG_ARM64 asm volatile( "adr x1, jmp_target\n" - "str x1, %1\n" - "stp x26, x27, %2\n" - "stp x28, x29, %3\n" + "str x1, %0\n" + "stp x26, x27, %1\n" + "stp x28, x29, %2\n" "mov x1, sp\n" - "str x1, %4\n" - "b 2f\n" + "str x1, %3\n" "jmp_target: " - "mov %0, #1\n" - "2:\n" - : "+r" (r), "=m" (jmp->target), - "=m" (jmp->regs[0]), "=m" (jmp->regs[2]), - "=m" (jmp->regs[4]) + : "=m" (jmp->target), "=m" (jmp->regs[0]), + "=m" (jmp->regs[2]), "=m" (jmp->regs[4]) : : "x0", "x1", "x2", "x3", "x4", "x5", "x6", "x7", "x8", "x9", "x10", "x11", "x12", "x13", "x14", "x15", @@ -49,26 +46,25 @@ static inline int setjmp(jmp_buf jmp) #else "adr r0, jmp_target\n" #endif - "mov r1, %1\n" + "mov r1, %0\n" "mov r2, sp\n" "stm r1!, {r0, r2, r4, r5, r6, r7}\n" - "b 2f\n" ".align 2\n" "jmp_target: \n" - "mov %0, #1\n" - "2:\n" - : "+l" (r) + : : "l" (&jmp->target) : "r0", "r1", "r2", "r3", /* "r4", "r5", "r6", "r7", */ "r8", "r9", "r10", "r11", /* sp, */ "ip", "lr", "cc", "memory"); #endif - return r; + return jmp->ret; } -static inline __noreturn void longjmp(jmp_buf jmp) +static inline __noreturn void longjmp(jmp_buf jmp, int ret) { + jmp->ret = ret; + #ifdef CONFIG_ARM64 asm volatile( "ldr x0, %0\n" diff --git a/arch/arm/include/asm/setup.h b/arch/arm/include/asm/setup.h index 78a7fac..3a4e902 100644 --- a/arch/arm/include/asm/setup.h +++ b/arch/arm/include/asm/setup.h @@ -132,7 +132,7 @@ struct tag_ramdisk { /* describes where the compressed ramdisk image lives (virtual address) */ /* * this one accidentally used virtual addresses - as such, - * its depreciated. + * it's deprecated. */ #define ATAG_INITRD 0x54410005 diff --git a/arch/arm/include/asm/spl.h b/arch/arm/include/asm/spl.h index 6f312d6..a0bda28 100644 --- a/arch/arm/include/asm/spl.h +++ b/arch/arm/include/asm/spl.h @@ -33,15 +33,6 @@ enum { }; #endif -/** - * Board specific load method for boards that have a special way of loading - * U-Boot, which does not fit with the existing SPL code. - * - * @return 0 on success, negative errno value on failure. - */ - -int spl_board_load_image(void); - /* Linker symbols. */ extern char __bss_start[], __bss_end[]; diff --git a/arch/arm/include/asm/system.h b/arch/arm/include/asm/system.h index 7b7b867..c18e1e3 100644 --- a/arch/arm/include/asm/system.h +++ b/arch/arm/include/asm/system.h @@ -223,6 +223,10 @@ void __noreturn psci_system_reset(bool smc); */ void save_boot_params_ret(void); +#ifdef CONFIG_ARMV7_LPAE +void switch_to_hypervisor_ret(void); +#endif + #define nop() __asm__ __volatile__("mov\tr0,r0\t@ nop\n\t"); #ifdef __ARM_ARCH_7A__ diff --git a/arch/arm/include/asm/ti-common/keystone_net.h b/arch/arm/include/asm/ti-common/keystone_net.h index a0d0d9b..0627728 100644 --- a/arch/arm/include/asm/ti-common/keystone_net.h +++ b/arch/arm/include/asm/ti-common/keystone_net.h @@ -51,9 +51,9 @@ /* MDIO module input frequency */ #ifdef CONFIG_SOC_K2G -#define EMAC_MDIO_BUS_FREQ (clk_get_rate(sys_clk0_3_clk)) +#define EMAC_MDIO_BUS_FREQ (ks_clk_get_rate(sys_clk0_3_clk)) #else -#define EMAC_MDIO_BUS_FREQ (clk_get_rate(pass_pll_clk)) +#define EMAC_MDIO_BUS_FREQ (ks_clk_get_rate(pass_pll_clk)) #endif /* MDIO clock output frequency */ #define EMAC_MDIO_CLOCK_FREQ 2500000 /* 2.5 MHz */ |