One code cleanup and another pci host bridge remap change, the latter requires qemu update with patch already posted to qemu list.
---
Igor V. Kovalenko (2): sparc64: replace ASI numbers with macros sparc64: fix pci host bridge offsets
arch/sparc64/openbios.c | 12 ++++----- include/arch/sparc64/io.h | 61 ++++++++++++++++++++++++++++++--------------- 2 files changed, 47 insertions(+), 26 deletions(-)
From: Igor V. Kovalenko igor.v.kovalenko@gmail.com
Signed-off-by: Igor V. Kovalenko igor.v.kovalenko@gmail.com --- include/arch/sparc64/io.h | 61 ++++++++++++++++++++++++++++++--------------- 1 files changed, 41 insertions(+), 20 deletions(-)
diff --git a/include/arch/sparc64/io.h b/include/arch/sparc64/io.h index d6280fe..28495d9 100644 --- a/include/arch/sparc64/io.h +++ b/include/arch/sparc64/io.h @@ -2,6 +2,7 @@ #define _ASM_IO_H
#include "asm/types.h" +#include "asm/asi.h"
#define NO_QEMU_PROTOS #include "arch/common/fw_cfg.h" @@ -62,24 +63,30 @@ static inline int in_8(volatile unsigned char *addr) { int ret;
- __asm__ __volatile__("lduba [%1] 0x15, %0\n\t" - :"=r"(ret):"r"(addr):"memory"); + __asm__ __volatile__("lduba [%1] %2, %0\n\t" + : "=r"(ret) + : "r"(addr), "i" (ASI_PHYS_BYPASS_EC_E) + : "memory");
return ret; }
static inline void out_8(volatile unsigned char *addr, int val) { - __asm__ __volatile__("stba %0, [%1] 0x15\n\t" - : : "r"(val), "r"(addr):"memory"); + __asm__ __volatile__("stba %0, [%1] %2\n\t" + : + : "r"(val), "r"(addr), "i" (ASI_PHYS_BYPASS_EC_E) + : "memory"); }
static inline int in_le16(volatile unsigned short *addr) { int ret;
- __asm__ __volatile__("lduha [%1] 0x15, %0\n\t" - :"=r"(ret):"r"(addr):"memory"); + __asm__ __volatile__("lduha [%1] %2, %0\n\t" + : "=r"(ret) + : "r"(addr), "i" (ASI_PHYS_BYPASS_EC_E) + : "memory");
return ret; } @@ -88,8 +95,10 @@ static inline int in_be16(volatile unsigned short *addr) { int ret;
- __asm__ __volatile__("lduha [%1] 0x1d, %0\n\t" - :"=r"(ret):"r"(addr):"memory"); + __asm__ __volatile__("lduha [%1] %2, %0\n\t" + : "=r"(ret) + : "r"(addr), "i" (ASI_PHYS_BYPASS_EC_E_L) + : "memory");
return ret; } @@ -97,22 +106,28 @@ static inline int in_be16(volatile unsigned short *addr) static inline void out_le16(volatile unsigned short *addr, int val) {
- __asm__ __volatile__("stha %0, [%1] 0x15\n\t" - : : "r"(val), "r"(addr):"memory"); + __asm__ __volatile__("stha %0, [%1] %2\n\t" + : + : "r"(val), "r"(addr), "i" (ASI_PHYS_BYPASS_EC_E) + : "memory"); }
static inline void out_be16(volatile unsigned short *addr, int val) { - __asm__ __volatile__("stha %0, [%1] 0x1d\n\t" - : : "r"(val), "r"(addr):"memory"); + __asm__ __volatile__("stha %0, [%1] %2\n\t" + : + : "r"(val), "r"(addr), "i" (ASI_PHYS_BYPASS_EC_E_L) + : "memory"); }
static inline unsigned in_le32(volatile unsigned *addr) { unsigned ret;
- __asm__ __volatile__("lduwa [%1] 0x15, %0\n\t" - :"=r"(ret):"r"(addr):"memory"); + __asm__ __volatile__("lduwa [%1] %2, %0\n\t" + : "=r"(ret) + : "r"(addr), "i" (ASI_PHYS_BYPASS_EC_E) + : "memory");
return ret; } @@ -121,21 +136,27 @@ static inline unsigned in_be32(volatile unsigned *addr) { unsigned ret;
- __asm__ __volatile__("lduwa [%1] 0x1d, %0\n\t" - :"=r"(ret):"r"(addr):"memory"); + __asm__ __volatile__("lduwa [%1] %2, %0\n\t" + : "=r"(ret) + : "r"(addr), "i" (ASI_PHYS_BYPASS_EC_E_L) + : "memory"); return ret; }
static inline void out_le32(volatile unsigned *addr, int val) { - __asm__ __volatile__("stwa %0, [%1] 0x15\n\t" - : : "r"(val), "r"(addr):"memory"); + __asm__ __volatile__("stwa %0, [%1] %2\n\t" + : + : "r"(val), "r"(addr), "i" (ASI_PHYS_BYPASS_EC_E) + : "memory"); }
static inline void out_be32(volatile unsigned *addr, int val) { - __asm__ __volatile__("stwa %0, [%1] 0x1d\n\t" - : : "r"(val), "r"(addr):"memory"); + __asm__ __volatile__("stwa %0, [%1] %2\n\t" + : + : "r"(val), "r"(addr), "i" (ASI_PHYS_BYPASS_EC_E_L) + : "memory"); }
static inline void _insw_ns(volatile uint16_t * port, void *buf, int ns)
From: Igor V. Kovalenko igor.v.kovalenko@gmail.com
Signed-off-by: Igor V. Kovalenko igor.v.kovalenko@gmail.com --- arch/sparc64/openbios.c | 12 ++++++------ 1 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/arch/sparc64/openbios.c b/arch/sparc64/openbios.c index 795d4f1..3f583f2 100644 --- a/arch/sparc64/openbios.c +++ b/arch/sparc64/openbios.c @@ -60,13 +60,13 @@ static const struct hwdef hwdefs[] = { .name = "SUNW,sabre", .vendor_id = PCI_VENDOR_ID_SUN, .device_id = PCI_DEVICE_ID_SUN_SABRE, - .cfg_addr = APB_SPECIAL_BASE + 0x1000000ULL, - .cfg_data = APB_MEM_BASE, - .cfg_base = 0x80000000ULL, - .cfg_len = 0, - .mem_base = APB_MEM_BASE + 0x400000ULL, + .cfg_addr = APB_SPECIAL_BASE + 0x1000000ULL, // PCI bus configuration space + .cfg_data = APB_MEM_BASE, // PCI bus memory space + .cfg_base = APB_SPECIAL_BASE, + .cfg_len = 0x2000000, + .mem_base = APB_MEM_BASE, .mem_len = 0x10000000, - .io_base = APB_SPECIAL_BASE + 0x2000000ULL, + .io_base = APB_SPECIAL_BASE + 0x2000000ULL, // PCI Bus I/O space .io_len = 0x10000, .irqs = { 0, 1, 2, 3 }, },