[parisc-linux-cvs] [PATCH] PDC cleanup and encapsulation
Ryan Bradetich
rbrad@beavis.ybsoft.com
Thu, 5 Apr 2001 23:08:50 -0600
Here is the pdc encapsulation and cleanup patch one last time.
- Ryan
Index: arch/parisc/kernel/Makefile
===================================================================
RCS file: /home/cvs/parisc/linux/arch/parisc/kernel/Makefile,v
retrieving revision 1.33
diff -u -p -r1.33 Makefile
--- Makefile 2001/03/24 03:09:50 1.33
+++ Makefile 2001/04/06 04:21:55
@@ -41,7 +41,7 @@ obj-$(CONFIG_IOMMU_SBA) += sba_iommu.o
obj-$(CONFIG_IOMMU_CCIO) += ccio-dma.o
obj-$(CONFIG_CHASSIS_LCD_LED) += led.o
obj-$(CONFIG_SUPERIO) += superio.o
-obj-$(CONFIG_PARISC64) += pdcpat.o binfmt_elf32.o sys_parisc32.o \
+obj-$(CONFIG_PARISC64) += binfmt_elf32.o sys_parisc32.o \
ioctl32.o signal32.o
include $(TOPDIR)/Rules.make
Index: arch/parisc/kernel/cache.c
===================================================================
RCS file: /home/cvs/parisc/linux/arch/parisc/kernel/cache.c,v
retrieving revision 1.13
diff -u -p -r1.13 cache.c
--- cache.c 2001/01/13 09:50:00 1.13
+++ cache.c 2001/04/06 04:21:55
@@ -28,7 +28,7 @@ int dcache_stride;
int icache_stride;
struct pdc_cache_info cache_info;
-#ifndef __LP64__
+#ifndef CONFIG_PA20
static struct pdc_btlb_info btlb_info;
#endif
@@ -73,7 +73,7 @@ int get_cache_info(char *buffer)
cache_info.dt_conf.tc_sh ? " - shared with ITLB":""
);
-#ifndef __LP64__
+#ifndef CONFIG_PA20
/* BTLB - Block TLB */
if (btlb_info.max_size==0) {
p += sprintf(p, "BTLB\t\t: not supported\n" );
@@ -164,7 +164,7 @@ cache_init(void)
cache_info.dc_conf.cc_line );
icache_stride = ( (1<<(cache_info.ic_conf.cc_block+3)) *
cache_info.ic_conf.cc_line );
-#ifndef __LP64__
+#ifndef CONFIG_PA20
if(pdc_btlb_info(&btlb_info)<0) {
memset(&btlb_info, 0, sizeof btlb_info);
}
Index: arch/parisc/kernel/ccio-dma.c
===================================================================
RCS file: /home/cvs/parisc/linux/arch/parisc/kernel/ccio-dma.c,v
retrieving revision 1.28
diff -u -p -r1.28 ccio-dma.c
--- ccio-dma.c 2001/03/02 10:31:49 1.28
+++ ccio-dma.c 2001/04/06 04:21:56
@@ -1249,11 +1249,9 @@ static struct {
u16 hversion;
u8 spa;
u8 type;
- u32 foo[3]; /* 16 bytes total */
-} cujo_iodc __attribute__ ((aligned (64)));
+ u32 foo[3]; /* 16 bytes total */
+} cujo_iodc;
-static unsigned long cujo_result[32] __attribute__ ((aligned (16))) = {0,0,0,0};
-
/*
** CUJO 2.0 incorrectly decodes a memory access for specific
** pages (every page at specific iotlb locations dependent
@@ -1276,6 +1274,7 @@ static unsigned long cujo_result[32] __a
static void
ccio_cujo20_hack(struct ioc *ioc)
{
+ unsigned long bytecnt;
u32 iovp = 0, io_io_low;
unsigned int idx;
unsigned long status, mask;
@@ -1286,12 +1285,12 @@ ccio_cujo20_hack(struct ioc *ioc)
if(!(CUJO_RAVEN_LOC == io_io_low || CUJO_FIREHAWK_LOC == io_io_low))
return;
- status = pdc_iodc_read(&cujo_result, (void *)CUJO_RAVEN_LOC, 0, &cujo_iodc, 16);
+ status = pdc_iodc_read(&bytecnt, (void *)CUJO_RAVEN_LOC, 0, &cujo_iodc, 16);
if(0 == status) {
if(CUJO_20_BADHVERS == cujo_iodc.hversion)
iovp = CUJO_20_BADPAGE1;
} else {
- status = pdc_iodc_read(&cujo_result, (void *)CUJO_FIREHAWK_LOC, 0, &cujo_iodc, 16);
+ status = pdc_iodc_read(&bytecnt, (void *)CUJO_FIREHAWK_LOC, 0, &cujo_iodc, 16);
if(0 == status) {
if(CUJO_20_BADHVERS == cujo_iodc.hversion)
iovp = CUJO_20_BADPAGE2;
Index: arch/parisc/kernel/drivers.c
===================================================================
RCS file: /home/cvs/parisc/linux/arch/parisc/kernel/drivers.c,v
retrieving revision 1.14
diff -u -p -r1.14 drivers.c
--- drivers.c 2001/02/27 00:35:43 1.14
+++ drivers.c 2001/04/06 04:21:56
@@ -24,10 +24,6 @@ static struct hp_device pa_devices[MAX_D
static struct pa_iodc_driver *pa_drivers = NULL;
-static unsigned long pdc_result[32] __attribute__ ((aligned (16))) = {0,0,0,0};
-static u8 iodc_data[32] __attribute__ ((aligned (64)));
-
-
static int compare_spec( struct hp_device * hp_dev,
struct pa_iodc_driver *driver)
{
@@ -153,10 +149,12 @@ int add_pa_dev_addr(struct hp_device *hp
struct hp_device *alloc_pa_dev(unsigned long hpa)
{
int i, status;
+ unsigned long bytecnt;
+ u8 iodc_data[32];
struct hp_device * d;
d = &pa_devices[num_devices];
- status = pdc_iodc_read(&pdc_result, (void *)hpa, 0, &iodc_data, 32);
+ status = pdc_iodc_read(&bytecnt, (void *)hpa, 0, &iodc_data, 32);
if (status != PDC_RET_OK) {
/* There is no device here, so we'll skip it */
return NULL;
Index: arch/parisc/kernel/firmware.c
===================================================================
RCS file: /home/cvs/parisc/linux/arch/parisc/kernel/firmware.c,v
retrieving revision 1.25
diff -u -p -r1.25 firmware.c
--- firmware.c 2001/03/22 06:46:32 1.25
+++ firmware.c 2001/04/06 04:21:56
@@ -12,7 +12,7 @@
* - the name of the pdc wrapper should match one of the macros
* used for the first two arguments
* - don't use caps for random parts of the name
- * - use ASSERT_ALIGN to ensure the aligment of the arguments is
+ * - use ASSERT_ALIGN to ensure the alignment of the arguments is
* correct
* - use __pa() to convert virtual (kernel) pointers to physical
* ones.
@@ -44,6 +44,36 @@
#include <stdarg.h>
+static spinlock_t pdc_lock = SPIN_LOCK_UNLOCKED;
+static unsigned long pdc_result[32] __attribute__ ((aligned (8)));
+static unsigned long pdc_result2[32] __attribute__ ((aligned (8)));
+
+/* on all currently-supported platforms, IODC I/O calls are always
+ * 32-bit calls, and MEM_PDC calls are always the same width as the OS.
+ * This means Cxxx boxes can't run wide kernels right now. -PB
+ *
+ * CONFIG_PDC_NARROW has been added to allow 64-bit kernels to run on
+ * systems with 32-bit MEM_PDC calls. This will allow wide kernels to
+ * run on Cxxx boxes now. -RB
+ *
+ * Note that some PAT boxes may have 64-bit IODC I/O...
+ */
+
+/* yes 'int', not 'long' -- IODC I/O is always 32-bit stuff */
+#ifdef __LP64__
+static long real64_call(unsigned long function, ...);
+#endif
+static long real32_call(unsigned long function, ...);
+
+#if defined(__LP64__) && ! defined(CONFIG_PDC_NARROW)
+#define MEM_PDC (unsigned long)(PAGE0->mem_pdc_hi) << 32 | PAGE0->mem_pdc
+# define mem_pdc_call(args...) real64_call(MEM_PDC, args)
+#else
+#define MEM_PDC (unsigned long)PAGE0->mem_pdc
+# define mem_pdc_call(args...) real32_call(MEM_PDC, args)
+#endif
+
+
#define ASSERT_ALIGN(ptr, align) \
do { if(((unsigned long)(ptr)) & (align-1)) { \
printk("PDC: %s:%d %s() called with " \
@@ -53,6 +83,13 @@
return -1; \
} } while(0)
+/**
+ * f_extend - Convert PDC addresses to kernel addresses.
+ * @address: Address returned from PDC.
+ *
+ * This function is used to convert PDC addresses into kernel addresses
+ * when the PDC address size and kernel address size are different.
+ */
static unsigned long f_extend(unsigned long address)
{
#ifdef CONFIG_PDC_NARROW
@@ -65,6 +102,14 @@ static unsigned long f_extend(unsigned l
return address;
}
+/**
+ * convert_to_wide - Convert the return buffer addresses into kernel addresses.
+ * @address: The return buffer from PDC.
+ *
+ * This fucntion is used to convert the return buffer addresses retrieved from PDC
+ * into kernel addresses when the PDC address size and kernel address size are
+ * different.
+ */
static void convert_to_wide(unsigned long *addr)
{
#ifdef CONFIG_PDC_NARROW
@@ -75,268 +120,655 @@ static void convert_to_wide(unsigned lon
#endif
}
-/* verify address can be accessed without an HPMC */
+/**
+ * pdc_add_valid - Verify address can be accessed without causing a HPMC.
+ * @address: Address to be verified.
+ *
+ * This PDC call attempts to read from the specified address and verify
+ * the address is valid.
+ */
int pdc_add_valid(void *address)
{
- ASSERT_ALIGN(address, 4);
- return mem_pdc_call(PDC_ADD_VALID, PDC_ADD_VALID_VERIFY, address);
-}
+ int retval;
-int pdc_chassis_disp(unsigned long disp)
-{
- return mem_pdc_call(PDC_CHASSIS, PDC_CHASSIS_DISP, disp);
-}
-
-int pdc_chassis_info(void *pdc_result, void *chassis_info, unsigned long len)
-{
- int retval;
+ spin_lock_irq(&pdc_lock);
+ retval = mem_pdc_call(PDC_ADD_VALID, PDC_ADD_VALID_VERIFY, address);
+ spin_unlock_irq(&pdc_lock);
- ASSERT_ALIGN(pdc_result, 4);
- ASSERT_ALIGN(chassis_info, 4);
- retval = mem_pdc_call(PDC_CHASSIS, PDC_RETURN_CHASSIS_INFO,
- __pa(pdc_result), __pa(chassis_info), len);
- convert_to_wide(pdc_result);
- return retval;
+ return retval;
}
-int pdc_hpa_processor(struct pdc_hpa *address)
+/**
+ * pdc_chassis_info - Return chassis information.
+ * @result: The return buffer.
+ * @chassis_info: The memory buffer address.
+ * @len: The size of the memory buffer address.
+ *
+ * An HVERSION dependent call for returning the chassis information.
+ */
+int pdc_chassis_info(struct pdc_chassis_info *chassis_info, void *led_info, unsigned long len)
{
- int retval;
+ int retval;
- /* We're using 0 for the last parameter just to make sure.
- It's actually HVERSION dependant. And remember, life is
- hard without a backspace. */
- ASSERT_ALIGN(address, 4);
- retval = mem_pdc_call(PDC_HPA, PDC_HPA_PROCESSOR, __pa(address), 0);
- convert_to_wide((unsigned long *)address);
- address->hpa = f_extend(address->hpa);
- return retval;
-}
-
-int pdc_coproc_cfg(void *address)
-{
- int retval;
+ spin_lock_irq(&pdc_lock);
+ retval = mem_pdc_call(PDC_CHASSIS, PDC_RETURN_CHASSIS_INFO,
+ __pa(pdc_result), __pa(pdc_result2), len);
+ memcpy(chassis_info, pdc_result, sizeof(*chassis_info));
+ memcpy(led_info, pdc_result2, sizeof(*led_info));
+ spin_unlock_irq(&pdc_lock);
- ASSERT_ALIGN(address, 4);
- retval = mem_pdc_call(PDC_COPROC, PDC_COPROC_CFG, __pa(address));
- convert_to_wide(address);
- return retval;
+ return retval;
}
+/**
+ * pdc_coproc_cfg - To identify coprocessors attached to the processor.
+ * @pdc_coproc_info: Return buffer address.
+ *
+ * This PDC call returns the presence and status of all the coprocessors
+ * attached to the processor.
+ */
+int pdc_coproc_cfg(struct pdc_coproc_cfg *pdc_coproc_info)
+{
+ int retval;
-int pdc_iodc_read(void *address, void *hpa, unsigned int index,
+ spin_lock_irq(&pdc_lock);
+ retval = mem_pdc_call(PDC_COPROC, PDC_COPROC_CFG, __pa(pdc_result));
+ convert_to_wide(pdc_result);
+ pdc_coproc_info->ccr_functional = pdc_result[0];
+ pdc_coproc_info->ccr_present = pdc_result[1];
+ pdc_coproc_info->revision = pdc_result[17];
+ pdc_coproc_info->model = pdc_result[18];
+ spin_unlock_irq(&pdc_lock);
+
+ return retval;
+}
+
+/**
+ * pdc_iodc_read - Read data from the modules IODC.
+ * @actcnt: The actual number of bytes.
+ * @hpa: The HPA of the module for the iodc read.
+ * @index: The iodc entry point.
+ * @iodc_data: A buffer memory for the iodc options.
+ * @iodc_data_size: Size of the memory buffer.
+ *
+ * This PDC call reads from the IODC of the module specified by the hpa
+ * argument.
+ */
+int pdc_iodc_read(unsigned long *actcnt, void *hpa, unsigned int index,
void *iodc_data, unsigned int iodc_data_size)
{
int retval;
- ASSERT_ALIGN(address, 4);
- ASSERT_ALIGN(hpa, 4);
- ASSERT_ALIGN(iodc_data, 4);
- retval = mem_pdc_call(PDC_IODC, PDC_IODC_READ, __pa(address), hpa,
- index, __pa(iodc_data), iodc_data_size);
- convert_to_wide(address);
+ spin_lock_irq(&pdc_lock);
+ retval = mem_pdc_call(PDC_IODC, PDC_IODC_READ, __pa(pdc_result), hpa,
+ index, __pa(pdc_result2), iodc_data_size);
+ convert_to_wide(pdc_result);
+ *actcnt = pdc_result[0];
+ memcpy(iodc_data, pdc_result2, iodc_data_size);
+ spin_unlock_irq(&pdc_lock);
+
return retval;
}
+/**
+ * pdc_system_map_find_mods - Locate unarchitected modules.
+ * @pdc_mod_info: Return buffer address.
+ * @mod_path: pointer to dev path structure.
+ * @mod_index: fixed address module index.
+ *
+ * To locate and identify modules which reside at fixed I/O addresses, which
+ * do not self-identify via architected bus walks.
+ */
int pdc_system_map_find_mods(struct pdc_system_map_mod_info *pdc_mod_info,
struct pdc_module_path *mod_path, long mod_index)
{
int retval;
+
+ spin_lock_irq(&pdc_lock);
+ retval = mem_pdc_call(PDC_SYSTEM_MAP, PDC_FIND_MODULE, __pa(pdc_result),
+ __pa(pdc_result2), mod_index);
+ convert_to_wide(pdc_result);
+ memcpy(pdc_mod_info, pdc_result, sizeof(*pdc_mod_info));
+ memcpy(mod_path, pdc_result2, sizeof(*mod_path));
+ spin_unlock_irq(&pdc_lock);
- ASSERT_ALIGN(pdc_mod_info, 8);
- ASSERT_ALIGN(mod_path, 8);
- retval = mem_pdc_call(PDC_SYSTEM_MAP, PDC_FIND_MODULE, __pa(pdc_mod_info),
- __pa(mod_path), mod_index);
- convert_to_wide((unsigned long *)pdc_mod_info);
pdc_mod_info->mod_addr = (void *)f_extend((unsigned long)pdc_mod_info->mod_addr);
return retval;
}
+/**
+ * pdc_system_map_find_addrs - Retrieve additional address ranges.
+ * @pdc_addr_info: Return buffer address.
+ * @mod_index: Fixed address module index.
+ * @addr_index: Address range index.
+ *
+ * Retrieve additional information about subsequent address ranges for modules
+ * with multiple address ranges.
+ */
int pdc_system_map_find_addrs(struct pdc_system_map_addr_info *pdc_addr_info,
long mod_index, long addr_index)
{
int retval;
- ASSERT_ALIGN(pdc_addr_info, 8);
- retval = mem_pdc_call(PDC_SYSTEM_MAP, PDC_FIND_ADDRESS, __pa(pdc_addr_info),
+ spin_lock_irq(&pdc_lock);
+ retval = mem_pdc_call(PDC_SYSTEM_MAP, PDC_FIND_ADDRESS, __pa(pdc_result),
mod_index, addr_index);
- convert_to_wide((unsigned long *)pdc_addr_info);
+ convert_to_wide(pdc_result);
+ memcpy(pdc_addr_info, pdc_result, sizeof(*pdc_addr_info));
+ spin_unlock_irq(&pdc_lock);
+
pdc_addr_info->mod_addr = (void *)f_extend((unsigned long)pdc_addr_info->mod_addr);
return retval;
}
-
+/**
+ * pdc_model_info - Return model information about the processor.
+ * @model: The return buffer.
+ *
+ * Returns the version numbers, identifiers, and capabilities from the processor module.
+ */
int pdc_model_info(struct pdc_model *model)
{
int retval;
- ASSERT_ALIGN(model, 8);
- retval = mem_pdc_call(PDC_MODEL, PDC_MODEL_INFO, __pa(model), 0);
- convert_to_wide((unsigned long *)model);
+ spin_lock_irq(&pdc_lock);
+ retval = mem_pdc_call(PDC_MODEL, PDC_MODEL_INFO, __pa(pdc_result), 0);
+ convert_to_wide(pdc_result);
+ memcpy(model, pdc_result, sizeof(*model));
+ spin_unlock_irq(&pdc_lock);
+
return retval;
}
-/* get system model name from PDC ROM (e.g. 9000/715 or 9000/778/B160L) */
+/**
+ * pdc_model_sysmodel - Get the system model name.
+ * @name: A char array of at least 81 characters.
+ *
+ * Get system model name from PDC ROM (e.g. 9000/715 or 9000/778/B160L)
+ */
int pdc_model_sysmodel(char *name)
{
- int retval;
- struct pdc_model_sysmodel sys_model;
-
- ASSERT_ALIGN(name, 4);
- sys_model.mod_len = 0;
- retval = mem_pdc_call(PDC_MODEL, PDC_MODEL_SYSMODEL, __pa(&sys_model),
- OS_ID_HPUX,__pa(name));
- convert_to_wide((unsigned long *)&sys_model);
-
- if (retval == PDC_RET_OK) {
- name[sys_model.mod_len] = '\0'; /* add trailing '\0' */
- } else {
- name[0] = 0;
- }
- return retval;
+ int retval;
+
+ spin_lock_irq(&pdc_lock);
+ retval = mem_pdc_call(PDC_MODEL, PDC_MODEL_SYSMODEL, __pa(pdc_result),
+ OS_ID_HPUX, __pa(name));
+ convert_to_wide(pdc_result);
+
+ if (retval == PDC_RET_OK) {
+ name[pdc_result[0]] = '\0'; /* add trailing '\0' */
+ } else {
+ name[0] = 0;
+ }
+ spin_unlock_irq(&pdc_lock);
+
+ return retval;
+}
+
+/**
+ * pdc_model_versions - Identify the version number of each processor.
+ * @cpu_id: The return buffer.
+ * @id: The id of the processor to check.
+ *
+ * Returns the version number for each processor component.
+ *
+ * This comment was here before, but I do not know what it means :( -RB
+ * id: 0 = cpu revision, 1 = boot-rom-version
+ */
+int pdc_model_versions(unsigned long *versions, int id)
+{
+ int retval;
+
+ spin_lock_irq(&pdc_lock);
+ retval = mem_pdc_call(PDC_MODEL, PDC_MODEL_VERSIONS, __pa(pdc_result), id);
+ convert_to_wide(pdc_result);
+ *versions = pdc_result[0];
+ spin_unlock_irq(&pdc_lock);
+
+ return retval;
}
-/* id: 0 = cpu revision, 1 = boot-rom-version */
-int pdc_model_versions(struct pdc_model_cpuid *cpu_id, int id)
+/**
+ * pdc_model_cpuid - Returns the CPU_ID.
+ * @cpu_id: The return buffer.
+ *
+ * Returns the CPU_ID value which uniquely identifies the cpu portion of
+ * the processor module.
+ */
+int pdc_model_cpuid(unsigned long *cpu_id)
{
- int retval;
-
- ASSERT_ALIGN(cpu_id, 8);
- retval = mem_pdc_call(PDC_MODEL, PDC_MODEL_VERSIONS, __pa(cpu_id), id);
- convert_to_wide((unsigned long *)cpu_id);
- return retval;
+ int retval;
+
+ spin_lock_irq(&pdc_lock);
+ pdc_result[0] = 0; /* preset zero (call may not be implemented!) */
+ retval = mem_pdc_call(PDC_MODEL, PDC_MODEL_CPU_ID, __pa(pdc_result), 0);
+ convert_to_wide(pdc_result);
+ *cpu_id = pdc_result[0];
+ spin_unlock_irq(&pdc_lock);
+
+ return retval;
}
-int pdc_model_cpuid(struct pdc_model_cpuid *cpu_id)
+/**
+ * pdc_cache_info - Return cache and TLB information.
+ * @cache_info: The return buffer.
+ *
+ * Returns information about the processor's cache and TLB.
+ */
+int pdc_cache_info(struct pdc_cache_info *cache_info)
{
- int retval;
+ int retval;
- ASSERT_ALIGN(cpu_id, 8);
- cpu_id->cpuid = 0; /* preset zero (call maybe not implemented!) */
- retval = mem_pdc_call(PDC_MODEL, PDC_MODEL_CPU_ID, __pa(cpu_id), 0);
- convert_to_wide((unsigned long *)cpu_id);
- return retval;
+ spin_lock_irq(&pdc_lock);
+ retval = mem_pdc_call(PDC_CACHE, PDC_CACHE_INFO, __pa(pdc_result), 0);
+ convert_to_wide(pdc_result);
+ memcpy(cache_info, pdc_result, sizeof(*cache_info));
+ spin_unlock_irq(&pdc_lock);
+
+ return retval;
}
-int pdc_cache_info(struct pdc_cache_info *cache_info)
+#ifndef CONFIG_PA20
+/**
+ * pdc_btlb_info - Return block TLB information.
+ * @btlb: The return buffer.
+ *
+ * Returns information about the hardware Block TLB.
+ */
+int pdc_btlb_info(struct pdc_btlb_info *btlb)
{
- int retval;
-
- ASSERT_ALIGN(cache_info, 8);
- retval = mem_pdc_call(PDC_CACHE, PDC_CACHE_INFO, __pa(cache_info), 0);
- convert_to_wide((unsigned long *)cache_info);
- return retval;
+ int retval;
+
+ spin_lock_irq(&pdc_lock);
+ retval = mem_pdc_call(PDC_BLOCK_TLB, PDC_BTLB_INFO, __pa(pdc_result), 0);
+ memcpy(btlb, pdc_result, sizeof(*btlb));
+ spin_unlock_irq(&pdc_lock);
+
+ if(retval < 0) {
+ btlb->max_size = 0;
+ }
+ return retval;
}
+#endif
#ifndef __LP64__
-int pdc_btlb_info(struct pdc_btlb_info *btlb)
+/**
+ * pdc_mem_map_hpa - Find fixed module information.
+ * @address: The return buffer
+ * @mod_path: pointer to dev path structure.
+ *
+ * This call was developed for S700 workstations to allow the kernel to find
+ * the I/O devices (Core I/O). In the future (Kittyhawk and beyond) this
+ * call will be replaced (on workstations) by the architected PDC_SYSTEM_MAP
+ * call.
+ *
+ * This call is supported by all existing S700 workstations (up to Gecko).
+ */
+int pdc_mem_map_hpa(struct pdc_memory_map *address, struct pdc_module_path *mod_path)
+{
+ int retval;
+
+ spin_lock_irq(&pdc_lock);
+ memcpy(pdc_result2, mod_path, sizeof(*mod_path));
+ retval = mem_pdc_call(PDC_MEM_MAP, PDC_MEM_MAP_HPA, __pa(pdc_result), __pa(pdc_result2));
+ memcpy(address, pdc_result, sizeof(*address));
+ spin_unlock_irq(&pdc_lock);
+
+ return retval;
+}
+#endif
+
+/**
+ * pdc_lan_station_id - Get the LAN address.
+ * @lan_addr: The return buffer.
+ * @net_hpa: The network device HPA.
+ *
+ * Get the LAN station address when it is not directly available from the LAN hardware.
+ */
+int pdc_lan_station_id(char *lan_addr, void *net_hpa)
{
+ int retval;
+ unsigned int ret[2];
+
+ spin_lock_irq(&pdc_lock);
+ retval = mem_pdc_call(PDC_LAN_STATION_ID, PDC_LAN_STATION_ID_READ,
+ __pa(pdc_result), net_hpa);
+ if(retval < 0) {
+ /* FIXME: else read MAC from NVRAM */
+ memset(lan_addr, 0, PDC_LAN_STATION_ID_SIZE);
+ } else {
+ ret[0] = (unsigned int)pdc_result[0];
+ ret[1] = (unsigned int)pdc_result[1];
+ memcpy(lan_addr, ret, PDC_LAN_STATION_ID_SIZE);
+ }
+ spin_unlock_irq(&pdc_lock);
+
+ return retval;
+}
+
+/**
+ * pdc_pci_irt_size - Get the number of entries in the interrupt routing table.
+ * @num_entries: The return value.
+ * @hpa: The HPA for the device.
+ *
+ * This PDC function returns the number of entries in the specified cell's
+ * interrupt table.
+ * Similar to PDC_PAT stuff - but added for Forte/Allegro boxes
+ */
+int pdc_pci_irt_size(unsigned long *num_entries, void *hpa)
+{
int retval;
- ASSERT_ALIGN(btlb, 8);
- retval = mem_pdc_call(PDC_BLOCK_TLB, PDC_BTLB_INFO, __pa(btlb), 0);
- convert_to_wide((unsigned long *)btlb);
+ spin_lock_irq(&pdc_lock);
+ retval = mem_pdc_call(PDC_PCI_INDEX, PDC_PCI_GET_INT_TBL_SIZE,
+ __pa(pdc_result), hpa);
+ convert_to_wide(pdc_result);
+ *num_entries = pdc_result[0];
+ spin_unlock_irq(&pdc_lock);
- if(retval < 0) {
- btlb->max_size = 0;
- }
return retval;
}
-int pdc_mem_map_hpa(struct pdc_memory_map *r_addr, struct pdc_module_path *mod_path)
+/**
+ * pdc_pci_irt - Get the PCI interrupt routing table.
+ * @num_entries: The number of entries in the table.
+ * @hpa: The Hard Physical Address of the device.
+ * @tbl:
+ *
+ * Get the PCI interrupt routing table for the device at the given HPA.
+ * Similar to PDC_PAT stuff - but added for Forte/Allegro boxes
+ */
+int pdc_pci_irt(unsigned long num_entries, void *hpa, void *tbl)
{
int retval;
+
+ spin_lock_irq(&pdc_lock);
+ pdc_result[0] = num_entries;
+ retval = mem_pdc_call(PDC_PCI_INDEX, PDC_PCI_GET_INT_TBL,
+ __pa(pdc_result), hpa, __pa(tbl));
+ spin_unlock_irq(&pdc_lock);
- ASSERT_ALIGN(r_addr, 8);
- ASSERT_ALIGN(mod_path, 8);
- retval = mem_pdc_call(PDC_MEM_MAP, PDC_MEM_MAP_HPA, __pa(r_addr), __pa(mod_path));
- convert_to_wide((unsigned long *)r_addr);
return retval;
}
+
+/**
+ * pdc_tod_read - Read the Time-Of-Day clock.
+ * @tod: The return buffer:
+ *
+ * Read the Time-Of-Day clock
+ */
+int pdc_tod_read(struct pdc_tod *tod)
+{
+ int retval;
+
+ spin_lock_irq(&pdc_lock);
+ retval = mem_pdc_call(PDC_TOD, PDC_TOD_READ, __pa(pdc_result), 0);
+ convert_to_wide(pdc_result);
+ memcpy(tod, pdc_result, sizeof(*tod));
+ spin_unlock_irq(&pdc_lock);
+
+ return retval;
+}
+
+/**
+ * pdc_tod_set - Set the Time-Of-Day clock.
+ * @sec: The number of seconds since epoch.
+ * @usec: The number of micro seconds.
+ *
+ * Set the Time-Of-Day clock.
+ */
+int pdc_tod_set(unsigned long sec, unsigned long usec)
+{
+ int retval;
+
+ spin_lock_irq(&pdc_lock);
+ retval = mem_pdc_call(PDC_TOD, PDC_TOD_WRITE, sec, usec);
+ spin_unlock_irq(&pdc_lock);
+
+ return retval;
+}
-int pdc_lan_station_id(char *lan_addr, void *net_hpa)
+#ifdef __LP64__
+int pdc_mem_mem_table(struct pdc_memory_table_raddr *r_addr, struct pdc_memory_table *tbl,
+ unsigned long entries)
{
int retval;
- unsigned char *addr;
- struct pdc_lan_station_id id;
-
- ASSERT_ALIGN(lan_addr, 4);
- ASSERT_ALIGN(net_hpa, 4);
- retval = mem_pdc_call(PDC_LAN_STATION_ID, PDC_LAN_STATION_ID_READ, __pa(&id), net_hpa);
- convert_to_wide((unsigned long *)&id);
-
- if(retval < 0) {
- addr = 0; /* FIXME: else read MAC from NVRAM */
- } else {
- addr = id.addr;
- }
- if(addr) {
- memmove(lan_addr, addr, PDC_LAN_STATION_ID_SIZE);
- } else {
- memset(lan_addr, 0, PDC_LAN_STATION_ID_SIZE);
- }
- return (addr != 0);
+ spin_lock_irq(&pdc_lock);
+ retval = mem_pdc_call(PDC_MEM, PDC_MEM_TABLE, __pa(pdc_result), __pa(pdc_result2), entries);
+ convert_to_wide(pdc_result);
+ memcpy(r_addr, pdc_result, sizeof(*r_addr));
+ memcpy(tbl, pdc_result2, entries * sizeof(*tbl));
+ spin_unlock_irq(&pdc_lock);
+
+ return retval;
}
#endif
+/* FIXME: Is this pdc used? I could not find type reference to ftc_bitmap
+ * so I guessed at unsigned long. Someone who knows what this does, can fix
+ * it later. :)
+ */
+int pdc_do_firm_test_reset(unsigned long ftc_bitmap)
+{
+ int retval;
+
+ spin_lock_irq(&pdc_lock);
+ retval = mem_pdc_call(PDC_BROADCAST_RESET, PDC_DO_FIRM_TEST_RESET,
+ PDC_FIRM_TEST_MAGIC, ftc_bitmap);
+ spin_unlock_irq(&pdc_lock);
+
+ return retval;
+}
+
+/*
+ * pdc_do_reset - Reset the system.
+ *
+ * Reset the system.
+ */
+int pdc_do_reset()
+{
+ int retval;
+
+ spin_lock_irq(&pdc_lock);
+ retval = mem_pdc_call(PDC_BROADCAST_RESET, PDC_DO_RESET);
+ spin_unlock_irq(&pdc_lock);
-/* Similar to PDC_PAT stuff in pdcpat.c - but added for Forte/Allegro boxes */
-int pdc_pci_irt_size(void *r_addr, void *hpa)
+ return retval;
+}
+
+/**
+ * iodc_iodc_putc - Console character print using IODC.
+ * @c: the character to output.
+ *
+ * Note that only these special chars are architected for console IODC io:
+ * BEL, BS, CR, and LF. Others are passed through.
+ * Since the HP console requires CR+LF to perform a 'newline', we translate
+ * "\n" to "\r\n".
+ */
+void pdc_iodc_putc(unsigned char c)
+{
+ /* XXX Should we spinlock posx usage */
+ static int posx; /* for simple TAB-Simulation... */
+ static int __attribute__((aligned(8))) iodc_retbuf[32];
+ static char __attribute__((aligned(64))) iodc_dbuf[4096];
+ unsigned int n;
+
+ switch (c) {
+ case '\n':
+ iodc_dbuf[0] = '\r';
+ iodc_dbuf[1] = '\n';
+ n = 2;
+ posx = 0;
+ break;
+ case '\t':
+ pdc_iodc_putc(' ');
+ while (posx & 7) /* expand TAB */
+ pdc_iodc_putc(' ');
+ return; /* return since IODC can't handle this */
+ case '\b':
+ posx-=2; /* BS */
+ default:
+ iodc_dbuf[0] = c;
+ n = 1;
+ posx++;
+ break;
+ }
+
+ spin_lock_irq(&pdc_lock);
+ real32_call(PAGE0->mem_cons.iodc_io,
+ (unsigned long)PAGE0->mem_cons.hpa, ENTRY_IO_COUT,
+ PAGE0->mem_cons.spa, __pa(PAGE0->mem_cons.dp.layers),
+ __pa(iodc_retbuf), 0, __pa(iodc_dbuf), n, 0);
+ spin_unlock_irq(&pdc_lock);
+}
+
+int pdc_sti_call(unsigned long func, unsigned long flags,
+ unsigned long inptr, unsigned long outputr,
+ unsigned long glob_cfg)
+{
+ int retval;
+
+ spin_lock_irq(&pdc_lock);
+ retval = real32_call(func, flags, inptr, outputr, glob_cfg);
+ spin_unlock_irq(&pdc_lock);
+
+ return retval;
+}
+
+#ifdef __LP64__
+/**
+ * pdc_pat_cell_get_number - Returns the cell number.
+ * @cell_info: The return buffer.
+ *
+ * This PDC call returns the cell number of the cell from which the call
+ * is made.
+ */
+int pdc_pat_cell_get_number(struct pdc_pat_cell_num *cell_info)
{
int retval;
+
+ spin_lock_irq(&pdc_lock);
+ retval = mem_pdc_call(PDC_PAT_CELL, PDC_PAT_CELL_GET_NUMBER, __pa(pdc_result));
+ memcpy(cell_info, pdc_result, sizeof(*cell_info));
+ spin_unlock_irq(&pdc_lock);
- ASSERT_ALIGN(r_addr, 4);
- ASSERT_ALIGN(hpa, 4);
- retval = mem_pdc_call(PDC_PCI_INDEX, PDC_PCI_GET_INT_TBL_SIZE, __pa(r_addr), hpa);
- convert_to_wide(r_addr);
return retval;
}
-int pdc_pci_irt(void *r_addr, void *hpa, void *tbl)
+/**
+ * pdc_pat_cell_module - Retrieve the cell's module information.
+ * @actcnt: The number of bytes written to mem_addr.
+ * @ploc: The physical location.
+ * @mod: The module index.
+ * @view_type: The view of the address type.
+ * @mem_addr: The return buffer.
+ *
+ * This PDC call returns information about each module attached to the cell
+ * at the specified location.
+ */
+int pdc_pat_cell_module(unsigned long *actcnt, unsigned long ploc, unsigned long mod,
+ unsigned long view_type, void *mem_addr)
{
int retval;
+
+ spin_lock_irq(&pdc_lock);
+ retval = mem_pdc_call(PDC_PAT_CELL, PDC_PAT_CELL_MODULE, __pa(pdc_result),
+ ploc, mod, view_type, __pa(pdc_result2));
+ if(!retval) {
+ *actcnt = pdc_result[0];
+ memcpy(mem_addr, pdc_result2, *actcnt);
+ }
+ spin_unlock_irq(&pdc_lock);
- ASSERT_ALIGN(r_addr, 4);
- ASSERT_ALIGN(hpa, 4);
- ASSERT_ALIGN(tbl, 4);
- retval = mem_pdc_call(PDC_PCI_INDEX, PDC_PCI_GET_INT_TBL, __pa(r_addr), hpa, __pa(tbl));
- convert_to_wide(r_addr);
return retval;
}
-/* access the TOD clock */
-int pdc_tod_read(struct pdc_tod *tod)
+/**
+ * pdc_pat_cpu_get_number - Retrieve the cpu number.
+ * @cpu_info: The return buffer.
+ * @hpa: The Hard Physical Address of the CPU.
+ *
+ * Retrieve the cpu number for the cpu at the specified HPA.
+ */
+int pdc_pat_cpu_get_number(struct pdc_pat_cpu_num *cpu_info, void *hpa)
{
int retval;
+
+ spin_lock_irq(&pdc_lock);
+ retval = mem_pdc_call(PDC_PAT_CPU, PDC_PAT_CPU_GET_NUMBER,
+ __pa(&pdc_result), hpa);
+ memcpy(cpu_info, pdc_result, sizeof(*cpu_info));
+ spin_unlock_irq(&pdc_lock);
- ASSERT_ALIGN(tod, 8);
- retval = mem_pdc_call(PDC_TOD, PDC_TOD_READ, __pa(tod), 0);
- convert_to_wide((unsigned long *)tod);
return retval;
}
-int pdc_tod_set(unsigned long sec, unsigned long usec)
+/**
+ * pdc_pat_get_irt_size - Retrieve the number of entries in the cell's interrupt table.
+ * @num_entries: The return value.
+ * @cell_num: The target cell.
+ *
+ * This PDC function returns the number of entries in the specified cell's
+ * interrupt table.
+ */
+int pdc_pat_get_irt_size(unsigned long *num_entries, unsigned long cell_num)
{
- return mem_pdc_call(PDC_TOD, PDC_TOD_WRITE, sec, usec);
+ int retval;
+
+ spin_lock_irq(&pdc_lock);
+ retval = mem_pdc_call(PDC_PAT_IO, PDC_PAT_IO_GET_PCI_ROUTING_TABLE_SIZE,
+ __pa(pdc_result), cell_num);
+ *num_entries = pdc_result[0];
+ spin_unlock_irq(&pdc_lock);
+
+ return retval;
}
-#ifdef __LP64__
-int pdc_mem_mem_table(void *r_addr, void *tbl, unsigned long entries)
+/**
+ * pdc_pat_get_irt - Retrieve the cell's interrupt table.
+ * @r_addr: The return buffer.
+ * @cell_num: The target cell.
+ *
+ * This PDC function returns the actual interrupt table for the specified cell.
+ */
+int pdc_pat_get_irt(void *r_addr, unsigned long cell_num)
{
int retval;
+
+ spin_lock_irq(&pdc_lock);
+ retval = mem_pdc_call(PDC_PAT_IO, PDC_PAT_IO_GET_PCI_ROUTING_TABLE,
+ __pa(r_addr), cell_num);
+ spin_unlock_irq(&pdc_lock);
- ASSERT_ALIGN(r_addr, 4);
- ASSERT_ALIGN(tbl, 4);
- retval = mem_pdc_call(PDC_MEM, PDC_MEM_TABLE, __pa(r_addr), __pa(tbl), entries);
- convert_to_wide(r_addr);
return retval;
}
-#endif
+/**
+ * pdc_pat_pd_get_addr_map - Retrieve information about memory address ranges.
+ * @actlen: The return buffer.
+ * @mem_addr: Pointer to the memory buffer.
+ * @count: The number of bytes to read from the buffer.
+ * @offset: The offset with respect to the beginning of the buffer.
+ *
+ */
+int pdc_pat_pd_get_addr_map(unsigned long *actual_len, void *mem_addr,
+ unsigned long count, unsigned long offset)
+{
+ int retval;
-static spinlock_t pdc_lock = SPIN_LOCK_UNLOCKED;
+ spin_lock_irq(&pdc_lock);
+ retval = mem_pdc_call(PDC_PAT_PD, PDC_PAT_PD_GET_ADDR_MAP, __pa(pdc_result),
+ __pa(pdc_result2), count, offset);
+ *actual_len = pdc_result[0];
+ memcpy(mem_addr, pdc_result2, *actual_len);
+ spin_unlock_irq(&pdc_lock);
+
+ return retval;
+}
+#endif
+
/***************** 32-bit real-mode calls ***********/
/* The struct below is used
* to overlay real_stack (real2.S), preparing a 32-bit call frame.
@@ -364,17 +796,14 @@ struct narrow_stack {
/* in reality, there's nearly 8k of stack after this */
};
-long real32_call(unsigned long fn, ...)
+static long real32_call(unsigned long fn, ...)
{
va_list args;
- unsigned long r, flags;
extern struct narrow_stack real_stack;
extern unsigned long real32_call_asm(unsigned int *,
unsigned int *,
unsigned int);
- spin_lock_irqsave(&pdc_lock, flags);
-
va_start(args, fn);
real_stack.arg0 = va_arg(args, unsigned int);
real_stack.arg1 = va_arg(args, unsigned int);
@@ -391,11 +820,8 @@ long real32_call(unsigned long fn, ...)
real_stack.arg12 = va_arg(args, unsigned int);
real_stack.arg13 = va_arg(args, unsigned int);
va_end(args);
-
- r = real32_call_asm(&real_stack.sp, &real_stack.arg0, fn);
- spin_unlock_irqrestore(&pdc_lock, flags);
- return r;
+ return real32_call_asm(&real_stack.sp, &real_stack.arg0, fn);
}
#ifdef __LP64__
@@ -421,17 +847,14 @@ struct wide_stack {
/* in reality, there's nearly 8k of stack after this */
};
-long real64_call(unsigned long fn, ...)
+static long real64_call(unsigned long fn, ...)
{
va_list args;
- unsigned long r, flags;
extern struct wide_stack real_stack;
extern unsigned long real64_call_asm(unsigned long *,
unsigned long *,
unsigned long);
- spin_lock_irqsave(&pdc_lock, flags);
-
va_start(args, fn);
real_stack.arg0 = va_arg(args, unsigned long);
real_stack.arg1 = va_arg(args, unsigned long);
@@ -448,11 +871,8 @@ long real64_call(unsigned long fn, ...)
real_stack.arg12 = va_arg(args, unsigned long);
real_stack.arg13 = va_arg(args, unsigned long);
va_end(args);
-
- r = real64_call_asm(&real_stack.sp, &real_stack.arg0, fn);
- spin_unlock_irqrestore(&pdc_lock, flags);
- return r;
+ return real64_call_asm(&real_stack.sp, &real_stack.arg0, fn);
}
#endif
Index: arch/parisc/kernel/inventory.c
===================================================================
RCS file: /home/cvs/parisc/linux/arch/parisc/kernel/inventory.c,v
retrieving revision 1.27
diff -u -p -r1.27 inventory.c
--- inventory.c 2001/03/02 10:31:49 1.27
+++ inventory.c 2001/04/06 04:21:56
@@ -7,7 +7,6 @@
#include <asm/hardware.h>
#include <asm/io.h>
#include <asm/pdc.h>
-#include <asm/pdcpat.h>
#include <asm/processor.h>
#include <asm/page.h>
@@ -19,20 +18,16 @@
int pdc_type = PDC_TYPE_ILLEGAL;
-static struct pdc_model model __attribute__ ((aligned(8)));
-#ifndef __LP64__
-static u8 iodc_data[32 * sizeof(long)] __attribute__ ((aligned(64)));
-static struct pdc_memory_map r_addr __attribute__ ((aligned(8)));
-#endif
-static unsigned long pdc_result[32] __attribute__ ((aligned(8)));
-static struct pdc_system_map_mod_info module_result __attribute__ ((aligned(8)));
-static struct pdc_system_map_addr_info addr_result __attribute__ ((aligned(8)));
-static struct pdc_module_path module_path __attribute__ ((aligned(8)));
-
void setup_pdc(void)
{
long status;
unsigned int bus_id;
+ struct pdc_system_map_mod_info module_result;
+ struct pdc_module_path module_path;
+ struct pdc_model model;
+#ifdef __LP64__
+ struct pdc_pat_cell_num cell_info;
+#endif
/* Determine the pdc "type" used on this machine */
@@ -59,11 +54,11 @@ void setup_pdc(void)
*/
#ifdef __LP64__
- status = pdc_pat_cell_get_number(&pdc_result);
+ status = pdc_pat_cell_get_number(&cell_info);
if (status == PDC_RET_OK) {
- pdc_type = PDC_TYPE_PAT;
- printk("64 bit PDC PAT Box\n");
- return;
+ pdc_type = PDC_TYPE_PAT;
+ printk("64 bit PDC PAT Box\n");
+ return;
}
#endif
@@ -166,12 +161,13 @@ void do_pagezero_memconfig(void)
static int pat_query_module(ulong pcell_loc, ulong mod_index)
{
pdc_pat_cell_mod_maddr_block_t pa_pdc_cell;
+ unsigned long bytecnt;
unsigned long temp; /* 64-bit scratch value */
long status; /* PDC return value status */
struct hp_device *dev;
/* return cell module (PA or Processor view) */
- status = pdc_pat_cell_module(&pdc_result, pcell_loc, mod_index,
+ status = pdc_pat_cell_module(&bytecnt, pcell_loc, mod_index,
PA_VIEW, &pa_pdc_cell);
if (status != PDC_RET_OK) {
@@ -254,7 +250,7 @@ static int pat_query_module(ulong pcell_
static void do_pat_memconfig(void)
{
- struct pdc_pat_pd_addr_map_rtn r_addr;
+ unsigned long actual_len;
struct pdc_pat_pd_addr_map_entry mem_table[PAT_MAX_RANGES+1];
struct pdc_pat_pd_addr_map_entry *mtbl_ptr;
physmem_range_t *pmem_ptr;
@@ -266,10 +262,10 @@ static void do_pat_memconfig(void)
length = (unsigned long)(PAT_MAX_RANGES + 1)
* sizeof(struct pdc_pat_pd_addr_map_entry);
- status = pdc_pat_pd_get_addr_map(&r_addr,mem_table,length,0L);
+ status = pdc_pat_pd_get_addr_map(&actual_len, mem_table, length, 0L);
if ((status != PDC_RET_OK)
- || ((r_addr.actual_len % sizeof(struct pdc_pat_pd_addr_map_entry)) != 0)) {
+ || ((actual_len % sizeof(struct pdc_pat_pd_addr_map_entry)) != 0)) {
/* The above pdc call shouldn't fail, but, just in
* case, just use the PAGE0 info.
@@ -280,7 +276,7 @@ static void do_pat_memconfig(void)
return;
}
- entries = r_addr.actual_len / sizeof(struct pdc_pat_pd_addr_map_entry);
+ entries = actual_len / sizeof(struct pdc_pat_pd_addr_map_entry);
if (entries > PAT_MAX_RANGES) {
printk("This Machine has more memory ranges than we support!\n");
@@ -319,28 +315,25 @@ static void do_pat_memconfig(void)
static int do_pat_inventory(void)
{
- ulong mod_index = 0;
int status;
- ulong cell_num;
- ulong pcell_loc;
+ ulong mod_index = 0;
+ struct pdc_pat_cell_num cell_info;
/*
** Note: Prelude (and it's successors: Lclass, A400/500) only
** implement PDC_PAT_CELL sub-options 0 and 2.
*/
- status = pdc_pat_cell_get_number(&pdc_result);
+ status = pdc_pat_cell_get_number(&cell_info);
if (status != PDC_RET_OK) {
return 0;
}
- cell_num = pdc_result[0]; /* Cell number call was made from */
- pcell_loc = pdc_result[1]; /* Physical location of this cell */
-
#ifdef DEBUG_PAT
- printk("CELL_GET_NUMBER: 0x%lx 0x%lx\n", cell_num, pcell_loc);
+ printk("CELL_GET_NUMBER: 0x%lx 0x%lx\n", cell_info.cell_num,
+ cell_info.cell_loc);
#endif
- while (PDC_RET_OK == pat_query_module(pcell_loc, mod_index)) {
+ while (PDC_RET_OK == pat_query_module(cell_info.cell_loc, mod_index)) {
mod_index++;
}
@@ -441,6 +434,10 @@ int do_legacy_inventory(void)
int status;
unsigned int hw_type;
unsigned int func;
+ unsigned long bytecnt;
+ struct pdc_module_path module_path;
+ struct pdc_memory_map r_addr;
+ u8 iodc_data[32 * sizeof(long)];
/* This is undocumented at the time of writing, but basically
** we're setting up mod_path so that bc[0..4]=0xff, and step
@@ -471,7 +468,7 @@ int do_legacy_inventory(void)
continue;
}
- status = pdc_iodc_read(&pdc_result, (void *) r_addr.hpa, 0,
+ status = pdc_iodc_read(&bytecnt, (void *)r_addr.hpa, 0,
&iodc_data, 32);
if (status != PDC_RET_OK)
continue;
@@ -617,6 +614,9 @@ static int do_system_map_inventory(void)
int i, j, num;
long status;
struct hp_device *hp_device;
+ struct pdc_system_map_mod_info module_result;
+ struct pdc_system_map_addr_info addr_result;
+ struct pdc_module_path module_path;
/* So the idea here is to simply try one SYSTEM_MAP call. If
** that one works, great, otherwise do it another way
Index: arch/parisc/kernel/iosapic.c
===================================================================
RCS file: /home/cvs/parisc/linux/arch/parisc/kernel/iosapic.c,v
retrieving revision 1.23
diff -u -p -r1.23 iosapic.c
--- iosapic.c 2001/03/29 10:32:49 1.23
+++ iosapic.c 2001/04/06 04:21:57
@@ -169,7 +169,6 @@
#include <asm/byteorder.h> /* get in-line asm for swab */
#include <asm/pdc.h>
-#include <asm/pdcpat.h>
#include <asm/page.h>
#include <asm/segment.h>
#include <asm/system.h>
@@ -330,25 +329,22 @@ static size_t irt_num_entry;
static int __init /* return number of entries as success/fail flag */
iosapic_load_irt(unsigned long cell_num, struct irt_entry **irt)
{
- struct pdc_pat_io_num pdc_io_num; /* PDC return block */
long status; /* PDC return value status */
struct irt_entry *table = NULL; /* start of interrupt routing tbl */
unsigned long num_entries = 0UL;
ASSERT(NULL != irt);
- /* FIXME ASSERT(((&pdc_io_num) & (0x3f)) == 0); enforce 32-byte alignment */
if (is_pdc_pat()) {
/* Use pat pdc routine to get interrupt routing table size */
DBG(KERN_DEBUG "calling get_irt_size\n");
- status = pdc_pat_get_irt_size( &pdc_io_num, cell_num);
+ status = pdc_pat_get_irt_size(&num_entries, cell_num);
DBG(KERN_DEBUG "get_irt_size: %ld\n", status);
ASSERT(status == PDC_RET_OK);
/* save the number of entries in the table */
- num_entries = pdc_io_num.num;
ASSERT(0UL != num_entries);
/*
@@ -380,7 +376,7 @@ iosapic_load_irt(unsigned long cell_num,
return 0;
}
- status = pdc_pci_irt_size( (void *)&pdc_io_num,
+ status = pdc_pci_irt_size(&num_entries,
/* elroy HPA (really a NOP) */ 0);
DBG(KERN_WARNING "pdc_pci_irt_size: %ld\n", status);
@@ -389,7 +385,6 @@ iosapic_load_irt(unsigned long cell_num,
return 0;
}
- num_entries = pdc_io_num.num;
ASSERT(0UL != num_entries);
table = IOSAPIC_KALLOC(struct irt_entry, num_entries);
@@ -398,7 +393,7 @@ iosapic_load_irt(unsigned long cell_num,
return 0;
}
- status = pdc_pci_irt( (void *) &pdc_io_num,
+ status = pdc_pci_irt(num_entries,
(void *) NULL, /* Elroy HPA - not used */
(void *) table);
Index: arch/parisc/kernel/lba_pci.c
===================================================================
RCS file: /home/cvs/parisc/linux/arch/parisc/kernel/lba_pci.c,v
retrieving revision 1.24
diff -u -p -r1.24 lba_pci.c
--- lba_pci.c 2001/03/11 07:05:58 1.24
+++ lba_pci.c 2001/04/06 04:21:57
@@ -42,7 +42,6 @@
#include <asm/byteorder.h>
#include <asm/irq.h> /* for struct irq_region support */
#include <asm/pdc.h>
-#include <asm/pdcpat.h>
#include <asm/page.h>
#include <asm/segment.h>
#include <asm/system.h>
@@ -277,11 +276,6 @@ static u32 lba_t32;
#define ROPES_PER_SBA 8
#define LBA_NUM(x) ((((unsigned long) x) >> 13) & (ROPES_PER_SBA-1))
-#ifdef __LP64__
-/* PDC_PAT */
-static unsigned long pdc_result[32] __attribute__ ((aligned (8))) = {0,0,0,0};
-#endif
-
/*
** One time initialization to let the world know the LBA was found.
** This is the only routine which is NOT static.
@@ -1040,6 +1034,7 @@ static struct pci_port_ops lba_pat_port_
static void
lba_pat_resources( struct hp_device *d, struct lba_device *lba_dev)
{
+ unsigned long bytecnt;
pdc_pat_cell_mod_maddr_block_t pa_pdc_cell; /* PA_VIEW */
#ifdef DONT_NEED_THIS_FOR_ASTRO
pdc_pat_cell_mod_maddr_block_t io_pdc_cell; /* IO_VIEW */
@@ -1050,12 +1045,12 @@ lba_pat_resources( struct hp_device *d,
int i;
/* return cell module (IO view) */
- status = pdc_pat_cell_module(& pdc_result, d->pcell_loc, d->mod_index,
+ status = pdc_pat_cell_module(&bytecnt, d->pcell_loc, d->mod_index,
PA_VIEW, & pa_pdc_cell);
pa_count = pa_pdc_cell.mod[1];
#ifdef DONT_NEED_THIS_FOR_ASTRO
- status |= pdc_pat_cell_module(& pdc_result, d->pcell_loc, d->mod_index,
+ status |= pdc_pat_cell_module(&bytecnt, d->pcell_loc, d->mod_index,
IO_VIEW, & io_pdc_cell);
io_count = io_pdc_cell.mod[1];
#endif
Index: arch/parisc/kernel/led.c
===================================================================
RCS file: /home/cvs/parisc/linux/arch/parisc/kernel/led.c,v
retrieving revision 1.16
diff -u -p -r1.16 led.c
--- led.c 2001/04/03 11:25:37 1.16
+++ led.c 2001/04/06 04:21:57
@@ -35,6 +35,7 @@
#include <asm/hardware.h>
#include <asm/param.h> /* HZ */
#include <asm/led.h>
+#include <asm/pdc.h>
/* The control of the LEDs and LCDs on PARISC-machines have to be done
completely in software. The necessary calculations are done during every
@@ -486,7 +487,7 @@ int lcd_print( char *str )
int __init led_init(void)
{
- long pdc_result[32];
+ struct pdc_chassis_info chassis_info;
/* Work around the buggy PDC of KittyHawk-machines */
switch (CPU_HVERSION) {
@@ -503,26 +504,26 @@ int __init led_init(void)
break;
}
- /* initialize pdc_result, so we can check the return values of pdc_chassis_info() */
- pdc_result[0] = pdc_result[1] = 0;
+ /* initialize raddr, so we can check the return values of pdc_chassis_info() */
+ chassis_info.actcnt = chassis_info.maxcnt = 0;
- if (pdc_chassis_info(&pdc_result, &lcd_info, sizeof(lcd_info)) == PDC_OK) {
+ if (pdc_chassis_info(&chassis_info, &lcd_info, sizeof(lcd_info)) == PDC_OK) {
pr_debug("%s: chassis info: model=%d (%s), "
- "lcd_width=%d, cmd_delay=%u, ret0=%ld, ret1=%ld\n",
+ "lcd_width=%d, cmd_delay=%u, actcnt=%ld, maxcnt=%ld\n",
__FUNCTION__,
lcd_info.model,
(lcd_info.model==DISPLAY_MODEL_LCD) ? "LCD" :
(lcd_info.model==DISPLAY_MODEL_LASI) ? "LED" : "unknown",
lcd_info.lcd_width, lcd_info.min_cmd_delay,
- pdc_result[0], pdc_result[1]);
+ chassis_info.actcnt, chassis_info.maxcnt);
/* check the results. Some machines have a buggy PDC */
- if (pdc_result[0] <= 0 || pdc_result[0] != pdc_result[1])
+ if (chassis_info.actcnt <= 0 || chassis_info.actcnt != chassis_info.maxcnt)
goto not_found;
switch (lcd_info.model) {
case DISPLAY_MODEL_LCD: /* LCD display */
- if (pdc_result[0] <
+ if (chassis_info.actcnt <
(unsigned long)&lcd_info._pad - (unsigned long)&lcd_info - 1)
goto not_found;
pr_debug("%s: min_cmd_delay = %d uS\n",
@@ -533,7 +534,7 @@ int __init led_init(void)
goto not_found;
case DISPLAY_MODEL_LASI: /* Lasi style 8 bit LED display */
- if (pdc_result[0] != 8 && pdc_result[0] != 32)
+ if (chassis_info.actcnt != 8 && chassis_info.actcnt != 32)
goto not_found;
break;
Index: arch/parisc/kernel/pdc_cons.c
===================================================================
RCS file: /home/cvs/parisc/linux/arch/parisc/kernel/pdc_cons.c,v
retrieving revision 1.24
diff -u -p -r1.24 pdc_cons.c
--- pdc_cons.c 2001/03/08 13:30:33 1.24
+++ pdc_cons.c 2001/04/06 04:21:57
@@ -11,89 +11,10 @@
#include <asm/system.h>
#include <asm/pdc.h> /* for iodc_call() proto and friends */
-static int __attribute__((aligned(8))) iodc_retbuf[32];
-static char __attribute__((aligned(64))) iodc_dbuf[4096];
-
-/*
- * pdc_putc:
- * Console character print using IODC.
- *
- * Note that only these special chars are architected for console IODC io:
- * BEL, BS, CR, and LF. Others are passed through.
- * Since the HP console requires CR+LF to perform a 'newline', we translate
- * "\n" to "\r\n".
- */
-
-static int posx; /* for simple TAB-Simulation... */
-
-/* XXX Should we spinlock posx usage */
-
-void pdc_putc(unsigned char c)
-{
- unsigned int n;
-
- switch (c) {
- case '\n':
- iodc_dbuf[0] = '\r';
- iodc_dbuf[1] = '\n';
- n = 2;
- posx = 0;
- break;
- case '\t':
- pdc_putc(' ');
- while (posx & 7) /* expand TAB */
- pdc_putc(' ');
- return; /* return since IODC can't handle this */
- case '\b':
- posx-=2; /* BS */
- default:
- iodc_dbuf[0] = c;
- n = 1;
- posx++;
- break;
- }
- {
- real32_call(PAGE0->mem_cons.iodc_io,
- (unsigned long)PAGE0->mem_cons.hpa, ENTRY_IO_COUT,
- PAGE0->mem_cons.spa, __pa(PAGE0->mem_cons.dp.layers),
- __pa(iodc_retbuf), 0, __pa(iodc_dbuf), n, 0);
- }
-}
-
static void pdc_console_write(struct console *co, const char *s, unsigned count)
{
while(count--)
- pdc_putc(*s++);
-}
-
-int pdc_console_wait_key(struct console *co)
-{
- int ch = 'X';
- int status;
-
- /* Bail if no console input device. */
- if (!PAGE0->mem_kbd.iodc_io)
- return 0;
-
- /* wait for a keyboard (rs232)-input */
- do {
- unsigned long flags;
-
- save_flags(flags);
- cli();
- status = real32_call(PAGE0->mem_kbd.iodc_io,
- (unsigned long)PAGE0->mem_kbd.hpa, ENTRY_IO_CIN,
- PAGE0->mem_kbd.spa, __pa(PAGE0->mem_kbd.dp.layers),
- __pa(iodc_retbuf), 0, __pa(iodc_dbuf), 1, 0);
- restore_flags(flags);
- ch = *iodc_dbuf; /* save the character directly to ch */
- } while (*iodc_retbuf == 0); /* wait for a key */
- return ch;
-}
-
-int pdc_getc(void)
-{
- return pdc_console_wait_key(NULL);
+ pdc_iodc_putc(*s++);
}
static int pdc_console_setup(struct console *co, char *options)
@@ -106,7 +27,7 @@ static struct console pdc_cons = {
write: pdc_console_write,
read: NULL,
device: NULL,
- wait_key: pdc_console_wait_key,
+ wait_key: NULL,
unblank: NULL,
setup: pdc_console_setup,
flags: CON_BOOT|CON_PRINTBUFFER|CON_ENABLED, // |CON_CONSDEV,
Index: arch/parisc/kernel/process.c
===================================================================
RCS file: /home/cvs/parisc/linux/arch/parisc/kernel/process.c,v
retrieving revision 1.35
diff -u -p -r1.35 process.c
--- process.c 2001/04/05 23:22:06 1.35
+++ process.c 2001/04/06 04:21:58
@@ -113,15 +113,12 @@ void machine_restart(char *cmd)
** memory self tests. (Not implemented yet)
*/
if (ftc_bitmap) {
- mem_pdc_call( PDC_BROADCAST_RESET,
- PDC_DO_FIRM_TEST_RESET, PDC_FIRM_TEST_MAGIC,
- ftc_bitmap);
+ pdc_do_firm_test_reset(ftc_bitmap);
}
#endif
/* "Normal" system reset */
- (void) mem_pdc_call(PDC_BROADCAST_RESET, PDC_DO_RESET,
- 0L, 0L, 0L);
+ pdc_do_reset();
/* Nope...box should reset with just CMD_RESET now */
gsc_writel(CMD_RESET, COMMAND_GLOBAL);
Index: arch/parisc/kernel/setup.c
===================================================================
RCS file: /home/cvs/parisc/linux/arch/parisc/kernel/setup.c,v
retrieving revision 1.80
diff -u -p -r1.80 setup.c
--- setup.c 2001/03/22 06:46:32 1.80
+++ setup.c 2001/04/06 04:21:58
@@ -60,7 +60,6 @@
#include <asm/machdep.h> /* for pa7300lc_init() proto */
#include <asm/irq.h> /* for struct irq_region */
-#include <asm/pdcpat.h> /* for PA_VIEW PDC_PAT_CPU_GET_NUMBER etc */
#include <linux/proc_fs.h>
@@ -128,12 +127,13 @@ cpu_driver_callback(struct hp_device *d,
#ifdef __LP64__
if (is_pdc_pat()) {
- unsigned long pdc_result[32] __attribute__ ((aligned (8))) = {0,0,0,0};
ulong status;
+ unsigned long bytecnt;
pdc_pat_cell_mod_maddr_block_t pa_pdc_cell;
+ struct pdc_pat_cpu_num cpu_info;
- status = pdc_pat_cell_module(& pdc_result, d->pcell_loc,
- d->mod_index, PA_VIEW, & pa_pdc_cell);
+ status = pdc_pat_cell_module(&bytecnt, d->pcell_loc,
+ d->mod_index, PA_VIEW, &pa_pdc_cell);
ASSERT(PDC_RET_OK == status);
@@ -145,21 +145,20 @@ cpu_driver_callback(struct hp_device *d,
txn_addr = pa_pdc_cell.mod[0]; /* id_eid for IO sapic */
/* get the cpu number */
- status = mem_pdc_call( PDC_PAT_CPU, PDC_PAT_CPU_GET_NUMBER,
- __pa(& pdc_result), d->hpa);
+ status = pdc_pat_cpu_get_number(&cpu_info, d->hpa);
ASSERT(PDC_RET_OK == status);
- if(pdc_result[0] >= NR_CPUS) {
+ if(cpu_info.cpu_num >= NR_CPUS) {
printk(KERN_WARNING "IGNORING CPU at 0x%p,"
" cpu_slot_id > NR_CPUS"
" (%ld > %d)\n",
- d->hpa, pdc_result[0], NR_CPUS);
+ d->hpa, cpu_info.cpu_num, NR_CPUS);
/* Ignore CPU since it will only crash */
boot_cpu_data.cpu_count--;
return(1);
} else {
- cpuid = pdc_result[0];
+ cpuid = cpu_info.cpu_num;
}
} else
#endif
@@ -243,14 +242,14 @@ void __init collect_boot_cpu_data(void)
#undef p
if(pdc_model_versions(&boot_cpu_data.pdc.versions, 0)==0)
- printk("vers %08lx\n", boot_cpu_data.pdc.versions.cpuid);
+ printk("vers %08lx\n", boot_cpu_data.pdc.versions);
if(pdc_model_cpuid(&boot_cpu_data.pdc.cpuid)==0)
- printk("cpuid %08lx\n", boot_cpu_data.pdc.cpuid.cpuid);
+ printk("cpuid %08lx\n", boot_cpu_data.pdc.cpuid);
printk("CPUID vers %ld rev %ld\n",
- (boot_cpu_data.pdc.cpuid.cpuid >> 5) & 127,
- boot_cpu_data.pdc.cpuid.cpuid & 31);
+ (boot_cpu_data.pdc.cpuid >> 5) & 127,
+ boot_cpu_data.pdc.cpuid & 31);
if (pdc_model_sysmodel(boot_cpu_data.pdc.sys_model_name)==0)
printk("model %s\n",boot_cpu_data.pdc.sys_model_name);
@@ -282,31 +281,22 @@ void __init collect_boot_cpu_data(void)
int
init_per_cpu(int cpuid)
{
- unsigned long pdc_result[32] __attribute__ ((aligned (8)));
- unsigned long ccr;
int ret;
+ struct pdc_coproc_cfg coproc_cfg;
- /*
- ** ret[0] == Functional Coprocessors
- ** ret[1] == Coprocessors Present
- ** ret[15] == FP test status
- ** ret[17] == Revision
- ** ret[18] == Model
- */
- ret = pdc_coproc_cfg(&pdc_result);
- ccr = pdc_result[0];
+ ret = pdc_coproc_cfg(&coproc_cfg);
- if(ret >= 0 && ccr) {
- mtctl(ccr, 10); /* 10 == Coprocessor Control Reg */
+ if(ret >= 0 && coproc_cfg.ccr_functional) {
+ mtctl(coproc_cfg.ccr_functional, 10); /* 10 == Coprocessor Control Reg */
/* FWIW, FP rev/model is a more accurate way to determine
** CPU type. CPU rev/model has some ambiguous cases.
*/
- cpu_data[cpuid].fp_rev = pdc_result[17];
- cpu_data[cpuid].fp_model = pdc_result[18];
+ cpu_data[cpuid].fp_rev = coproc_cfg.revision;
+ cpu_data[cpuid].fp_model = coproc_cfg.model;
printk(KERN_INFO "FP[%d] enabled: Rev %ld Model %ld\n",
- cpuid, pdc_result[17], pdc_result[18]);
+ cpuid, coproc_cfg.revision, coproc_cfg.model);
/*
** store status register to stack (hopefully aligned)
@@ -316,11 +306,11 @@ init_per_cpu(int cpuid)
} else {
printk(KERN_WARNING "WARNING: No FP CoProcessor?!"
- " (pdc_result[0] == 0x%lx, expected 0xc0)\n"
+ " (coproc_cfg.ccr_functional == 0x%lx, expected 0xc0)\n"
#ifdef __LP64__
"Halting Machine - FP required\n"
#endif
- ,ccr);
+ , coproc_cfg.ccr_functional);
#ifdef __LP64__
mdelay(100); /* previous chars get pushed to console */
panic("FP CoProc not reported");
@@ -405,6 +395,8 @@ void __init setup_arch(char **cmdline_p)
"32"
#endif
"-bit Kernel has started...\n");
+
+ pdc_console_init();
#ifdef CONFIG_PDC_NARROW
printk("Kernel is using PDC in 32-bit mode.\n");
Index: arch/parisc/kernel/time.c
===================================================================
RCS file: /home/cvs/parisc/linux/arch/parisc/kernel/time.c,v
retrieving revision 1.10
diff -u -p -r1.10 time.c
--- time.c 2001/01/24 23:59:51 1.10
+++ time.c 2001/04/06 04:21:58
@@ -37,7 +37,6 @@ extern rwlock_t xtime_lock;
static long clocktick; /* timer cycles per tick */
static long halftick;
-static struct pdc_tod tod_data __attribute__((aligned(8)));
void timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
{
@@ -163,6 +162,7 @@ do_settimeofday (struct timeval *tv)
void __init time_init(void)
{
unsigned long next_tick;
+ static struct pdc_tod tod_data;
clocktick = (100 * PAGE0->mem_10msec) / HZ;
halftick = clocktick / 2;
Index: drivers/char/genrtc.c
===================================================================
RCS file: /home/cvs/parisc/linux/drivers/char/genrtc.c,v
retrieving revision 1.5
diff -u -p -r1.5 genrtc.c
--- genrtc.c 2001/02/08 06:20:15 1.5
+++ genrtc.c 2001/04/06 04:21:58
@@ -102,7 +102,7 @@ static const unsigned short int __mon_yd
static int get_hw_time(struct rtc_time *wtime)
{
- struct pdc_tod tod_data __attribute__((aligned(8)));
+ struct pdc_tod tod_data;
long int days, rem, y;
const unsigned short int *ip;
Index: drivers/net/lasi_82596.c
===================================================================
RCS file: /home/cvs/parisc/linux/drivers/net/lasi_82596.c,v
retrieving revision 1.16
diff -u -p -r1.16 lasi_82596.c
--- lasi_82596.c 2001/04/03 11:36:23 1.16
+++ lasi_82596.c 2001/04/06 04:21:59
@@ -1163,13 +1163,7 @@ static int __init i82596_probe(struct ne
if (!dev->base_addr || !dev->irq)
return -ENODEV;
- if (request_mem_region(dev->base_addr, I596_TOTAL_SIZE, "i82596") == NULL) {
- printk("%s: iomem region (0x%lx/%x) is unavailable\n",
- dev->name, dev->base_addr, I596_TOTAL_SIZE);
- return -ENODEV;
- }
-
- if (!pdc_lan_station_id( (char*)ð_addr, (void*)dev->base_addr)) {
+ if (pdc_lan_station_id( (char*)ð_addr, (void*)dev->base_addr)) {
for(i=0;i<6;i++)
eth_addr[i] = gsc_readb(LAN_PROM_ADDR+i);
printk("82596.c: MAC of HP700 LAN blindely read from the prom!\n");
Index: drivers/scsi/zalon7xx.c
===================================================================
RCS file: /home/cvs/parisc/linux/drivers/scsi/zalon7xx.c,v
retrieving revision 1.5
diff -u -p -r1.5 zalon7xx.c
--- zalon7xx.c 2001/03/04 19:27:05 1.5
+++ zalon7xx.c 2001/04/06 04:22:02
@@ -79,6 +79,14 @@ int zalon7xx_detect(Scsi_Host_Template *
return (hosts_used != 0);
}
+#if 0
+/* FIXME:
+ * Is this function dead code? or is someone planning on using it in the
+ * future. The clock = (int) pdc_result[16] does not look correct to
+ * me ... I think it should be iodc_data[16]. Since this cause a compile
+ * error with the new encapsulated PDC, I'm not compiling in this function.
+ * - RB
+ */
/* poke SCSI clock out of iodc data */
static int
lasi_scsi_clock(void * hpa, int defaultclock)
@@ -96,6 +104,7 @@ lasi_scsi_clock(void * hpa, int defaultc
printk(KERN_DEBUG __FUNCTION__ ": SCSI clock %d\n", clock);
return clock;
}
+#endif
static int __init
zalon_scsi_callback(struct hp_device *d, struct pa_iodc_driver *dri)
Index: drivers/video/sti/sticore.h
===================================================================
RCS file: /home/cvs/parisc/linux/drivers/video/sti/sticore.h,v
retrieving revision 1.7
diff -u -p -r1.7 sticore.h
--- sticore.h 2001/02/18 22:24:40 1.7
+++ sticore.h 2001/04/06 04:22:02
@@ -46,7 +46,7 @@
#define STI_CALL(func, flags, inptr, outptr, glob_cfg) \
({ \
- real32_call( func, (unsigned long)STI_PTR(flags), \
+ pdc_sti_call( func, (unsigned long)STI_PTR(flags), \
STI_PTR(inptr), STI_PTR(outptr), \
glob_cfg); \
})
Index: include/asm-parisc/pdc.h
===================================================================
RCS file: /home/cvs/parisc/linux/include/asm-parisc/pdc.h,v
retrieving revision 1.28
diff -u -p -r1.28 pdc.h
--- pdc.h 2001/03/22 16:24:19 1.28
+++ pdc.h 2001/04/06 04:22:04
@@ -12,7 +12,7 @@
#define PDC_CHASSIS_DISP 0 /* update chassis display */
#define PDC_CHASSIS_WARN 1 /* return chassis warnings */
#define PDC_CHASSIS_DISPWARN 2 /* update&return chassis status */
-#define PDC_RETURN_CHASSIS_INFO 128 /* HVERSION dependend: return chassis LED/LCD info */
+#define PDC_RETURN_CHASSIS_INFO 128 /* HVERSION dependent: return chassis LED/LCD info */
#define PDC_PIM 3 /* Get PIM data */
#define PDC_PIM_HPMC 0 /* Transfer HPMC data */
@@ -126,8 +126,8 @@
#define PDC_REQ_ERR_1 2 /* See above */
#define PDC_REQ_ERR_0 1 /* Call would generate a requestor error */
#define PDC_OK 0 /* Call completed successfully */
-#define PDC_BAD_PROC -1 /* Called non-existant procedure */
-#define PDC_BAD_OPTION -2 /* Called with non-existant option */
+#define PDC_BAD_PROC -1 /* Called non-existent procedure */
+#define PDC_BAD_OPTION -2 /* Called with non-existent option */
#define PDC_ERROR -3 /* Call could not complete without an error */
#define PDC_INVALID_ARG -10 /* Called with an invalid argument */
#define PDC_BUS_POW_WARN -12 /* Call could not complete in allowed power budget */
@@ -138,7 +138,7 @@ compatibility */
#define PDC_RET_OK 0L /* Call completed successfully */
#define PDC_RET_NE_PROC -1L /* Non-existent procedure */
-#define PDC_RET_NE_OPT -2L /* non-existant option - arg1 */
+#define PDC_RET_NE_OPT -2L /* non-existent option - arg1 */
#define PDC_RET_NE_MOD -5L /* Module not found */
#define PDC_RET_NE_CELL_MOD -7L /* Cell module not found */
#define PDC_RET_INV_ARG -10L /* Invalid argument */
@@ -151,7 +151,7 @@ compatibility */
#define PDC_ADD_VALID_REQ_ERR_1 2 /* See above */
#define PDC_ADD_VALID_REQ_ERR_0 1 /* Call would generate a requestor error */
#define PDC_ADD_VALID_OK 0 /* Call completed successfully */
-#define PDC_ADD_VALID_BAD_OPTION -2 /* Called with non-existant option */
+#define PDC_ADD_VALID_BAD_OPTION -2 /* Called with non-existent option */
#define PDC_ADD_VALID_ERROR -3 /* Call could not complete without an error */
#define PDC_ADD_VALID_INVALID_ARG -10 /* Called with an invalid argument */
#define PDC_ADD_VALID_BUS_POW_WARN -12 /* Call could not complete in allowed power budget */
@@ -178,6 +178,184 @@ compatibility */
#define OSTAT_RUN 6
#define OSTAT_ON 7
+#ifdef __LP64__
+/* PDC PAT CELL */
+#define PDC_PAT_CELL 64L /* Interface for gaining and
+ * manipulating cell state within PD */
+#define PDC_PAT_CELL_GET_NUMBER 0L /* Return Cell number */
+#define PDC_PAT_CELL_GET_INFO 1L /* Returns info about Cell */
+#define PDC_PAT_CELL_MODULE 2L /* Returns info about Module */
+#define PDC_PAT_CELL_SET_ATTENTION 9L /* Set Cell Attention indicator */
+#define PDC_PAT_CELL_NUMBER_TO_LOC 10L /* Cell Number -> Location */
+#define PDC_PAT_CELL_WALK_FABRIC 11L /* Walk the Fabric */
+#define PDC_PAT_CELL_GET_RDT_SIZE 12L /* Return Route Distance Table Sizes */
+#define PDC_PAT_CELL_GET_RDT 13L /* Return Route Distance Tables */
+#define PDC_PAT_CELL_GET_LOCAL_PDH_SZ 14L /* Read Local PDH Buffer Size */
+#define PDC_PAT_CELL_SET_LOCAL_PDH 15L /* Write Local PDH Buffer */
+#define PDC_PAT_CELL_GET_REMOTE_PDH_SZ 16L /* Return Remote PDH Buffer Size */
+#define PDC_PAT_CELL_GET_REMOTE_PDH 17L /* Read Remote PDH Buffer */
+#define PDC_PAT_CELL_GET_DBG_INFO 128L /* Return DBG Buffer Info */
+#define PDC_PAT_CELL_CHANGE_ALIAS 129L /* Change Non-Equivalent Alias Checking */
+
+/*
+** Arg to PDC_PAT_CELL_MODULE memaddr[4]
+**
+** Addresses on the Merced Bus != all Runway Bus addresses.
+** This is intended for programming SBA/LBA chips range registers.
+*/
+#define IO_VIEW 0UL
+#define PA_VIEW 1UL
+
+/* PDC_PAT_CELL_MODULE entity type values */
+#define PAT_ENTITY_CA 0 /* central agent */
+#define PAT_ENTITY_PROC 1 /* processor */
+#define PAT_ENTITY_MEM 2 /* memory controller */
+#define PAT_ENTITY_SBA 3 /* system bus adapter */
+#define PAT_ENTITY_LBA 4 /* local bus adapter */
+#define PAT_ENTITY_PBC 5 /* processor bus converter */
+#define PAT_ENTITY_XBC 6 /* crossbar fabric connect */
+#define PAT_ENTITY_RC 7 /* fabric interconnect */
+
+/* PDC_PAT_CELL_MODULE address range type values */
+#define PAT_PBNUM 0 /* PCI Bus Number */
+#define PAT_LMMIO 1 /* < 4G MMIO Space */
+#define PAT_GMMIO 2 /* > 4G MMIO Space */
+#define PAT_NPIOP 3 /* Non Postable I/O Port Space */
+#define PAT_PIOP 4 /* Postable I/O Port Space */
+#define PAT_AHPA 5 /* Additional HPA Space */
+#define PAT_UFO 6 /* HPA Space (UFO for Mariposa) */
+#define PAT_GNIP 7 /* GNI Reserved Space */
+
+
+/* PDC PAT CHASSIS LOG */
+
+#define PDC_PAT_CHASSIS_LOG 65L /* Platform logging & forward
+ ** progress functions */
+#define PDC_PAT_CHASSIS_WRITE_LOG 0L /* Write Log Entry */
+#define PDC_PAT_CHASSIS_READ_LOG 1L /* Read Log Entry */
+
+/* PDC PAT CPU */
+
+#define PDC_PAT_CPU 67L /* Interface to CPU configuration
+ * within the protection domain */
+#define PDC_PAT_CPU_INFO 0L /* Return CPU config info */
+#define PDC_PAT_CPU_DELETE 1L /* Delete CPU */
+#define PDC_PAT_CPU_ADD 2L /* Add CPU */
+#define PDC_PAT_CPU_GET_NUMBER 3L /* Return CPU Number */
+#define PDC_PAT_CPU_GET_HPA 4L /* Return CPU HPA */
+#define PDC_PAT_CPU_STOP 5L /* Stop CPU */
+#define PDC_PAT_CPU_RENDEZVOUS 6L /* Rendezvous CPU */
+#define PDC_PAT_CPU_GET_CLOCK_INFO 7L /* Return CPU Clock info */
+#define PDC_PAT_CPU_GET_RENDEZVOUS_STATE 8L /* Return Rendezvous State */
+#define PDC_PAT_CPU_PLUNGE_FABRIC 128L /* Plunge Fabric */
+#define PDC_PAT_CPU_UPDATE_CACHE_CLEANSING 129L /* Manipulate Cache
+ * Cleansing Mode */
+/* PDC PAT EVENT */
+
+#define PDC_PAT_EVENT 68L /* Interface to Platform Events */
+#define PDC_PAT_EVENT_GET_CAPS 0L /* Get Capabilities */
+#define PDC_PAT_EVENT_SET_MODE 1L /* Set Notification Mode */
+#define PDC_PAT_EVENT_SCAN 2L /* Scan Event */
+#define PDC_PAT_EVENT_HANDLE 3L /* Handle Event */
+#define PDC_PAT_EVENT_GET_NB_CALL 4L /* Get Non-Blocking call Args */
+
+/* PDC PAT HPMC */
+
+#define PDC_PAT_HPMC 70L /* Cause processor to go into spin
+ ** loop, and wait for wake up from
+ ** Monarch Processor */
+#define PDC_PAT_HPMC_RENDEZ_CPU 0L /* go into spin loop */
+#define PDC_PAT_HPMC_SET_PARAMS 1L /* Allows OS to specify intr which PDC
+ * will use to interrupt OS during machine
+ * check rendezvous */
+
+/* parameters for PDC_PAT_HPMC_SET_PARAMS: */
+#define HPMC_SET_PARAMS_INTR 1L /* Rendezvous Interrupt */
+#define HPMC_SET_PARAMS_WAKE 2L /* Wake up processor */
+
+/* PDC PAT IO */
+
+#define PDC_PAT_IO 71L /* On-line services for I/O modules */
+#define PDC_PAT_IO_GET_SLOT_STATUS 5L /* Get Slot Status Info*/
+#define PDC_PAT_IO_GET_LOC_FROM_HARDWARE 6L /* Get Physical Location from */
+ /* Hardware Path */
+#define PDC_PAT_IO_GET_HARDWARE_FROM_LOC 7L /* Get Hardware Path from
+ * Physical Location */
+#define PDC_PAT_IO_GET_PCI_CONFIG_FROM_HW 11L /* Get PCI Configuration
+ * Address from Hardware Path */
+#define PDC_PAT_IO_GET_HW_FROM_PCI_CONFIG 12L /* Get Hardware Path
+ * from PCI Configuration Address */
+#define PDC_PAT_IO_READ_HOST_BRIDGE_INFO 13L /* Read Host Bridge State Info */
+#define PDC_PAT_IO_CLEAR_HOST_BRIDGE_INFO 14L /* Clear Host Bridge State Info*/
+#define PDC_PAT_IO_GET_PCI_ROUTING_TABLE_SIZE 15L /* Get PCI INT Routing Table
+ * Size */
+#define PDC_PAT_IO_GET_PCI_ROUTING_TABLE 16L /* Get PCI INT Routing Table */
+#define PDC_PAT_IO_GET_HINT_TABLE_SIZE 17L /* Get Hint Table Size */
+#define PDC_PAT_IO_GET_HINT_TABLE 18L /* Get Hint Table */
+#define PDC_PAT_IO_PCI_CONFIG_READ 19L /* PCI Config Read */
+#define PDC_PAT_IO_PCI_CONFIG_WRITE 20L /* PCI Config Write */
+#define PDC_PAT_IO_GET_NUM_IO_SLOTS 21L /* Get Number of I/O Bay Slots in
+ * Cabinet */
+#define PDC_PAT_IO_GET_LOC_IO_SLOTS 22L /* Get Physical Location of I/O */
+ /* Bay Slots in Cabinet */
+#define PDC_PAT_IO_BAY_STATUS_INFO 28L /* Get I/O Bay Slot Status Info */
+#define PDC_PAT_IO_GET_PROC_VIEW 29L /* Get Processor view of IO address */
+#define PDC_PAT_IO_PROG_SBA_DIR_RANGE 30L /* Program directed range */
+
+/* PDC PAT MEM */
+
+#define PDC_PAT_MEM 72L /* Manage memory page deallocation */
+#define PDC_PAT_MEM_PD_INFO 0L /* Return PDT info for PD */
+#define PDC_PAT_MEM_PD_CLEAR 1L /* Clear PDT for PD */
+#define PDC_PAT_MEM_PD_READ 2L /* Read PDT entries for PD */
+#define PDC_PAT_MEM_PD_RESET 3L /* Reset clear bit for PD */
+#define PDC_PAT_MEM_CELL_INFO 5L /* Return PDT info For Cell */
+#define PDC_PAT_MEM_CELL_CLEAR 6L /* Clear PDT For Cell */
+#define PDC_PAT_MEM_CELL_READ 7L /* Read PDT entries For Cell */
+#define PDC_PAT_MEM_CELL_RESET 8L /* Reset clear bit For Cell */
+#define PDC_PAT_MEM_SETGM 9L /* Set Golden Memory value */
+#define PDC_PAT_MEM_ADD_PAGE 10L /* ADDs a page to the cell */
+#define PDC_PAT_MEM_ADDRESS 11L /* Get Physical Location From */
+ /* Memory Address */
+#define PDC_PAT_MEM_GET_TXT_SIZE 12L /* Get Formatted Text Size */
+#define PDC_PAT_MEM_GET_PD_TXT 13L /* Get PD Formatted Text */
+#define PDC_PAT_MEM_GET_CELL_TXT 14L /* Get Cell Formatted Text */
+#define PDC_PAT_MEM_RD_STATE_INFO 15L /* Read Mem Module State Info*/
+#define PDC_PAT_MEM_CLR_STATE_INFO 16L /*Clear Mem Module State Info*/
+#define PDC_PAT_MEM_CLEAN_RANGE 128L /*Clean Mem in specific range*/
+#define PDC_PAT_MEM_GET_TBL_SIZE 131L /* Get Memory Table Size */
+#define PDC_PAT_MEM_GET_TBL 132L /* Get Memory Table */
+
+/* PDC PAT NVOLATILE */
+
+#define PDC_PAT_NVOLATILE 73L /* Access Non-Volatile Memory */
+#define PDC_PAT_NVOLATILE_READ 0L /* Read Non-Volatile Memory */
+#define PDC_PAT_NVOLATILE_WRITE 1L /* Write Non-Volatile Memory */
+#define PDC_PAT_NVOLATILE_GET_SIZE 2L /* Return size of NVM */
+#define PDC_PAT_NVOLATILE_VERIFY 3L /* Verify contents of NVM */
+#define PDC_PAT_NVOLATILE_INIT 4L /* Initialize NVM */
+
+/* PDC PAT PD */
+
+#define PDC_PAT_PD 74L /* Protection Domain Info */
+#define PDC_PAT_PD_GET_ADDR_MAP 0L /* Get Address Map */
+
+/* PDC_PAT_PD_GET_ADDR_MAP entry types */
+
+#define PAT_MEMORY_DESCRIPTOR 1
+
+/* PDC_PAT_PD_GET_ADDR_MAP memory types */
+
+#define PAT_MEMTYPE_MEMORY 0
+#define PAT_MEMTYPE_FIRMWARE 4
+
+/* PDC_PAT_PD_GET_ADDR_MAP memory usage */
+
+#define PAT_MEMUSE_GENERAL 0
+#define PAT_MEMUSE_GI 128
+#define PAT_MEMUSE_GNI 129
+#endif /* __LP64__ */
+
#ifndef __ASSEMBLY__
#include <linux/types.h>
@@ -193,6 +371,18 @@ extern int pdc_type;
#define is_pdc_pat() (pdc_type == PDC_TYPE_PAT)
+struct pdc_chassis_info { /* for PDC_CHASSIS_INFO */
+ unsigned long actcnt; /* actual number of bytes returned */
+ unsigned long maxcnt; /* maximum number of bytes that could be returned */
+};
+
+struct pdc_coproc_cfg { /* for PDC_COPROC_CFG */
+ unsigned long ccr_functional;
+ unsigned long ccr_present;
+ unsigned long revision;
+ unsigned long model;
+};
+
struct pdc_model { /* for PDC_MODEL */
unsigned long hversion;
unsigned long sversion;
@@ -203,26 +393,14 @@ struct pdc_model { /* for PDC_MODEL */
unsigned long arch_rev;
unsigned long pot_key;
unsigned long curr_key;
- unsigned long pad[32-9];
-} __attribute__((aligned(8))) ;
-
-
-struct pdc_model_sysmodel { /* for PDC_MODEL_SYSMODEL */
- unsigned long mod_len;
- unsigned long pad[32-1];
-} __attribute__((aligned(8))) ;
-
-struct pdc_model_cpuid { /* for PDC_MODEL_CPU_ID */
- unsigned long cpuid;
- unsigned long pad[32-1];
-} __attribute__((aligned(8))) ;
+};
struct pdc_cache_cf { /* for PDC_CACHE (I/D-caches) */
unsigned long
#ifdef __LP64__
cc_padW:32,
#endif
- cc_alias:4, /* alias boundaries for virtual adresses */
+ cc_alias:4, /* alias boundaries for virtual addresses */
cc_block: 4, /* to determine most efficient stride */
cc_line : 3, /* maximum amount written back as a result of store (multiple of 16 bytes) */
cc_pad0 : 2, /* reserved */
@@ -281,14 +459,7 @@ struct pdc_cache_info { /* main-PDC_CAC
unsigned long dt_off_stride;
unsigned long dt_off_count;
unsigned long dt_loop;
- /* padded to 32 entries... */
- unsigned long pad[32-30];
-} __attribute__((aligned(8))) ;
-
-struct pdc_hpa { /* PDC_HPA */
- unsigned long hpa;
- unsigned long pad[31];
-} __attribute__((aligned(8))) ;
+};
#if 0
/* If you start using the next struct, you'll have to adjust it to
@@ -312,7 +483,7 @@ struct pdc_iodc { /* PDC_IODC */
} __attribute__((aligned(8))) ;
#endif
-#ifndef __LP64__
+#ifndef CONFIG_PA20
/* no BLTBs in pa2.0 processors */
struct pdc_btlb_info_range {
__u8 res00;
@@ -326,21 +497,13 @@ struct pdc_btlb_info { /* PDC_BLOCK_TLB,
unsigned int max_size; /* maximum size of BTLB in pages */
struct pdc_btlb_info_range fixed_range_info;
struct pdc_btlb_info_range variable_range_info;
- unsigned int pad[32-4];
-} __attribute__((aligned(8))) ;
+};
#endif
-struct pdc_tlb { /* for PDC_TLB */
- unsigned long min_size;
- unsigned long max_size;
- unsigned long pad[32-2];
-} __attribute__((aligned(8))) ;
-
#ifdef __LP64__
struct pdc_memory_table_raddr { /* PDC_MEM/PDC_MEM_TABLE (return info) */
unsigned long entries_returned;
unsigned long entries_total;
- unsigned long pad[32-2];
};
struct pdc_memory_table { /* PDC_MEM/PDC_MEM_TABLE (arguments) */
@@ -354,14 +517,12 @@ struct pdc_system_map_mod_info { /* PDC_
void * mod_addr;
unsigned long mod_pgs;
unsigned long add_addrs;
- unsigned long pad[32-3];
-} __attribute__((aligned(8))) ;
+};
struct pdc_system_map_addr_info { /* PDC_SYSTEM_MAP/FIND_ADDRESS */
void * mod_addr;
unsigned long mod_pgs;
- unsigned long pad[32-2];
-} __attribute__((aligned(8))) ;
+};
/*
* Device path specifications used by PDC.
@@ -372,31 +533,55 @@ struct pdc_module_path {
/* I/O adaptor (< 0 means none, > 63 resvd) */
char mod; /* fixed field of specified module */
unsigned int layers[6]; /* device-specific info (ctlr #, unit # ...) */
- unsigned long pad[32-2];
-} __attribute__((aligned(8))) ;
+};
#ifndef __LP64__
/* Probably needs 64-bit porting -PB */
struct pdc_memory_map { /* PDC_MEMORY_MAP */
unsigned long hpa; /* mod's register set address */
unsigned long more_pgs; /* number of additional I/O pgs */
- int pad1[30];
-} __attribute__((aligned(8))) ;
-
-struct pdc_lan_station_id { /* PDC_LAN_STATION_ID */
- unsigned char addr[PDC_LAN_STATION_ID_SIZE];
- unsigned char pad0[2];
- int pad1[30];
};
#endif
struct pdc_tod {
unsigned long tod_sec;
unsigned long tod_usec;
- long pad[30];
-} __attribute__((aligned(8))) ;
+};
+
+#ifdef __LP64__
+struct pdc_pat_cell_num {
+ unsigned long cell_num;
+ unsigned long cell_loc;
+};
+
+struct pdc_pat_cpu_num {
+ unsigned long cpu_num;
+ unsigned long cpu_loc;
+};
+struct pdc_pat_pd_addr_map_entry {
+ unsigned char entry_type; /* 1 = Memory Descriptor Entry Type */
+ unsigned char reserve1[5];
+ unsigned char memory_type;
+ unsigned char memory_usage;
+ unsigned long paddr;
+ unsigned int pages; /* Length in 4K pages */
+ unsigned int reserve2;
+ unsigned long cell_map;
+};
+
+/* FIXME: mod[508] should really be a union of the various mod components */
+struct pdc_pat_cell_mod_maddr_block { /* PDC_PAT_CELL_MODULE */
+ unsigned long cba; /* function 0 configuration space address */
+ unsigned long mod_info; /* module information */
+ unsigned long mod_location; /* physical location of the module */
+ unsigned long mod_path; /* module path (device path - layers) */
+ unsigned long mod[508]; /* PAT cell module components */
+};
+typedef struct pdc_pat_cell_mod_maddr_block pdc_pat_cell_mod_maddr_block_t;
+#endif
+
/* architected results from PDC_PIM/transfer hpmc on a PA1.1 machine */
struct pdc_hpmc_pim_11 { /* PDC_PIM */
@@ -599,67 +784,94 @@ struct zeropage {
#ifndef __ASSEMBLY__
extern void pdc_console_init(void);
-/* pdc_get/put are NOT SMP safe - use at your own risk! */
-extern int pdc_getc(void); /* wait for char */
-extern void pdc_putc(unsigned char); /* print char */
-
extern void setup_pdc(void); /* in inventory.c */
/* wrapper-functions from pdc.c */
int pdc_add_valid(void *address);
-int pdc_hpa_processor(struct pdc_hpa *address);
-int pdc_coproc_cfg(void *address);
-int pdc_iodc_read(void *address, void *hpa, unsigned int index,
+int pdc_chassis_info(struct pdc_chassis_info *chassis_info, void *led_info, unsigned long len);
+int pdc_coproc_cfg(struct pdc_coproc_cfg *pdc_coproc_info);
+int pdc_iodc_read(unsigned long *actcnt, void *hpa, unsigned int index,
void *iodc_data, unsigned int iodc_data_size);
-int pdc_psw_get_mask(void *address);
-int pdc_psw_get_defaults(void *address);
-int pdc_psw_set_defaults(unsigned long val);
int pdc_system_map_find_mods(struct pdc_system_map_mod_info *pdc_mod_info,
struct pdc_module_path *mod_path, long mod_index);
int pdc_system_map_find_addrs(struct pdc_system_map_addr_info *pdc_addr_info,
long mod_index, long addr_index);
int pdc_model_info(struct pdc_model *model);
int pdc_model_sysmodel(char *name);
-int pdc_model_cpuid(struct pdc_model_cpuid *cpu_id);
-int pdc_model_versions(struct pdc_model_cpuid *cpu_id, int id);
+int pdc_model_cpuid(unsigned long *cpu_id);
+int pdc_model_versions(unsigned long *versions, int id);
int pdc_cache_info(struct pdc_cache_info *cache);
+#ifndef CONFIG_PA20
+int pdc_btlb_info(struct pdc_btlb_info *btlb);
+#endif
#ifndef __LP64__
-int pdc_btlb_info( struct pdc_btlb_info *btlb);
-int pdc_lan_station_id( char *lan_addr, void *net_hpa);
int pdc_mem_map_hpa(struct pdc_memory_map *r_addr, struct pdc_module_path *mod_path);
#endif
-
-extern int pdc_chassis_disp(unsigned long disp);
-extern int pdc_chassis_info(void *pdc_result, void *chassis_info, unsigned long len);
+int pdc_lan_station_id(char *lan_addr, void *net_hpa);
-int pdc_pci_irt_size(void *r_addr, void *hpa);
-int pdc_pci_irt(void *r_addr, void *hpa, void *tbl);
+int pdc_pci_irt_size(unsigned long *num_entries, void *hpa);
+int pdc_pci_irt(unsigned long num_entries, void *hpa, void *tbl);
int pdc_tod_read(struct pdc_tod *tod);
int pdc_tod_set(unsigned long sec, unsigned long usec);
#ifdef __LP64__
-int pdc_mem_mem_table(void *r_addr, void *tbl, unsigned long entries);
+int pdc_mem_mem_table(struct pdc_memory_table_raddr *r_addr, struct pdc_memory_table *tbl,
+ unsigned long entries);
#endif
-/* on all currently-supported platforms, IODC I/O calls are always
- * 32-bit calls, and MEM_PDC calls are always the same width as the OS.
- * This means Cxxx boxes can't run wide kernels right now. -PB
- *
- * Note that some PAT boxes may have 64-bit IODC I/O...
- */
+int pdc_do_firm_test_reset(unsigned long ftc_bitmap);
+int pdc_do_reset(void);
+void pdc_iodc_putc(unsigned char c);
+
+int pdc_sti_call(unsigned long func, unsigned long flags,
+ unsigned long inptr, unsigned long outputr,
+ unsigned long glob_cfg);
+
+#ifdef __LP64__
+int pdc_pat_cell_get_number(struct pdc_pat_cell_num *cell_info);
+int pdc_pat_cell_module(unsigned long *actcnt, unsigned long ploc, unsigned long mod,
+ unsigned long view_type, void *mem_addr);
+int pdc_pat_cpu_get_number(struct pdc_pat_cpu_num *cpu_info, void *hpa);
+int pdc_pat_get_irt_size(unsigned long *num_entries, unsigned long cell_num);
+int pdc_pat_get_irt(void *r_addr, unsigned long cell_num);
+int pdc_pat_pd_get_addr_map(unsigned long *actual_len, void *mem_addr,
+ unsigned long count, unsigned long offset);
+
+/********************************************************************
+* PDC_PAT_CELL[Return Cell Module] memaddr[0] conf_base_addr
+* ----------------------------------------------------------
+* Bit 0 to 51 - conf_base_addr
+* Bit 52 to 62 - reserved
+* Bit 63 - endianess bit
+********************************************************************/
+#define PAT_GET_CBA(value) ((value) & 0xfffffffffffff000UL)
+
+/********************************************************************
+* PDC_PAT_CELL[Return Cell Module] memaddr[1] mod_info
+* ----------------------------------------------------
+* Bit 0 to 7 - entity type
+* 0 = central agent, 1 = processor,
+* 2 = memory controller, 3 = system bus adapter,
+* 4 = local bus adapter, 5 = processor bus converter,
+* 6 = crossbar fabric connect, 7 = fabric interconnect,
+* 8 to 254 reserved, 255 = unknown.
+* Bit 8 to 15 - DVI
+* Bit 16 to 23 - IOC functions
+* Bit 24 to 39 - reserved
+* Bit 40 to 63 - mod_pages
+* number of 4K pages a module occupies starting at conf_base_addr
+********************************************************************/
+#define PAT_GET_ENTITY(value) (((value) >> 56) & 0xffUL)
+#define PAT_GET_DVI(value) (((value) >> 48) & 0xffUL)
+#define PAT_GET_IOC(value) (((value) >> 40) & 0xffUL)
+#define PAT_GET_MOD_PAGES(value)(((value) & 0xffffffUL)
-/* yes 'int', not 'long' -- IODC I/O is always 32-bit stuff */
-extern long real64_call(unsigned long function, ...);
-extern long real32_call(unsigned long function, ...);
-
-#if defined(__LP64__) && ! defined(CONFIG_PDC_NARROW)
-#define MEM_PDC (unsigned long)(PAGE0->mem_pdc_hi) << 32 | PAGE0->mem_pdc
-# define mem_pdc_call(args...) real64_call(MEM_PDC, args)
#else
-#define MEM_PDC (unsigned long)PAGE0->mem_pdc
-# define mem_pdc_call(args...) real32_call(MEM_PDC, args)
+/* No PAT support for 32-bit kernels...sorry */
+#define pdc_pat_get_irt_size(num_entries, cell_numn) PDC_RET_NE_PROC
+#define pdc_pat_get_irt(r_addr, cell_num) PDC_RET_NE_PROC
#endif
extern void pdc_init(void);
Index: include/asm-parisc/pdcpat.h
===================================================================
RCS file: /home/cvs/parisc/linux/include/asm-parisc/pdcpat.h,v
retrieving revision 1.7
diff -u -p -r1.7 pdcpat.h
--- pdcpat.h 2001/03/02 10:31:51 1.7
+++ pdcpat.h 2001/04/06 04:22:04
@@ -10,183 +10,6 @@
* Copyright 2000 (c) Grant Grundler <grundler@puffin.external.hp.com>
*/
-/* PDC PAT CELL */
-#define PDC_PAT_CELL 64L /* Interface for gaining and
- * manipulatin g cell state within PD */
-#define PDC_PAT_CELL_GET_NUMBER 0L /* Return Cell number */
-#define PDC_PAT_CELL_GET_INFO 1L /* Returns info about Cell */
-#define PDC_PAT_CELL_MODULE 2L /* Returns info about Module */
-#define PDC_PAT_CELL_SET_ATTENTION 9L /* Set Cell Attention indicator */
-#define PDC_PAT_CELL_NUMBER_TO_LOC 10L /* Cell Number -> Location */
-#define PDC_PAT_CELL_WALK_FABRIC 11L /* Walk the Fabric */
-#define PDC_PAT_CELL_GET_RDT_SIZE 12L /* Return Route Distance Table Sizes */
-#define PDC_PAT_CELL_GET_RDT 13L /* Return Route Distance Tables */
-#define PDC_PAT_CELL_GET_LOCAL_PDH_SZ 14L /* Read Local PDH Buffer Size */
-#define PDC_PAT_CELL_SET_LOCAL_PDH 15L /* Write Local PDH Buffer */
-#define PDC_PAT_CELL_GET_REMOTE_PDH_SZ 16L /* Return Remote PDH Buffer Size */
-#define PDC_PAT_CELL_GET_REMOTE_PDH 17L /* Read Remote PDH Buffer */
-#define PDC_PAT_CELL_GET_DBG_INFO 128L /* Return DBG Buffer Info */
-#define PDC_PAT_CELL_CHANGE_ALIAS 129L /* Change Non-Equivalent Alias Chacking */
-
-
-/*
-** Arg to PDC_PAT_CELL_MODULE memaddr[4]
-**
-** Addresses on the Merced Bus != all Runway Bus addresses.
-** This is intended for programming SBA/LBA chips range registers.
-*/
-#define IO_VIEW 0UL
-#define PA_VIEW 1UL
-
-/* PDC_PAT_CELL_MODULE entity type values */
-#define PAT_ENTITY_CA 0 /* central agent */
-#define PAT_ENTITY_PROC 1 /* processor */
-#define PAT_ENTITY_MEM 2 /* memory controller */
-#define PAT_ENTITY_SBA 3 /* system bus adapter */
-#define PAT_ENTITY_LBA 4 /* local bus adapter */
-#define PAT_ENTITY_PBC 5 /* processor bus converter */
-#define PAT_ENTITY_XBC 6 /* crossbar fabric connect */
-#define PAT_ENTITY_RC 7 /* fabric interconnect */
-
-/* PDC_PAT_CELL_MODULE address range type values */
-#define PAT_PBNUM 0 /* PCI Bus Number */
-#define PAT_LMMIO 1 /* < 4G MMIO Space */
-#define PAT_GMMIO 2 /* > 4G MMIO Space */
-#define PAT_NPIOP 3 /* Non Postable I/O Port Space */
-#define PAT_PIOP 4 /* Postable I/O Port Space */
-#define PAT_AHPA 5 /* Addional HPA Space */
-#define PAT_UFO 6 /* HPA Space (UFO for Mariposa) */
-#define PAT_GNIP 7 /* GNI Reserved Space */
-
-
-/* PDC PAT CHASSIS LOG */
-
-#define PDC_PAT_CHASSIS_LOG 65L /* Platform logging & forward
- ** progress functions */
-#define PDC_PAT_CHASSIS_WRITE_LOG 0L /* Write Log Entry */
-#define PDC_PAT_CHASSIS_READ_LOG 1L /* Read Log Entry */
-
-/* PDC PAT CPU */
-
-#define PDC_PAT_CPU 67L /* Interface to CPU configuration
- * within the protection domain */
-#define PDC_PAT_CPU_INFO 0L /* Return CPU config info */
-#define PDC_PAT_CPU_DELETE 1L /* Delete CPU */
-#define PDC_PAT_CPU_ADD 2L /* Add CPU */
-#define PDC_PAT_CPU_GET_NUMBER 3L /* Return CPU Number */
-#define PDC_PAT_CPU_GET_HPA 4L /* Return CPU HPA */
-#define PDC_PAT_CPU_STOP 5L /* Stop CPU */
-#define PDC_PAT_CPU_RENDEZVOUS 6L /* Rendezvous CPU */
-#define PDC_PAT_CPU_GET_CLOCK_INFO 7L /* Return CPU Clock info */
-#define PDC_PAT_CPU_GET_RENDEZVOUS_STATE 8L /* Return Rendezvous State */
-#define PDC_PAT_CPU_PLUNGE_FABRIC 128L /* Plunge Fabric */
-#define PDC_PAT_CPU_UPDATE_CACHE_CLEANSING 129L /* Manipulate Cache
- * Cleansing Mode */
-/* PDC PAT EVENT */
-
-#define PDC_PAT_EVENT 68L /* Interface to Platform Events */
-#define PDC_PAT_EVENT_GET_CAPS 0L /* Get Capabilities */
-#define PDC_PAT_EVENT_SET_MODE 1L /* Set Notification Mode */
-#define PDC_PAT_EVENT_SCAN 2L /* Scan Event */
-#define PDC_PAT_EVENT_HANDLE 3L /* Handle Event */
-#define PDC_PAT_EVENT_GET_NB_CALL 4L /* Get Non-Blocking call Args */
-
-/* PDC PAT HPMC */
-
-#define PDC_PAT_HPMC 70L /* Cause processor to go into spin
- ** loop, and wait for wake up from
- ** Monarch Processor */
-#define PDC_PAT_HPMC_RENDEZ_CPU 0L /* go into spin loop */
-#define PDC_PAT_HPMC_SET_PARAMS 1L /* Allows OS to specify intr which PDC
- * will use to interupt OS during machine
- * check rendezvous */
-
-/* parameters for PDC_PAT_HPMC_SET_PARAMS: */
-#define HPMC_SET_PARAMS_INTR 1L /* Rendezvous Interrupt */
-#define HPMC_SET_PARAMS_WAKE 2L /* Wake up processor */
-
-/* PDC PAT IO */
-
-#define PDC_PAT_IO 71L /* On-line services for I/O modules */
-#define PDC_PAT_IO_GET_SLOT_STATUS 5L /* Get Slot Status Info*/
-#define PDC_PAT_IO_GET_LOC_FROM_HARDWARE 6L /* Get Physical Location from */
- /* Hardware Path */
-#define PDC_PAT_IO_GET_HARDWARE_FROM_LOC 7L /* Get Hardware Path from
- * Physical Location */
-#define PDC_PAT_IO_GET_PCI_CONFIG_FROM_HW 11L /* Get PCI Configuration
- * Address from Hardware Path */
-#define PDC_PAT_IO_GET_HW_FROM_PCI_CONFIG 12L /* Get Hardware Path
- * from PCI Configuration Address */
-#define PDC_PAT_IO_READ_HOST_BRIDGE_INFO 13L /* Read Host Bridge State Info */
-#define PDC_PAT_IO_CLEAR_HOST_BRIDGE_INFO 14L /* Clear Host Bridge State Info*/
-#define PDC_PAT_IO_GET_PCI_ROUTING_TABLE_SIZE 15L /* Get PCI INT Routing Table
- * Size */
-#define PDC_PAT_IO_GET_PCI_ROUTING_TABLE 16L /* Get PCI INT Routing Table */
-#define PDC_PAT_IO_GET_HINT_TABLE_SIZE 17L /* Get Hint Table Size */
-#define PDC_PAT_IO_GET_HINT_TABLE 18L /* Get Hint Table */
-#define PDC_PAT_IO_PCI_CONFIG_READ 19L /* PCI Config Read */
-#define PDC_PAT_IO_PCI_CONFIG_WRITE 20L /* PCI Config Write */
-#define PDC_PAT_IO_GET_NUM_IO_SLOTS 21L /* Get Number of I/O Bay Slots in
- * Cabinet */
-#define PDC_PAT_IO_GET_LOC_IO_SLOTS 22L /* Get Physical Location of I/O */
- /* Bay Slots in Cabinet */
-#define PDC_PAT_IO_BAY_STATUS_INFO 28L /* Get I/O Bay Slot Status Info */
-#define PDC_PAT_IO_GET_PROC_VIEW 29L /* Get Processor view of IO address */
-#define PDC_PAT_IO_PROG_SBA_DIR_RANGE 30L /* Program directed range */
-
-/* PDC PAT MEM */
-
-#define PDC_PAT_MEM 72L /* Manage memory page deallocation */
-#define PDC_PAT_MEM_PD_INFO 0L /* Return PDT info for PD */
-#define PDC_PAT_MEM_PD_CLEAR 1L /* Clear PDT for PD */
-#define PDC_PAT_MEM_PD_READ 2L /* Read PDT entries for PD */
-#define PDC_PAT_MEM_PD_RESET 3L /* Reset clear bit for PD */
-#define PDC_PAT_MEM_CELL_INFO 5L /* Return PDT info For Cell */
-#define PDC_PAT_MEM_CELL_CLEAR 6L /* Clear PDT For Cell */
-#define PDC_PAT_MEM_CELL_READ 7L /* Read PDT entries For Cell */
-#define PDC_PAT_MEM_CELL_RESET 8L /* Reset clear bit For Cell */
-#define PDC_PAT_MEM_SETGM 9L /* Set Golden Memory value */
-#define PDC_PAT_MEM_ADD_PAGE 10L /* ADDs a page to the cell */
-#define PDC_PAT_MEM_ADDRESS 11L /* Get Physical Location From */
- /* Memory Address */
-#define PDC_PAT_MEM_GET_TXT_SIZE 12L /* Get Formatted Text Size */
-#define PDC_PAT_MEM_GET_PD_TXT 13L /* Get PD Formatted Text */
-#define PDC_PAT_MEM_GET_CELL_TXT 14L /* Get Cell Formatted Text */
-#define PDC_PAT_MEM_RD_STATE_INFO 15L /* Read Mem Module State Info*/
-#define PDC_PAT_MEM_CLR_STATE_INFO 16L /*Clear Mem Module State Info*/
-#define PDC_PAT_MEM_CLEAN_RANGE 128L /*Clean Mem in specific range*/
-#define PDC_PAT_MEM_GET_TBL_SIZE 131L /* Get Memory Table Size */
-#define PDC_PAT_MEM_GET_TBL 132L /* Get Memory Table */
-
-/* PDC PAT NVOLATILE */
-
-#define PDC_PAT_NVOLATILE 73L /* Access Non-Volatile Memory */
-#define PDC_PAT_NVOLATILE_READ 0L /* Read Non-Volatile Memory */
-#define PDC_PAT_NVOLATILE_WRITE 1L /* Write Non-Volatile Memory */
-#define PDC_PAT_NVOLATILE_GET_SIZE 2L /* Return size of NVM */
-#define PDC_PAT_NVOLATILE_VERIFY 3L /* Verify contents of NVM */
-#define PDC_PAT_NVOLATILE_INIT 4L /* Initialize NVM */
-
-/* PDC PAT PD */
-
-#define PDC_PAT_PD 74L /* Protection Domain Info */
-#define PDC_PAT_PD_GET_ADDR_MAP 0L /* Get Address Map */
-
-/* PDC_PAT_PD_GET_ADDR_MAP entry types */
-
-#define PAT_MEMORY_DESCRIPTOR 1
-
-/* PDC_PAT_PD_GET_ADDR_MAP memory types */
-
-#define PAT_MEMTYPE_MEMORY 0
-#define PAT_MEMTYPE_FIRMWARE 4
-
-/* PDC_PAT_PD_GET_ADDR_MAP memory usage */
-
-#define PAT_MEMUSE_GENERAL 0
-#define PAT_MEMUSE_GI 128
-#define PAT_MEMUSE_GNI 129
-
#ifndef __ASSEMBLY__
#include <linux/types.h>
@@ -210,82 +33,12 @@ struct pdc_pat_cell_info_rtn_block {
typedef struct pdc_pat_cell_info_rtn_block pdc_pat_cell_info_rtn_block_t;
-/* FIXME: mod[508] should really be a union of the various mod components */
-struct pdc_pat_cell_mod_maddr_block { /* PDC_PAT_CELL_MODULE */
- unsigned long cba; /* function 0 configuration space address */
- unsigned long mod_info; /* module information */
- unsigned long mod_location; /* physical location of the module */
- unsigned long mod_path; /* module path (device path - layers) */
- unsigned long mod[508]; /* PAT cell module components */
-} __attribute__((aligned(8))) ;
-
-typedef struct pdc_pat_cell_mod_maddr_block pdc_pat_cell_mod_maddr_block_t;
-
-struct pdc_pat_io_num {
- unsigned long num;
- unsigned long reserved[31];
-};
-
-
struct pdc_pat_pd_addr_map_rtn {
unsigned long actual_len; /* actual # bytes in address map */
unsigned long reserved[31];
} __attribute__((aligned(8))) ;
-struct pdc_pat_pd_addr_map_entry {
- unsigned char entry_type; /* 1 = Memory Descriptor Entry Type */
- unsigned char reserve1[5];
- unsigned char memory_type;
- unsigned char memory_usage;
- unsigned long paddr;
- unsigned int pages; /* Length in 4K pages */
- unsigned int reserve2;
- unsigned long cell_map;
-} __attribute__((aligned(8))) ;
-
-extern int pdc_pat_cell_get_number(void *);
-extern int pdc_pat_cell_module(void *, unsigned long, unsigned long, unsigned long, void *);
-extern int pdc_pat_cell_num_to_loc(void *, unsigned long);
-
-#ifdef __LP64__
-extern int pdc_pat_get_irt_size(void *r_addr, unsigned long cell_num);
-extern int pdc_pat_get_irt(void *r_addr, unsigned long cell_num);
-#else
-/* No PAT support for 32-bit kernels...sorry */
-#define pdc_pat_get_irt_size(r_addr, cell_numn) PDC_RET_NE_PROC
-#define pdc_pat_get_irt(r_addr, cell_num) PDC_RET_NE_PROC
-#endif
-
extern int pdc_pat_pd_get_addr_map(void *, void *, unsigned long, unsigned long);
-
-/********************************************************************
-* PDC_PAT_CELL[Return Cell Module] memaddr[0] conf_base_addr
-* ----------------------------------------------------------
-* Bit 0 to 51 - conf_base_addr
-* Bit 52 to 62 - reserved
-* Bit 63 - endianess bit
-********************************************************************/
-#define PAT_GET_CBA(value) ((value) & 0xfffffffffffff000UL)
-
-/********************************************************************
-* PDC_PAT_CELL[Return Cell Module] memaddr[1] mod_info
-* ----------------------------------------------------
-* Bit 0 to 7 - entity type
-* 0 = central agent, 1 = processor,
-* 2 = memory controller, 3 = system bus adapter,
-* 4 = local bus adapter, 5 = processor bus converter,
-* 6 = crossbar fabric connect, 7 = fabric interconnect,
-* 8 to 254 reserved, 255 = unknown.
-* Bit 8 to 15 - DVI
-* Bit 16 to 23 - IOC functions
-* Bit 24 to 39 - reserved
-* Bit 40 to 63 - mod_pages
-* number of 4K pages a module occupies starting at conf_base_addr
-********************************************************************/
-#define PAT_GET_ENTITY(value) (((value) >> 56) & 0xffUL)
-#define PAT_GET_DVI(value) (((value) >> 48) & 0xffUL)
-#define PAT_GET_IOC(value) (((value) >> 40) & 0xffUL)
-#define PAT_GET_MOD_PAGES(value)(((value) & 0xffffffUL)
#endif /* __ASSEMBLY__ */
Index: include/asm-parisc/processor.h
===================================================================
RCS file: /home/cvs/parisc/linux/include/asm-parisc/processor.h,v
retrieving revision 1.41
diff -u -p -r1.41 processor.h
--- processor.h 2001/03/02 08:28:56 1.41
+++ processor.h 2001/04/06 04:22:04
@@ -51,8 +51,8 @@ struct system_cpuinfo_parisc {
struct {
struct pdc_model model;
- struct pdc_model_cpuid /* ARGH */ versions;
- struct pdc_model_cpuid cpuid;
+ unsigned long versions;
+ unsigned long cpuid;
#if 0
struct pdc_model_caps caps;
#endif