Commit f5213b2c authored by Helge Deller's avatar Helge Deller

parisc: Make existing core files reuseable for bootloader

Signed-off-by: default avatarHelge Deller <deller@gmx.de>
parent 2f3c7b81
...@@ -116,11 +116,15 @@ extern int npmem_ranges; ...@@ -116,11 +116,15 @@ extern int npmem_ranges;
/* This governs the relationship between virtual and physical addresses. /* This governs the relationship between virtual and physical addresses.
* If you alter it, make sure to take care of our various fixed mapping * If you alter it, make sure to take care of our various fixed mapping
* segments in fixmap.h */ * segments in fixmap.h */
#if defined(BOOTLOADER)
#define __PAGE_OFFSET (0) /* bootloader uses physical addresses */
#else
#ifdef CONFIG_64BIT #ifdef CONFIG_64BIT
#define __PAGE_OFFSET (0x40000000) /* 1GB */ #define __PAGE_OFFSET (0x40000000) /* 1GB */
#else #else
#define __PAGE_OFFSET (0x10000000) /* 256MB */ #define __PAGE_OFFSET (0x10000000) /* 256MB */
#endif #endif
#endif /* BOOTLOADER */
#define PAGE_OFFSET ((unsigned long)__PAGE_OFFSET) #define PAGE_OFFSET ((unsigned long)__PAGE_OFFSET)
......
...@@ -5,6 +5,8 @@ ...@@ -5,6 +5,8 @@
#if !defined(__ASSEMBLY__) #if !defined(__ASSEMBLY__)
extern int parisc_narrow_firmware;
extern int pdc_type; extern int pdc_type;
extern unsigned long parisc_cell_num; /* cell number the CPU runs on (PAT) */ extern unsigned long parisc_cell_num; /* cell number the CPU runs on (PAT) */
extern unsigned long parisc_cell_loc; /* cell location of CPU (PAT) */ extern unsigned long parisc_cell_loc; /* cell location of CPU (PAT) */
......
...@@ -69,7 +69,15 @@ ...@@ -69,7 +69,15 @@
#include <asm/pdcpat.h> #include <asm/pdcpat.h>
#include <asm/processor.h> /* for boot_cpu_data */ #include <asm/processor.h> /* for boot_cpu_data */
#if defined(BOOTLOADER)
# undef spin_lock_irqsave
# define spin_lock_irqsave(a, b) { b = 1; }
# undef spin_unlock_irqrestore
# define spin_unlock_irqrestore(a, b)
#else
static DEFINE_SPINLOCK(pdc_lock); static DEFINE_SPINLOCK(pdc_lock);
#endif
extern unsigned long pdc_result[NUM_PDC_RESULT]; extern unsigned long pdc_result[NUM_PDC_RESULT];
extern unsigned long pdc_result2[NUM_PDC_RESULT]; extern unsigned long pdc_result2[NUM_PDC_RESULT];
...@@ -186,6 +194,8 @@ void set_firmware_width(void) ...@@ -186,6 +194,8 @@ void set_firmware_width(void)
} }
#endif /*CONFIG_64BIT*/ #endif /*CONFIG_64BIT*/
#if !defined(BOOTLOADER)
/** /**
* pdc_emergency_unlock - Unlock the linux pdc lock * pdc_emergency_unlock - Unlock the linux pdc lock
* *
...@@ -1149,6 +1159,8 @@ void pdc_io_reset_devices(void) ...@@ -1149,6 +1159,8 @@ void pdc_io_reset_devices(void)
spin_unlock_irqrestore(&pdc_lock, flags); spin_unlock_irqrestore(&pdc_lock, flags);
} }
#endif /* defined(BOOTLOADER) */
/* locked by pdc_console_lock */ /* locked by pdc_console_lock */
static int __attribute__((aligned(8))) iodc_retbuf[32]; static int __attribute__((aligned(8))) iodc_retbuf[32];
static char __attribute__((aligned(64))) iodc_dbuf[4096]; static char __attribute__((aligned(64))) iodc_dbuf[4096];
...@@ -1193,6 +1205,7 @@ int pdc_iodc_print(const unsigned char *str, unsigned count) ...@@ -1193,6 +1205,7 @@ int pdc_iodc_print(const unsigned char *str, unsigned count)
return i; return i;
} }
#if !defined(BOOTLOADER)
/** /**
* pdc_iodc_getc - Read a character (non-blocking) from the PDC console. * pdc_iodc_getc - Read a character (non-blocking) from the PDC console.
* *
...@@ -1555,6 +1568,7 @@ int pdc_pat_mem_get_dimm_phys_location( ...@@ -1555,6 +1568,7 @@ int pdc_pat_mem_get_dimm_phys_location(
return retval; return retval;
} }
#endif /* CONFIG_64BIT */ #endif /* CONFIG_64BIT */
#endif /* defined(BOOTLOADER) */
/***************** 32-bit real-mode calls ***********/ /***************** 32-bit real-mode calls ***********/
...@@ -1664,4 +1678,3 @@ long real64_call(unsigned long fn, ...) ...@@ -1664,4 +1678,3 @@ long real64_call(unsigned long fn, ...)
} }
#endif /* CONFIG_64BIT */ #endif /* CONFIG_64BIT */
...@@ -162,6 +162,7 @@ ENDPROC_CFI(restore_control_regs) ...@@ -162,6 +162,7 @@ ENDPROC_CFI(restore_control_regs)
.text .text
.align 128 .align 128
ENTRY_CFI(rfi_virt2real) ENTRY_CFI(rfi_virt2real)
#if !defined(BOOTLOADER)
/* switch to real mode... */ /* switch to real mode... */
rsm PSW_SM_I,%r0 rsm PSW_SM_I,%r0
load32 PA(rfi_v2r_1), %r1 load32 PA(rfi_v2r_1), %r1
...@@ -191,6 +192,7 @@ ENTRY_CFI(rfi_virt2real) ...@@ -191,6 +192,7 @@ ENTRY_CFI(rfi_virt2real)
nop nop
rfi_v2r_1: rfi_v2r_1:
tophys_r1 %r2 tophys_r1 %r2
#endif /* defined(BOOTLOADER) */
bv 0(%r2) bv 0(%r2)
nop nop
ENDPROC_CFI(rfi_virt2real) ENDPROC_CFI(rfi_virt2real)
...@@ -198,6 +200,7 @@ ENDPROC_CFI(rfi_virt2real) ...@@ -198,6 +200,7 @@ ENDPROC_CFI(rfi_virt2real)
.text .text
.align 128 .align 128
ENTRY_CFI(rfi_real2virt) ENTRY_CFI(rfi_real2virt)
#if !defined(BOOTLOADER)
rsm PSW_SM_I,%r0 rsm PSW_SM_I,%r0
load32 (rfi_r2v_1), %r1 load32 (rfi_r2v_1), %r1
nop nop
...@@ -226,6 +229,7 @@ ENTRY_CFI(rfi_real2virt) ...@@ -226,6 +229,7 @@ ENTRY_CFI(rfi_real2virt)
nop nop
rfi_r2v_1: rfi_r2v_1:
tovirt_r1 %r2 tovirt_r1 %r2
#endif /* defined(BOOTLOADER) */
bv 0(%r2) bv 0(%r2)
nop nop
ENDPROC_CFI(rfi_real2virt) ENDPROC_CFI(rfi_real2virt)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment