Commit 32e5dbb6 authored by Linus Torvalds's avatar Linus Torvalds

Merge bk://bk.arm.linux.org.uk

into home.transmeta.com:/home/torvalds/v2.5/linux
parents bdff23c1 97dd408f
......@@ -14,14 +14,12 @@ ifeq ($(CONFIG_CPU_26),y)
ZRELADDR = 0x02080000
PARAMS_PHYS = 0x0207c000
INITRD_PHYS = 0x02180000
INITRD_VIRT = 0x02180000
endif
ifeq ($(CONFIG_ARCH_RPC),y)
ZRELADDR = 0x10008000
PARAMS_PHYS = 0x10000100
INITRD_PHYS = 0x18000000
INITRD_VIRT = 0xc8000000
endif
ifeq ($(CONFIG_ARCH_CLPS7500),y)
......@@ -32,7 +30,6 @@ ifeq ($(CONFIG_ARCH_EBSA110),y)
ZRELADDR = 0x00008000
PARAMS_PHYS = 0x00000400
INITRD_PHYS = 0x00800000
INITRD_VIRT = 0xc0800000
endif
ifeq ($(CONFIG_ARCH_SHARK),y)
......@@ -44,14 +41,12 @@ ifeq ($(CONFIG_FOOTBRIDGE),y)
ZRELADDR = 0x00008000
PARAMS_PHYS = 0x00000100
INITRD_PHYS = 0x00800000
INITRD_VIRT = 0xc0800000
endif
ifeq ($(CONFIG_ARCH_INTEGRATOR),y)
ZRELADDR = 0x00008000
PARAMS_PHYS = 0x00000100
INITRD_PHYS = 0x00800000
INITRD_VIRT = 0xc0800000
endif
ifeq ($(CONFIG_ARCH_CAMELOT),y)
......@@ -75,11 +70,9 @@ endif
# Should probably have some agreement on these...
ifeq ($(CONFIG_ARCH_P720T),y)
INITRD_PHYS = 0xc0400000
INITRD_VIRT = 0xc0400000
endif
ifeq ($(CONFIG_ARCH_CDB89712),y)
INITRD_PHYS = 0x00700000
INITRD_VIRT = 0xc0300000
endif
ifeq ($(CONFIG_ARCH_SA1100),y)
......@@ -119,7 +112,7 @@ ZTEXTADDR =0
ZBSSADDR =ALIGN(4)
endif
export SYSTEM ZTEXTADDR ZBSSADDR ZRELADDR INITRD_PHYS INITRD_VIRT PARAMS_PHYS
export SYSTEM ZTEXTADDR ZBSSADDR ZRELADDR INITRD_PHYS PARAMS_PHYS
Image: $(CONFIGURE) $(SYSTEM)
$(OBJCOPY) -O binary -R .note -R .comment -S $(SYSTEM) $@
......@@ -139,7 +132,7 @@ bootp/bootp: zImage initrd
@$(MAKE) -C bootp bootp
initrd:
@test "$(INITRD_VIRT)" != "" || (echo This architecture does not support INITRD; exit -1)
@test "$(INITRD_PHYS)" != "" || (echo This architecture does not support INITRD; exit -1)
@test "$(INITRD)" != "" || (echo You must specify INITRD; exit -1)
install: $(CONFIGURE) Image
......
......@@ -5,7 +5,6 @@
ZSYSTEM =$(TOPDIR)/arch/arm/boot/zImage
ZLDFLAGS =-p -X -T bootp.lds \
--defsym initrd_addr=$(INITRD_PHYS) \
--defsym initrd_virt=$(INITRD_VIRT) \
--defsym params=$(PARAMS_PHYS) \
--defsym kernel_addr=$(ZTEXTADDR)
......
......@@ -102,8 +102,8 @@ data: .word initrd_start
.word kernel_len
.word 0x54410001 @ r4 = ATAG_CORE
.word 0x54410005 @ r5 = ATAG_INITRD
.word initrd_virt @ r6
.word 0x54420005 @ r5 = ATAG_INITRD
.word initrd_addr @ r6
.word initrd_len @ r7
.word params @ r8
......
......@@ -151,7 +151,7 @@ not_angel:
add r1, r1, r0 @ table. This fixes up the
str r1, [r6], #4 @ C references.
cmp r6, ip
blt 1b
blo 1b
not_relocated: mov r0, #0
1: str r0, [r2], #4 @ clear bss
......@@ -159,7 +159,7 @@ not_relocated: mov r0, #0
str r0, [r2], #4
str r0, [r2], #4
cmp r2, r3
blt 1b
blo 1b
mrc p15, 0, r6, c0, c0 @ get processor ID
bl cache_on
......@@ -206,7 +206,7 @@ not_relocated: mov r0, #0
ldmia r2!, {r8 - r13}
stmia r1!, {r8 - r13}
cmp r2, r3
blt 1b
blo 1b
bl cache_clean_flush
add pc, r5, r0 @ call relocation code
......@@ -270,9 +270,9 @@ __cache_on: sub r3, r4, #16384 @ Page directory size
orr r1, r1, #3 << 10
add r2, r3, #16384
1: cmp r1, r8 @ if virt > start of RAM
orrge r1, r1, #0x0c @ set cacheable, bufferable
orrhs r1, r1, #0x0c @ set cacheable, bufferable
cmp r1, r9 @ if virt > end of RAM
bicge r1, r1, #0x0c @ clear cacheable, bufferable
bichs r1, r1, #0x0c @ clear cacheable, bufferable
str r1, [r0], #4 @ 1:1 mapping
add r1, r1, #1048576
teq r0, r2
......@@ -330,7 +330,7 @@ reloc_start: add r8, r5, r0
.endr
cmp r5, r8
blt 1b
blo 1b
debug_reloc_end
call_kernel: bl cache_clean_flush
......@@ -396,6 +396,12 @@ proc_types:
b __armv4_cache_off
mov pc, lr
.word 0x41129200 @ ARM920T
.word 0xff00fff0
b __cache_on
b __armv4_cache_off
b __armv4_cache_flush
.word 0x4401a100 @ sa110 / sa1100
.word 0xffffffe0
b __cache_on
......
......@@ -464,20 +464,8 @@ bool 'Power Management support' CONFIG_PM
dep_bool 'Preemptible Kernel (experimental)' CONFIG_PREEMPT $CONFIG_CPU_32 $CONFIG_EXPERIMENTAL
dep_tristate 'Advanced Power Management Emulation' CONFIG_APM $CONFIG_PM
dep_tristate 'RISC OS personality' CONFIG_ARTHUR $CONFIG_CPU_32
string 'Default kernel command string' CONFIG_CMDLINE ""
if [ "$CONFIG_ARCH_EBSA110" = "y" -o \
"$CONFIG_ARCH_SA1100" = "y" -o \
"$CONFIG_ARCH_CLPS7500" = "y" -o \
"$CONFIG_ARCH_PERSONAL_SERVER" = "y" -o \
"$CONFIG_ARCH_CATS" = "y" -o \
"$CONFIG_ARCH_P720T" = "y" -o \
"$CONFIG_ARCH_CDB89712" = "y" -o \
"$CONFIG_ARCH_CAMELOT" = "y" -o \
"$CONFIG_ARCH_ANAKIN" = "y" -o \
"$CONFIG_ARCH_IOP310" = "y" -o \
"$CONFIG_ARCH_ADIFCC" = "y" ]; then
string 'Default kernel command string' CONFIG_CMDLINE ""
fi
if [ "$CONFIG_ARCH_NETWINDER" = "y" -o \
"$CONFIG_ARCH_EBSA110" = "y" -o \
"$CONFIG_ARCH_EBSA285" = "y" -o \
......
......@@ -849,7 +849,7 @@ CONFIG_USB_DEBUG=y
#
# CONFIG_USB_UHCI is not set
# CONFIG_USB_UHCI_ALT is not set
CONFIG_USB_OHCI=y
# CONFIG_USB_OHCI is not set
CONFIG_USB_OHCI_SA1111=y
#
......
......@@ -182,7 +182,6 @@ EXPORT_SYMBOL_NOVERS(strchr);
EXPORT_SYMBOL_NOVERS(strlen);
EXPORT_SYMBOL_NOVERS(strnlen);
EXPORT_SYMBOL_NOVERS(strpbrk);
EXPORT_SYMBOL_NOVERS(strsep);
EXPORT_SYMBOL_NOVERS(strrchr);
EXPORT_SYMBOL_NOVERS(strstr);
EXPORT_SYMBOL_NOVERS(memset);
......
......@@ -9,6 +9,11 @@
*
* We keep the old params compatibility cruft in one place (here)
* so we don't end up with lots of mess around other places.
*
* NOTE:
* The old struct param_struct is deprecated, but it will be kept in
* the kernel for 5 years from now (2001). This will allow boot loaders
* to convert to the new struct tag way.
*/
#include <linux/config.h>
#include <linux/types.h>
......@@ -22,6 +27,59 @@
#include <asm/mach/arch.h>
/*
* Usage:
* - do not go blindly adding fields, add them at the end
* - when adding fields, don't rely on the address until
* a patch from me has been released
* - unused fields should be zero (for future expansion)
* - this structure is relatively short-lived - only
* guaranteed to contain useful data in setup_arch()
*
* This is the old deprecated way to pass parameters to the kernel
*/
struct param_struct {
union {
struct {
unsigned long page_size; /* 0 */
unsigned long nr_pages; /* 4 */
unsigned long ramdisk_size; /* 8 */
unsigned long flags; /* 12 */
#define FLAG_READONLY 1
#define FLAG_RDLOAD 4
#define FLAG_RDPROMPT 8
unsigned long rootdev; /* 16 */
unsigned long video_num_cols; /* 20 */
unsigned long video_num_rows; /* 24 */
unsigned long video_x; /* 28 */
unsigned long video_y; /* 32 */
unsigned long memc_control_reg; /* 36 */
unsigned char sounddefault; /* 40 */
unsigned char adfsdrives; /* 41 */
unsigned char bytes_per_char_h; /* 42 */
unsigned char bytes_per_char_v; /* 43 */
unsigned long pages_in_bank[4]; /* 44 */
unsigned long pages_in_vram; /* 60 */
unsigned long initrd_start; /* 64 */
unsigned long initrd_size; /* 68 */
unsigned long rd_start; /* 72 */
unsigned long system_rev; /* 76 */
unsigned long system_serial_low; /* 80 */
unsigned long system_serial_high; /* 84 */
unsigned long mem_fclk_21285; /* 88 */
} s;
char unused[256];
} u1;
union {
char paths[8][128];
struct {
unsigned long magic;
char n[1024 - sizeof(unsigned long)];
} s;
} u2;
char commandline[COMMAND_LINE_SIZE];
};
static struct tag * __init memtag(struct tag *tag, unsigned long start, unsigned long size)
{
tag = tag_next(tag);
......@@ -33,7 +91,7 @@ static struct tag * __init memtag(struct tag *tag, unsigned long start, unsigned
return tag;
}
static void __init build_tag_list(struct param_struct *params, void *taglist, int mem_init)
static void __init build_tag_list(struct param_struct *params, void *taglist)
{
struct tag *tag = taglist;
......@@ -44,6 +102,22 @@ static void __init build_tag_list(struct param_struct *params, void *taglist, in
"trying to continue\n");
return;
}
#ifdef CONFIG_ARCH_NETWINDER
if (params->u1.s.nr_pages != 0x02000 &&
params->u1.s.nr_pages != 0x04000 &&
params->u1.s.nr_pages != 0x08000 &&
params->u1.s.nr_pages != 0x10000) {
printk(KERN_WARNING "Warning: bad NeTTrom parameters "
"detected, using defaults\n");
params->u1.s.nr_pages = 0x1000; /* 16MB */
params->u1.s.ramdisk_size = 0;
params->u1.s.flags = FLAG_READONLY;
params->u1.s.initrd_start = 0;
params->u1.s.initrd_size = 0;
params->u1.s.rd_start = 0;
}
#endif
tag->hdr.tag = ATAG_CORE;
tag->hdr.size = tag_size(tag_core);
......@@ -76,17 +150,15 @@ static void __init build_tag_list(struct param_struct *params, void *taglist, in
tag->hdr.size = tag_size(tag_revision);
tag->u.revision.rev = params->u1.s.system_rev;
if (mem_init) {
#ifdef CONFIG_ARCH_ACORN
if (machine_is_riscpc()) {
int i;
for (i = 0; i < 4; i++)
tag = memtag(tag, PHYS_OFFSET + (i << 26),
params->u1.s.pages_in_bank[i] * PAGE_SIZE);
} else
if (machine_is_riscpc()) {
int i;
for (i = 0; i < 4; i++)
tag = memtag(tag, PHYS_OFFSET + (i << 26),
params->u1.s.pages_in_bank[i] * PAGE_SIZE);
} else
#endif
tag = memtag(tag, PHYS_OFFSET, params->u1.s.nr_pages * PAGE_SIZE);
}
tag = memtag(tag, PHYS_OFFSET, params->u1.s.nr_pages * PAGE_SIZE);
#ifdef CONFIG_FOOTBRIDGE
if (params->u1.s.mem_fclk_21285) {
......@@ -97,6 +169,23 @@ static void __init build_tag_list(struct param_struct *params, void *taglist, in
}
#endif
#ifdef CONFIG_ARCH_EBSA285
if (machine_is_ebsa285()) {
tag = tag_next(tag);
tag->hdr.tag = ATAG_VIDEOTEXT;
tag->hdr.size = tag_size(tag_videotext);
tag->u.videotext.x = params->u1.s.video_x;
tag->u.videotext.y = params->u1.s.video_y;
tag->u.videotext.video_page = 0;
tag->u.videotext.video_mode = 0;
tag->u.videotext.video_cols = params->u1.s.video_num_cols;
tag->u.videotext.video_ega_bx = 0;
tag->u.videotext.video_lines = params->u1.s.video_num_rows;
tag->u.videotext.video_isvga = 1;
tag->u.videotext.video_points = 8;
}
#endif
#ifdef CONFIG_ARCH_ACORN
tag = tag_next(tag);
tag->hdr.tag = ATAG_ACORN;
......@@ -114,14 +203,22 @@ static void __init build_tag_list(struct param_struct *params, void *taglist, in
strcpy(tag->u.cmdline.cmdline, params->commandline);
tag = tag_next(tag);
tag->hdr.tag = 0;
tag->hdr.tag = ATAG_NONE;
tag->hdr.size = 0;
memmove(params, taglist, ((int)tag) - ((int)taglist) +
sizeof(struct tag_header));
}
void __init convert_to_tag_list(struct param_struct *params, int mem_init)
void __init convert_to_tag_list(struct tag *tags)
{
struct param_struct *params = (struct param_struct *)tags;
build_tag_list(params, &params->u2);
}
void __init squash_mem_tags(struct tag *tag)
{
build_tag_list(params, &params->u2, mem_init);
for (; tag->hdr.size; tag = tag_next(tag))
if (tag->hdr.tag == ATAG_MEM)
tag->hdr.tag = ATAG_NONE;
}
......@@ -799,8 +799,7 @@ __und_svc: sub sp, sp, #S_FRAME_SIZE
adrsvc al, r9, 1f @ r9 = normal FP return
bl call_fpe @ lr = undefined instr return
mov r0, r5 @ unsigned long pc
mov r1, sp @ struct pt_regs *regs
mov r0, sp @ struct pt_regs *regs
bl do_undefinstr
1: set_cpsr_c r0, #PSR_I_BIT | MODE_SVC
......@@ -926,8 +925,7 @@ call_fpe: get_thread_info r10 @ get current thread
ldr pc, [r4] @ Call FP module USR entry point
fpundefinstr: set_cpsr_c r0, #MODE_SVC @ Enable interrupts
mov r0, lr
mov r1, sp
mov r0, sp
adrsvc al, lr, ret_from_exception
b do_undefinstr
......
......@@ -45,7 +45,7 @@ static inline struct pt_regs *
get_user_regs(struct task_struct *task)
{
return (struct pt_regs *)
((unsigned long)task + 8192 - sizeof(struct pt_regs));
((unsigned long)task->thread_info + 8192 - sizeof(struct pt_regs));
}
/*
......
......@@ -35,10 +35,6 @@
#define MEM_SIZE (16*1024*1024)
#endif
#ifndef CONFIG_CMDLINE
#define CONFIG_CMDLINE ""
#endif
#ifdef CONFIG_PREEMPT
spinlock_t kernel_flag __cacheline_aligned_in_smp = SPIN_LOCK_UNLOCKED;
#endif
......@@ -57,7 +53,8 @@ __setup("fpe=", fpe_setup);
extern unsigned int mem_fclk_21285;
extern void paging_init(struct meminfo *, struct machine_desc *desc);
extern void convert_to_tag_list(struct param_struct *params, int mem_init);
extern void convert_to_tag_list(struct tag *tags);
extern void squash_mem_tags(struct tag *tag);
extern void bootmem_init(struct meminfo *);
extern void reboot_setup(char *str);
extern int root_mountflags;
......@@ -517,6 +514,20 @@ static int __init parse_tag_initrd(const struct tag *tag)
__tagtable(ATAG_INITRD, parse_tag_initrd);
static int __init parse_tag_initrd2(const struct tag *tag)
{
unsigned long start = 0;
if (tag->u.initrd.size) {
start = (unsigned long)phys_to_virt(tag->u.initrd.start);
setup_initrd(start, tag->u.initrd.size);
}
return 0;
}
__tagtable(ATAG_INITRD2, parse_tag_initrd2);
static int __init parse_tag_serialnr(const struct tag *tag)
{
system_serial_low = tag->u.serialnr.low;
......@@ -575,14 +586,29 @@ static void __init parse_tags(const struct tag *t)
t->hdr.tag);
}
/*
* This holds our defaults.
*/
static struct init_tags {
struct tag_header hdr1;
struct tag_core core;
struct tag_header hdr2;
struct tag_mem32 mem;
struct tag_header hdr3;
} init_tags __initdata = {
{ tag_size(tag_core), ATAG_CORE },
{ 1, PAGE_SIZE, 0xff },
{ tag_size(tag_mem32), ATAG_MEM },
{ MEM_SIZE, PHYS_OFFSET },
{ 0, ATAG_NONE }
};
void __init setup_arch(char **cmdline_p)
{
struct tag *tags = NULL;
struct tag *tags = (struct tag *)&init_tags;
struct machine_desc *mdesc;
char *from = default_command_line;
ROOT_DEV = mk_kdev(0, 255);
setup_processor();
mdesc = setup_machine(machine_arch_type);
machine_name = mdesc->name;
......@@ -593,29 +619,22 @@ void __init setup_arch(char **cmdline_p)
if (mdesc->param_offset)
tags = phys_to_virt(mdesc->param_offset);
/*
* Do the machine-specific fixups before we parse the
* parameters or tags.
*/
if (mdesc->fixup)
mdesc->fixup(mdesc, (struct param_struct *)tags,
&from, &meminfo);
/*
* If we have the old style parameters, convert them to
* a tag list before.
* a tag list.
*/
if (tags && tags->hdr.tag != ATAG_CORE)
convert_to_tag_list((struct param_struct *)tags,
meminfo.nr_banks == 0);
if (tags->hdr.tag != ATAG_CORE)
convert_to_tag_list(tags);
if (tags->hdr.tag != ATAG_CORE)
tags = (struct tag *)&init_tags;
if (tags && tags->hdr.tag == ATAG_CORE)
parse_tags(tags);
if (mdesc->fixup)
mdesc->fixup(mdesc, tags, &from, &meminfo);
if (meminfo.nr_banks == 0) {
meminfo.nr_banks = 1;
meminfo.bank[0].start = PHYS_OFFSET;
meminfo.bank[0].size = MEM_SIZE;
if (tags->hdr.tag == ATAG_CORE) {
if (meminfo.nr_banks != 0)
squash_mem_tags(tags);
parse_tags(tags);
}
init_mm.start_code = (unsigned long) &_text;
......
......@@ -116,7 +116,7 @@ static void dump_instr(struct pt_regs *regs)
static void dump_stack(struct task_struct *tsk, unsigned long sp)
{
dump_mem("Stack: ", sp - 16, 8192+(unsigned long)tsk->thread_info);
dump_mem("Stack: ", sp, 8192+(unsigned long)tsk->thread_info);
}
static void dump_backtrace(struct pt_regs *regs, struct task_struct *tsk)
......@@ -132,7 +132,7 @@ static void dump_backtrace(struct pt_regs *regs, struct task_struct *tsk)
} else if (verify_stack(fp)) {
printk("invalid frame pointer 0x%08x", fp);
ok = 0;
} else if (fp < 4096+(unsigned long)tsk->thread_info)
} else if (fp < (unsigned long)(tsk->thread_info + 1))
printk("frame pointer underflow");
printk("\n");
......@@ -167,8 +167,8 @@ NORET_TYPE void die(const char *str, struct pt_regs *regs, int err)
printk("Internal error: %s: %x\n", str, err);
printk("CPU: %d\n", smp_processor_id());
show_regs(regs);
printk("Process %s (pid: %d, stackpage=%08lx)\n",
current->comm, current->pid, 4096+(unsigned long)tsk);
printk("Process %s (pid: %d, stack limit = 0x%p)\n",
current->comm, current->pid, tsk->thread_info + 1);
if (!user_mode(regs) || in_interrupt()) {
mm_segment_t fs;
......@@ -201,7 +201,7 @@ void die_if_kernel(const char *str, struct pt_regs *regs, int err)
die(str, regs, err);
}
asmlinkage void do_undefinstr(int address, struct pt_regs *regs, int mode)
asmlinkage void do_undefinstr(struct pt_regs *regs)
{
unsigned long *pc;
siginfo_t info;
......@@ -229,7 +229,7 @@ asmlinkage void do_undefinstr(int address, struct pt_regs *regs, int mode)
force_sig_info(SIGILL, &info, current);
die_if_kernel("Oops - undefined instruction", regs, mode);
die_if_kernel("Oops - undefined instruction", regs, 0);
}
#ifdef CONFIG_CPU_26
......
......@@ -137,19 +137,19 @@ FN_ENTRY
4: ands len, len, #3
beq .done
load1l r5
load1l r4
tst len, #2
mov r4, r5, lsr #byte(0)
mov r5, r4, lsr #byte(0)
beq .exit
adcs sum, sum, r5, push #16
strb r4, [dst], #1
mov r4, r5, lsr #byte(1)
strb r4, [dst], #1
mov r4, r5, lsr #byte(2)
adcs sum, sum, r4, push #16
strb r5, [dst], #1
mov r5, r4, lsr #byte(1)
strb r5, [dst], #1
mov r5, r4, lsr #byte(2)
.exit: tst len, #1
strneb r4, [dst], #1
andne r4, r4, #255
adcnes sum, sum, r4, lsl #byte(0)
strneb r5, [dst], #1
andne r5, r5, #255
adcnes sum, sum, r5, lsl #byte(0)
/*
* If the dst pointer was not 16-bit aligned, we
......@@ -210,17 +210,17 @@ FN_ENTRY
orr r4, r4, r5, push #24
str r4, [dst], #4
adcs sum, sum, r4
mov r4, r5, pull #8
4: ands len, len, #3
beq .done
mov r4, r5, lsr #byte(1)
mov r5, r4, lsr #byte(0)
tst len, #2
beq .exit
bic r5, r5, #0xff << byte(0)
adcs sum, sum, r5, push #8
strb r4, [dst], #1
mov r4, r5, lsr #byte(2)
strb r4, [dst], #1
mov r4, r5, lsr #byte(3)
adcs sum, sum, r4, push #16
strb r5, [dst], #1
mov r5, r4, lsr #byte(1)
strb r5, [dst], #1
mov r5, r4, lsr #byte(2)
b .exit
.src2_aligned: mov r4, r5, pull #16
......@@ -262,18 +262,19 @@ FN_ENTRY
orr r4, r4, r5, push #16
str r4, [dst], #4
adcs sum, sum, r4
mov r4, r5, pull #16
4: ands len, len, #3
beq .done
mov r4, r5, lsr #byte(2)
mov r5, r4, lsr #byte(0)
tst len, #2
beq .exit
adcs sum, sum, r5, pull #16
strb r4, [dst], #1
mov r4, r5, lsr #byte(3)
strb r4, [dst], #1
adcs sum, sum, r4
strb r5, [dst], #1
mov r5, r4, lsr #byte(1)
strb r5, [dst], #1
tst len, #1
beq .done
load1b r4
load1b r5
b .exit
.src3_aligned: mov r4, r5, pull #24
......@@ -315,16 +316,17 @@ FN_ENTRY
orr r4, r4, r5, push #8
str r4, [dst], #4
adcs sum, sum, r4
mov r4, r5, pull #24
4: ands len, len, #3
beq .done
mov r4, r5, lsr #byte(3)
mov r5, r4, lsr #byte(0)
tst len, #2
beq .exit
adcs sum, sum, r5, pull #24
strb r4, [dst], #1
load1l r5
mov r4, r5, lsr #byte(0)
strb r4, [dst], #1
strb r5, [dst], #1
adcs sum, sum, r4
load1l r4
mov r5, r4, lsr #byte(0)
strb r5, [dst], #1
adcs sum, sum, r4, push #24
mov r4, r5, lsr #byte(1)
mov r5, r4, lsr #byte(1)
b .exit
......@@ -22,7 +22,7 @@ extern void adifcc_map_io(void);
extern void adifcc_init_irq(void);
static void __init
fixup_adifcc(struct machine_desc *desc, struct param_struct *params,
fixup_adifcc(struct machine_desc *desc, struct tag *tags,
char **cmdline, struct meminfo *mi)
{
#ifdef CONFIG_ARCH_ADI_EVB
......
......@@ -27,7 +27,7 @@ extern void anakin_map_io(void);
extern void genarch_init_irq(void);
static void __init
fixup_anakin(struct machine_desc *desc, struct param_struct *unused,
fixup_anakin(struct machine_desc *desc, struct tag *tag,
char **cmdline, struct meminfo *mi)
{
ROOT_DEV = mk_kdev(RAMDISK_MAJOR, 0);
......
......@@ -45,7 +45,7 @@ static struct map_desc cdb89712_io_desc[] __initdata = {
};
static void __init
fixup_cdb89712(struct machine_desc *desc, struct param_struct *params,
fixup_cdb89712(struct machine_desc *desc, struct tag *tags,
char **cmdline, struct meminfo *mi)
{
}
......
......@@ -27,7 +27,7 @@ extern void clps711x_init_irq(void);
extern void clps711x_map_io(void);
static void __init
fixup_clep7312(struct machine_desc *desc, struct param_struct *params,
fixup_clep7312(struct machine_desc *desc, struct tag *tags,
char **cmdline, struct meminfo *mi)
{
mi->nr_banks=1;
......
......@@ -29,7 +29,7 @@ extern void clps711x_init_irq(void);
extern void edb7211_map_io(void);
static void __init
fixup_edb7211(struct machine_desc *desc, struct param_struct *params,
fixup_edb7211(struct machine_desc *desc, struct tag *tags,
char **cmdline, struct meminfo *mi)
{
/*
......
......@@ -53,7 +53,7 @@ typedef struct tag_IMAGE_PARAMS
#define IMAGE_PARAMS_PHYS 0xC01F0000
static void __init
fortunet_fixup(struct machine_desc *desc, struct param_struct *params,
fortunet_fixup(struct machine_desc *desc, struct tag *tags,
char **cmdline, struct meminfo *mi)
{
IMAGE_PARAMS *ip;
......
......@@ -49,11 +49,9 @@ static struct map_desc p720t_io_desc[] __initdata = {
};
static void __init
fixup_p720t(struct machine_desc *desc, struct param_struct *params,
fixup_p720t(struct machine_desc *desc, struct tag *tag,
char **cmdline, struct meminfo *mi)
{
struct tag *tag = (struct tag *)params;
/*
* Our bootloader doesn't setup any tags (yet).
*/
......
......@@ -35,7 +35,7 @@ extern void epxa10db_init_irq(void);
static void __init
epxa10db_fixup(struct machine_desc *desc, struct param_struct *params,
epxa10db_fixup(struct machine_desc *desc, struct tag *tags,
char **cmdline, struct meminfo *mi)
{
......
......@@ -36,25 +36,11 @@ static int __init parse_tag_memclk(const struct tag *tag)
__tagtable(ATAG_MEMCLK, parse_tag_memclk);
#ifdef CONFIG_ARCH_EBSA285
static void __init
fixup_ebsa285(struct machine_desc *desc, struct param_struct *params,
char **cmdline, struct meminfo *mi)
{
#if defined(CONFIG_VGA_CONSOLE) || defined(CONFIG_DUMMY_CONSOLE)
ORIG_X = params->u1.s.video_x;
ORIG_Y = params->u1.s.video_y;
ORIG_VIDEO_COLS = params->u1.s.video_num_cols;
ORIG_VIDEO_LINES = params->u1.s.video_num_rows;
#endif
}
MACHINE_START(EBSA285, "EBSA285")
MAINTAINER("Russell King")
BOOT_MEM(0x00000000, DC21285_ARMCSR_BASE, 0xfe000000)
BOOT_PARAMS(0x00000100)
VIDEO(0x000a0000, 0x000bffff)
FIXUP(fixup_ebsa285)
MAPIO(footbridge_map_io)
INITIRQ(footbridge_init_irq)
MACHINE_END
......@@ -67,7 +53,7 @@ MACHINE_END
* the parameter page.
*/
static void __init
fixup_netwinder(struct machine_desc *desc, struct param_struct *params,
fixup_netwinder(struct machine_desc *desc, struct tag *tags,
char **cmdline, struct meminfo *mi)
{
#ifdef CONFIG_ISAPNP
......@@ -80,21 +66,6 @@ fixup_netwinder(struct machine_desc *desc, struct param_struct *params,
*/
isapnp_disable = 1;
#endif
if (params->u1.s.nr_pages != 0x02000 &&
params->u1.s.nr_pages != 0x04000 &&
params->u1.s.nr_pages != 0x08000 &&
params->u1.s.nr_pages != 0x10000) {
printk(KERN_WARNING "Warning: bad NeTTrom parameters "
"detected, using defaults\n");
params->u1.s.nr_pages = 0x1000; /* 16MB */
params->u1.s.ramdisk_size = 0;
params->u1.s.flags = FLAG_READONLY;
params->u1.s.initrd_start = 0;
params->u1.s.initrd_size = 0;
params->u1.s.rd_start = 0;
}
}
MACHINE_START(NETWINDER, "Rebel-NetWinder")
......@@ -116,7 +87,7 @@ MACHINE_END
* hard reboots fail on early boards.
*/
static void __init
fixup_cats(struct machine_desc *desc, struct param_struct *unused,
fixup_cats(struct machine_desc *desc, struct tag *tags,
char **cmdline, struct meminfo *mi)
{
ORIG_VIDEO_LINES = 25;
......@@ -138,7 +109,7 @@ MACHINE_END
#ifdef CONFIG_ARCH_CO285
static void __init
fixup_coebsa285(struct machine_desc *desc, struct param_struct *unused,
fixup_coebsa285(struct machine_desc *desc, struct tag *tags,
char **cmdline, struct meminfo *mi)
{
extern unsigned long boot_memory_end;
......
......@@ -51,7 +51,7 @@ static struct kmi_info integrator_mouse __initdata = {
#endif
static void __init
integrator_fixup(struct machine_desc *desc, struct param_struct *unused,
integrator_fixup(struct machine_desc *desc, struct tag *tags,
char **cmdline, struct meminfo *mi)
{
#ifdef CONFIG_KMI_KEYB
......
......@@ -33,10 +33,10 @@
/*
* Logical Physical
* e8000000 40000000 PCI memory
* ec000000 62000000 PCI config space
* ed000000 61000000 PCI V3 regs
* ee000000 60000000 PCI IO
* e8000000 40000000 PCI memory PHYS_PCI_MEM_BASE (max 512M)
* ec000000 61000000 PCI config space PHYS_PCI_CONFIG_BASE (max 16M)
* ed000000 62000000 PCI V3 regs PHYS_PCI_V3_BASE (max 64k)
* ee000000 60000000 PCI IO PHYS_PCI_IO_BASE (max 16M)
* ef000000 Cache flush
* f1000000 10000000 Core module registers
* f1100000 11000000 System controller registers
......@@ -67,7 +67,7 @@ static struct map_desc integrator_io_desc[] __initdata = {
{ IO_ADDRESS(INTEGRATOR_GPIO_BASE), INTEGRATOR_GPIO_BASE, SZ_4K , DOMAIN_IO, 0, 1},
{ PCI_MEMORY_VADDR, PHYS_PCI_MEM_BASE, SZ_16M , DOMAIN_IO, 0, 1},
{ PCI_CONFIG_VADDR, PHYS_PCI_CONFIG_BASE, SZ_16M , DOMAIN_IO, 0, 1},
{ PCI_V3_VADDR, PHYS_PCI_V3_BASE, SZ_512K , DOMAIN_IO, 0, 1},
{ PCI_V3_VADDR, PHYS_PCI_V3_BASE, SZ_64K , DOMAIN_IO, 0, 1},
{ PCI_IO_VADDR, PHYS_PCI_IO_BASE, SZ_64K , DOMAIN_IO, 0, 1},
LAST_DESC
};
......
......@@ -50,7 +50,7 @@
* 40000000 - 4FFFFFFF PCI memory. 256M non-prefetchable
* 50000000 - 5FFFFFFF PCI memory. 256M prefetchable
* 60000000 - 60FFFFFF PCI IO. 16M
* 68000000 - 68FFFFFF PCI Configuration. 16M
* 61000000 - 61FFFFFF PCI Configuration. 16M
*
* There are three V3 windows, each described by a pair of V3 registers.
* These are LB_BASE0/LB_MAP0, LB_BASE1/LB_MAP1 and LB_BASE2/LB_MAP2.
......@@ -58,14 +58,6 @@
* can be used either for PCI I/O or for I20 accesses. By default, uHAL
* uses this only for PCI IO space.
*
* PCI Memory is mapped so that assigned addresses in PCI Memory match
* local bus memory addresses. In other words, if a PCI device is assigned
* address 80200000 then that address is a valid local bus address as well
* as a valid PCI Memory address. PCI IO addresses are mapped to start
* at zero. This means that local bus address 60000000 maps to PCI IO address
* 00000000 and so on. Device driver writers need to be aware of this
* distinction.
*
* Normally these spaces are mapped using the following base registers:
*
* Usage Local Bus Memory Base/Map registers used
......@@ -73,7 +65,7 @@
* Mem 40000000 - 4FFFFFFF LB_BASE0/LB_MAP0
* Mem 50000000 - 5FFFFFFF LB_BASE1/LB_MAP1
* IO 60000000 - 60FFFFFF LB_BASE2/LB_MAP2
* Cfg 68000000 - 68FFFFFF
* Cfg 61000000 - 61FFFFFF
*
* This means that I20 and PCI configuration space accesses will fail.
* When PCI configuration accesses are needed (via the uHAL PCI
......@@ -84,7 +76,7 @@
* Mem 40000000 - 4FFFFFFF LB_BASE0/LB_MAP0
* Mem 50000000 - 5FFFFFFF LB_BASE0/LB_MAP0
* IO 60000000 - 60FFFFFF LB_BASE2/LB_MAP2
* Cfg 68000000 - 68FFFFFF LB_BASE1/LB_MAP1
* Cfg 61000000 - 61FFFFFF LB_BASE1/LB_MAP1
*
* To make this work, the code depends on overlapping windows working.
* The V3 chip translates an address by checking its range within
......@@ -174,10 +166,10 @@
static spinlock_t v3_lock = SPIN_LOCK_UNLOCKED;
#define PCI_BUS_NONMEM_START 0x00000000
#define PCI_BUS_NONMEM_SIZE 0x10000000
#define PCI_BUS_NONMEM_SIZE SZ_256M
#define PCI_BUS_PREMEM_START 0x10000000
#define PCI_BUS_PREMEM_SIZE 0x10000000
#define PCI_BUS_PREMEM_START PCI_BUS_NONMEM_START + PCI_BUS_NONMEM_SIZE
#define PCI_BUS_PREMEM_SIZE SZ_256M
#if PCI_BUS_NONMEM_START & 0x000fffff
#error PCI_BUS_NONMEM_START must be megabyte aligned
......@@ -400,15 +392,15 @@ static struct pci_ops pci_v3_ops = {
static struct resource non_mem = {
name: "PCI non-prefetchable",
start: 0x40000000 + PCI_BUS_NONMEM_START,
end: 0x40000000 + PCI_BUS_NONMEM_START + PCI_BUS_NONMEM_SIZE - 1,
start: PHYS_PCI_MEM_BASE + PCI_BUS_NONMEM_START,
end: PHYS_PCI_MEM_BASE + PCI_BUS_NONMEM_START + PCI_BUS_NONMEM_SIZE - 1,
flags: IORESOURCE_MEM,
};
static struct resource pre_mem = {
name: "PCI prefetchable",
start: 0x40000000 + PCI_BUS_PREMEM_START,
end: 0x40000000 + PCI_BUS_PREMEM_START + PCI_BUS_PREMEM_SIZE - 1,
start: PHYS_PCI_MEM_BASE + PCI_BUS_PREMEM_START,
end: PHYS_PCI_MEM_BASE + PCI_BUS_PREMEM_START + PCI_BUS_PREMEM_SIZE - 1,
flags: IORESOURCE_MEM | IORESOURCE_PREFETCH,
};
......@@ -433,7 +425,7 @@ static int __init pci_v3_setup_resources(struct resource **resource)
*/
resource[0] = &ioport_resource;
resource[1] = &non_mem;
resource[2] = &pre_mem;
// resource[2] = &pre_mem;
return 1;
}
......@@ -530,7 +522,7 @@ int __init pci_v3_setup(int nr, struct pci_sys_data *sys)
int ret = 0;
if (nr == 0) {
sys->mem_offset = 0x40000000;
sys->mem_offset = PHYS_PCI_MEM_BASE;
ret = pci_v3_setup_resources(sys->resource);
}
......
......@@ -26,7 +26,7 @@ extern void iq80310_map_io(void);
extern void iq80310_init_irq(void);
static void __init
fixup_iq80310(struct machine_desc *desc, struct param_struct *params,
fixup_iq80310(struct machine_desc *desc, struct tag *tags,
char **cmdline, struct meminfo *mi)
{
system_rev = (*(volatile unsigned int*)0xfe830000) & 0x0f;
......
......@@ -83,7 +83,7 @@ static void __init l7200_map_io(void)
}
static void __init
fixup_l7200(struct machine_desc *desc, struct param_struct *unused,
fixup_l7200(struct machine_desc *desc, struct tag *tags,
char **cmdline, struct meminfo *mi)
{
mi->nr_banks = 1;
......
......@@ -69,7 +69,7 @@ static void __init idp_init_irq(void)
}
static void __init
fixup_idp(struct machine_desc *desc, struct param_struct *params,
fixup_idp(struct machine_desc *desc, struct tag *tags,
char **cmdline, struct meminfo *mi)
{
#ifdef PXA_IDP_REV02
......
......@@ -120,7 +120,7 @@ static int __init lubbock_init(void)
__initcall(lubbock_init);
static void __init
fixup_lubbock(struct machine_desc *desc, struct param_struct *params,
fixup_lubbock(struct machine_desc *desc, struct tag *tags,
char **cmdline, struct meminfo *mi)
{
SET_BANK (0, 0xa0000000, 64*1024*1024);
......
......@@ -61,7 +61,7 @@ __tagtable(ATAG_ACORN, parse_tag_acorn);
#endif
static void __init
fixup_riscpc(struct machine_desc *desc, struct param_struct *unusd,
fixup_riscpc(struct machine_desc *desc, struct tag *tags,
char **cmdline, struct meminfo *mi)
{
/*
......
......@@ -82,7 +82,7 @@ static void __init adsbitsy_init_irq(void)
*/
static void __init
fixup_adsbitsy(struct machine_desc *desc, struct param_struct *params,
fixup_adsbitsy(struct machine_desc *desc, struct tag *tags,
char **cmdline, struct meminfo *mi)
{
SET_BANK( 0, 0xc0000000, 32*1024*1024 );
......
......@@ -103,7 +103,6 @@ static int __init assabet_init(void)
* or BCR_clear().
*/
ASSABET_BCR = BCR_value = ASSABET_BCR_DB1111;
NCR_0 = 0;
#ifndef CONFIG_ASSABET_NEPONSET
printk( "Warning: Neponset detected but full support "
......@@ -159,13 +158,11 @@ static void __init get_assabet_scr(void)
SCR_value = scr;
}
extern void convert_to_tag_list(struct param_struct *params, int mem_init);
static void __init
fixup_assabet(struct machine_desc *desc, struct param_struct *params,
fixup_assabet(struct machine_desc *desc, struct tag *tags,
char **cmdline, struct meminfo *mi)
{
struct tag *t = (struct tag *)params;
struct tag *t = tags;
/* This must be done before any call to machine_has_neponset() */
map_sa1100_gpio_regs();
......@@ -174,12 +171,6 @@ fixup_assabet(struct machine_desc *desc, struct param_struct *params,
if (machine_has_neponset())
printk("Neponset expansion board detected\n");
/*
* Apparantly bootldr uses a param_struct. Groan.
*/
if (t->hdr.tag != ATAG_CORE)
convert_to_tag_list(params, 1);
if (t->hdr.tag != ATAG_CORE) {
t->hdr.tag = ATAG_CORE;
t->hdr.size = tag_size(tag_core);
......@@ -319,17 +310,16 @@ static void __init assabet_map_io(void)
sa1100_map_io();
iotable_init(assabet_io_desc);
if (machine_has_neponset()) {
#ifdef CONFIG_ASSABET_NEPONSET
/*
* We map Neponset registers even if it isn't present since
* many drivers will try to probe their stuff (and fail).
* This is still more friendly than a kernel paging request
* crash.
*/
neponset_map_io();
/*
* We map Neponset registers even if it isn't present since
* many drivers will try to probe their stuff (and fail).
* This is still more friendly than a kernel paging request
* crash.
*/
neponset_map_io();
#endif
if (machine_has_neponset()) {
/*
* When Neponset is attached, the first UART should be
* UART3. That's what Angel is doing and many documents
......
......@@ -143,13 +143,6 @@ void badge4_set_5V(unsigned subsystem, int on)
EXPORT_SYMBOL(badge4_set_5V);
static void __init
fixup_badge4(struct machine_desc *desc, struct param_struct *params,
char **cmdline, struct meminfo *mi)
{
/* nothing needed here */
}
static struct map_desc badge4_io_desc[] __initdata = {
/* virtual physical length domain r w c b */
{0xf1000000, 0x08000000, 0x00100000, DOMAIN_IO, 0,1,0,0},/* SRAM bank 1 */
......@@ -170,7 +163,6 @@ static void __init badge4_map_io(void)
MACHINE_START(BADGE4, "Hewlett-Packard Laboratories BadgePAD 4")
BOOT_MEM(0xc0000000, 0x80000000, 0xf8000000)
BOOT_PARAMS(0xc0000100)
FIXUP(fixup_badge4)
MAPIO(badge4_map_io)
INITIRQ(sa1100_init_irq)
MACHINE_END
......@@ -23,7 +23,7 @@
static void __init
fixup_brutus(struct machine_desc *desc, struct param_struct *params,
fixup_brutus(struct machine_desc *desc, struct tag *tags,
char **cmdline, struct meminfo *mi)
{
SET_BANK( 0, 0xc0000000, 4*1024*1024 );
......
......@@ -36,7 +36,7 @@ static void __init cerf_init_irq(void)
}
static void __init
fixup_cerf(struct machine_desc *desc, struct param_struct *params,
fixup_cerf(struct machine_desc *desc, struct tag *tags,
char **cmdline, struct meminfo *mi)
{
#if defined(CONFIG_SA1100_CERF_64MB)
......
......@@ -17,7 +17,7 @@
static void __init
fixup_empeg(struct machine_desc *desc, struct param_struct *params,
fixup_empeg(struct machine_desc *desc, struct tag *tags,
char **cmdline, struct meminfo *mi)
{
SET_BANK( 0, 0xc0000000, 4*1024*1024 );
......
......@@ -152,13 +152,9 @@ __initcall(flexanet_init);
static void __init
fixup_flexanet(struct machine_desc *desc, struct param_struct *params,
fixup_flexanet(struct machine_desc *desc, struct tag *tags,
char **cmdline, struct meminfo *mi)
{
int status;
unsigned long now;
/* fixed RAM size, by now (64MB) */
SET_BANK( 0, 0xc0000000, 64*1024*1024 );
mi->nr_banks = 1;
......
......@@ -52,7 +52,7 @@ static int __init freebird_init(void)
__initcall(freebird_init);
static void __init
fixup_freebird(struct machine_desc *desc, struct param_struct *params,
fixup_freebird(struct machine_desc *desc, struct tag *tags,
char **cmdline, struct meminfo *mi)
{
#ifdef CONFIG_SA1100_FREEBIRD_OLD
......
......@@ -125,7 +125,7 @@ static void __init graphicsclient_init_irq(void)
*/
static void __init
fixup_graphicsclient(struct machine_desc *desc, struct param_struct *params,
fixup_graphicsclient(struct machine_desc *desc, struct tag *tags,
char **cmdline, struct meminfo *mi)
{
SET_BANK( 0, 0xc0000000, 16*1024*1024 );
......
......@@ -157,7 +157,7 @@ static void __init graphicsmaster_init_irq(void)
*/
static void __init
fixup_graphicsmaster(struct machine_desc *desc, struct param_struct *params,
fixup_graphicsmaster(struct machine_desc *desc, struct tag *tags,
char **cmdline, struct meminfo *mi)
{
SET_BANK( 0, 0xc0000000, 16*1024*1024 );
......
......@@ -55,7 +55,7 @@ __initcall(init_huw_cs3);
static void __init
fixup_huw_webpanel(struct machine_desc *desc, struct param_struct *params,
fixup_huw_webpanel(struct machine_desc *desc, struct tag *tags,
char **cmdline, struct meminfo *mi)
{
/**
......
......@@ -40,32 +40,30 @@ static void sa1100_manual_rerun(unsigned int irq)
irq_desc[irq].handle(irq, &irq_desc[irq], &regs);
}
/*
* To get the GPIO number from an IRQ number
*/
#define GPIO_11_27_IRQ(i) ((i) - 21)
#define GPIO11_27_MASK(irq) (1 << GPIO_11_27_IRQ(irq))
static int sa1100_gpio_type(unsigned int irq, unsigned int type)
{
unsigned int mask;
printk(KERN_DEBUG "IRQ%d: ", irq);
if (irq <= 10)
mask = 1 << irq;
else
mask = GPIO11_27_MASK(irq);
if (type & __IRQT_RISEDGE) {
printk("rising ");
GPIO_IRQ_rising_edge |= mask;
} else
GPIO_IRQ_rising_edge &= ~mask;
if (type & __IRQT_FALEDGE) {
printk("falling ");
GPIO_IRQ_falling_edge |= mask;
} else
GPIO_IRQ_falling_edge &= ~mask;
printk("edges\n");
GRER = GPIO_IRQ_rising_edge & GPIO_IRQ_mask;
GFER = GPIO_IRQ_falling_edge & GPIO_IRQ_mask;
......
......@@ -17,7 +17,7 @@
static void __init
fixup_itsy(struct machine_desc *desc, struct param_struct *params,
fixup_itsy(struct machine_desc *desc, struct tag *tags,
char **cmdline, struct meminfo *mi)
{
SET_BANK( 0, 0xc0000000, 16*1024*1024 );
......
......@@ -57,7 +57,7 @@ __initcall(jornada720_init);
static void __init
fixup_jornada720(struct machine_desc *desc, struct param_struct *params,
fixup_jornada720(struct machine_desc *desc, struct tag *tags,
char **cmdline, struct meminfo *mi)
{
SET_BANK( 0, 0xc0000000, 32*1024*1024 );
......
......@@ -17,7 +17,7 @@
static void __init
fixup_nanoengine(struct machine_desc *desc, struct param_struct *params,
fixup_nanoengine(struct machine_desc *desc, struct tag *tags,
char **cmdline, struct meminfo *mi)
{
SET_BANK( 0, 0xc0000000, 32*1024*1024 );
......
......@@ -84,7 +84,7 @@ neponset_irq_handler(unsigned int irq, struct irqdesc *desc, struct pt_regs *reg
}
}
static void __init neponset_init_irq(void)
static inline void __init neponset_init_irq(void)
{
/*
* Install handler for GPIO25.
......@@ -102,6 +102,64 @@ static void __init neponset_init_irq(void)
set_irq_flags(IRQ_NEPONSET_USAR, IRQF_VALID | IRQF_PROBE);
}
static void neponset_set_mctrl(struct uart_port *port, u_int mctrl)
{
u_int mdm_ctl0 = MDM_CTL_0;
if (port->mapbase == _Ser1UTCR0) {
if (mctrl & TIOCM_RTS)
mdm_ctl0 &= ~MDM_CTL0_RTS2;
else
mdm_ctl0 |= MDM_CTL0_RTS2;
if (mctrl & TIOCM_DTR)
mdm_ctl0 &= ~MDM_CTL0_DTR2;
else
mdm_ctl0 |= MDM_CTL0_DTR2;
} else if (port->mapbase == _Ser3UTCR0) {
if (mctrl & TIOCM_RTS)
mdm_ctl0 &= ~MDM_CTL0_RTS1;
else
mdm_ctl0 |= MDM_CTL0_RTS1;
if (mctrl & TIOCM_DTR)
mdm_ctl0 &= ~MDM_CTL0_DTR1;
else
mdm_ctl0 |= MDM_CTL0_DTR1;
}
MDM_CTL_0 = mdm_ctl0;
}
static u_int neponset_get_mctrl(struct uart_port *port)
{
u_int ret = TIOCM_CD | TIOCM_CTS | TIOCM_DSR;
u_int mdm_ctl1 = MDM_CTL_1;
if (port->mapbase == _Ser1UTCR0) {
if (mdm_ctl1 & MDM_CTL1_DCD2)
ret &= ~TIOCM_CD;
if (mdm_ctl1 & MDM_CTL1_CTS2)
ret &= ~TIOCM_CTS;
if (mdm_ctl1 & MDM_CTL1_DSR2)
ret &= ~TIOCM_DSR;
} else if (port->mapbase == _Ser3UTCR0) {
if (mdm_ctl1 & MDM_CTL1_DCD1)
ret &= ~TIOCM_CD;
if (mdm_ctl1 & MDM_CTL1_CTS1)
ret &= ~TIOCM_CTS;
if (mdm_ctl1 & MDM_CTL1_DSR1)
ret &= ~TIOCM_DSR;
}
return ret;
}
static struct sa1100_port_fns neponset_port_fns __initdata = {
set_mctrl: neponset_set_mctrl,
get_mctrl: neponset_get_mctrl,
};
static int __init neponset_init(void)
{
int ret;
......@@ -134,12 +192,14 @@ static int __init neponset_init(void)
if (ret)
return ret;
sa1100_register_uart_fns(&neponset_port_fns);
neponset_init_irq();
/*
* Disable GPIO 0/1 drivers so the buttons work on the module.
*/
NCR_0 |= NCR_GP01_OFF;
NCR_0 = NCR_GP01_OFF;
/*
* Neponset has SA1111 connected to CS4. We know that after
......@@ -162,67 +222,7 @@ static struct map_desc neponset_io_desc[] __initdata = {
LAST_DESC
};
static void neponset_set_mctrl(struct uart_port *port, u_int mctrl)
{
u_int mdm_ctl0 = MDM_CTL_0;
if (port->mapbase == _Ser1UTCR0) {
if (mctrl & TIOCM_RTS)
mdm_ctl0 &= ~MDM_CTL0_RTS2;
else
mdm_ctl0 |= MDM_CTL0_RTS2;
if (mctrl & TIOCM_DTR)
mdm_ctl0 &= ~MDM_CTL0_DTR2;
else
mdm_ctl0 |= MDM_CTL0_DTR2;
} else if (port->mapbase == _Ser3UTCR0) {
if (mctrl & TIOCM_RTS)
mdm_ctl0 &= ~MDM_CTL0_RTS1;
else
mdm_ctl0 |= MDM_CTL0_RTS1;
if (mctrl & TIOCM_DTR)
mdm_ctl0 &= ~MDM_CTL0_DTR1;
else
mdm_ctl0 |= MDM_CTL0_DTR1;
}
MDM_CTL_0 = mdm_ctl0;
}
static u_int neponset_get_mctrl(struct uart_port *port)
{
u_int ret = TIOCM_CD | TIOCM_CTS | TIOCM_DSR;
u_int mdm_ctl1 = MDM_CTL_1;
if (port->mapbase == _Ser1UTCR0) {
if (mdm_ctl1 & MDM_CTL1_DCD2)
ret &= ~TIOCM_CD;
if (mdm_ctl1 & MDM_CTL1_CTS2)
ret &= ~TIOCM_CTS;
if (mdm_ctl1 & MDM_CTL1_DSR2)
ret &= ~TIOCM_DSR;
} else if (port->mapbase == _Ser3UTCR0) {
if (mdm_ctl1 & MDM_CTL1_DCD1)
ret &= ~TIOCM_CD;
if (mdm_ctl1 & MDM_CTL1_CTS1)
ret &= ~TIOCM_CTS;
if (mdm_ctl1 & MDM_CTL1_DSR1)
ret &= ~TIOCM_DSR;
}
return ret;
}
static struct sa1100_port_fns neponset_port_fns __initdata = {
set_mctrl: neponset_set_mctrl,
get_mctrl: neponset_get_mctrl,
};
void __init neponset_map_io(void)
{
iotable_init(neponset_io_desc);
if (machine_has_neponset())
sa1100_register_uart_fns(&neponset_port_fns);
}
......@@ -41,7 +41,7 @@ static int __init omnimeter_init(void)
__initcall(omnimeter_init);
static void __init
fixup_omnimeter(struct machine_desc *desc, struct param_struct *params,
fixup_omnimeter(struct machine_desc *desc, struct tag *tags,
char **cmdline, struct meminfo *mi)
{
SET_BANK( 0, 0xc0000000, 16*1024*1024 );
......
......@@ -17,7 +17,7 @@
static void __init
fixup_pangolin(struct machine_desc *desc, struct param_struct *params,
fixup_pangolin(struct machine_desc *desc, struct tag *tags,
char **cmdline, struct meminfo *mi)
{
SET_BANK( 0, 0xc0000000, 128*1024*1024 );
......
......@@ -57,7 +57,7 @@ static void __init pfs168_init_irq(void)
static void __init
fixup_pfs168(struct machine_desc *desc, struct param_struct *params,
fixup_pfs168(struct machine_desc *desc, struct tag *tags,
char **cmdline, struct meminfo *mi)
{
SET_BANK( 0, 0xc0000000, 16*1024*1024 );
......
......@@ -16,7 +16,7 @@
#include "generic.h"
static void __init
fixup_pleb(struct machine_desc *desc, struct param_struct *params,
fixup_pleb(struct machine_desc *desc, struct tag *tags,
char **cmdline, struct meminfo *mi)
{
SET_BANK(0, 0xc0000000, 16*1024*1024);
......
......@@ -17,7 +17,7 @@
static void __init
fixup_sherman(struct machine_desc *desc, struct param_struct *params,
fixup_sherman(struct machine_desc *desc, struct tag *tags,
char **cmdline, struct meminfo *mi)
{
SET_BANK( 0, 0xc0000000, 64*1024*1024 );
......
......@@ -41,7 +41,7 @@ void clear_cs3_bit(int value)
}
static void __init
fixup_simpad(struct machine_desc *desc, struct param_struct *params,
fixup_simpad(struct machine_desc *desc, struct tag *tags,
char **cmdline, struct meminfo *mi)
{
#ifdef CONFIG_SA1100_SIMPAD_DRAM_64MB /* DRAM */
......
......@@ -74,7 +74,7 @@
/* init funcs */
static void __init fixup_system3(struct machine_desc *desc,
struct param_struct *params, char **cmdline, struct meminfo *mi);
struct tag *tags, char **cmdline, struct meminfo *mi);
static int __init system3_init(void);
static void __init system3_init_irq(void);
static void __init system3_map_io(void);
......@@ -87,8 +87,6 @@ static int sdram_notifier(struct notifier_block *nb, unsigned long event, void *
static void system3_lcd_power(int on);
static void system3_backlight_power(int on);
extern void convert_to_tag_list(struct param_struct *params, int mem_init);
/**********************************************************************
* global data
......@@ -239,7 +237,7 @@ static int sdram_notifier(struct notifier_block *nb, unsigned long event,
*
*/
static void __init fixup_system3(struct machine_desc *desc,
struct param_struct *params, char **cmdline, struct meminfo *mi)
struct tag *tags, char **cmdline, struct meminfo *mi)
{
DPRINTK( "%s\n", "START" );
......
......@@ -42,7 +42,7 @@ __initcall(victor_init);
static void __init
fixup_victor(struct machine_desc *desc, struct param_struct *params,
fixup_victor(struct machine_desc *desc, struct tag *tags,
char **cmdline, struct meminfo *mi)
{
SET_BANK( 0, 0xc0000000, 4*1024*1024 );
......
......@@ -58,7 +58,7 @@ __initcall(xp860_init);
static void __init
fixup_xp860(struct machine_desc *desc, struct param_struct *params,
fixup_xp860(struct machine_desc *desc, struct tag *tags,
char **cmdline, struct meminfo *mi)
{
SET_BANK( 0, 0xc0000000, 32*1024*1024 );
......
......@@ -29,15 +29,21 @@ obj-$(CONFIG_DISCONTIGMEM) += discontig.o
# Select the processor-specific files
p-$(CONFIG_CPU_26) += proc-arm2,3.o
# ARMv3
p-$(CONFIG_CPU_ARM610) += proc-arm6,7.o tlb-v3.o copypage-v3.o
p-$(CONFIG_CPU_ARM710) += proc-arm6,7.o tlb-v3.o copypage-v3.o
p-$(CONFIG_CPU_ARM720T) += proc-arm720.o tlb-v4.o copypage-v4.o abort-lv4t.o
p-$(CONFIG_CPU_ARM920T) += proc-arm920.o tlb-v4wb.o copypage-v4.o abort-ev4t.o
p-$(CONFIG_CPU_ARM922T) += proc-arm922.o tlb-v4wb.o copypage-v4.o abort-ev4t.o
p-$(CONFIG_CPU_ARM926T) += proc-arm926.o tlb-v4wb.o copypage-v4.o abort-ev5ej.o
p-$(CONFIG_CPU_ARM1020) += proc-arm1020.o tlb-v4wb.o copypage-v4.o abort-ev4t.o
p-$(CONFIG_CPU_SA110) += proc-sa110.o tlb-v4wb.o copypage-v4.o copypage-v4mc.o abort-ev4.o minicache.o
p-$(CONFIG_CPU_SA1100) += proc-sa110.o tlb-v4wb.o copypage-v4.o copypage-v4mc.o abort-ev4.o minicache.o
# ARMv4
p-$(CONFIG_CPU_ARM720T) += proc-arm720.o tlb-v4.o copypage-v4wt.o abort-lv4t.o
p-$(CONFIG_CPU_ARM920T) += proc-arm920.o tlb-v4wb.o copypage-v4wb.o abort-ev4t.o
p-$(CONFIG_CPU_ARM922T) += proc-arm922.o tlb-v4wb.o copypage-v4wb.o abort-ev4t.o
p-$(CONFIG_CPU_ARM1020) += proc-arm1020.o tlb-v4wb.o copypage-v4wb.o abort-ev4t.o
p-$(CONFIG_CPU_SA110) += proc-sa110.o tlb-v4wb.o copypage-v4wb.o abort-ev4.o minicache.o
p-$(CONFIG_CPU_SA1100) += proc-sa110.o tlb-v4wb.o copypage-v4mc.o abort-ev4.o minicache.o
# ARMv5
p-$(CONFIG_CPU_ARM926T) += proc-arm926.o tlb-v4wb.o copypage-v4wb.o abort-ev5ej.o
p-$(CONFIG_CPU_XSCALE) += proc-xscale.o tlb-v4wb.o copypage-v5te.o abort-ev4t.o minicache.o
obj-y += $(sort $(p-y))
......
......@@ -52,7 +52,8 @@ void *consistent_alloc(int gfp, size_t size, dma_addr_t *dma_handle)
goto no_page;
*dma_handle = page_to_bus(page);
ret = __ioremap(page_to_phys(page), size, 0);
ret = __ioremap(page_to_pfn(page) << PAGE_SHIFT, size, 0,
PAGE_SIZE << order);
if (!ret)
goto no_remap;
......
......@@ -26,7 +26,7 @@
* instruction. If your processor does not supply this, you have to write your
* own copy_user_page that does the right thing.
*/
ENTRY(v4_copy_user_page)
ENTRY(v4wb_copy_user_page)
stmfd sp!, {r4, lr} @ 2
mov r2, #PAGE_SZ/64 @ 1
ldmia r1!, {r3, r4, ip, lr} @ 4
......@@ -51,7 +51,7 @@ ENTRY(v4_copy_user_page)
*
* Same story as above.
*/
ENTRY(v4_clear_user_page)
ENTRY(v4wb_clear_user_page)
str lr, [sp, #-4]!
mov r1, #PAGE_SZ/64 @ 1
mov r2, #0 @ 1
......@@ -71,7 +71,7 @@ ENTRY(v4_clear_user_page)
.section ".text.init", #alloc, #execinstr
ENTRY(v4_user_fns)
.long v4_clear_user_page
.long v4_copy_user_page
ENTRY(v4wb_user_fns)
.long v4wb_clear_user_page
.long v4wb_copy_user_page
/*
* linux/arch/arm/lib/copypage-v4.S
*
* Copyright (C) 1995-1999 Russell King
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* ASM optimised string functions
*
* This is for CPUs with a writethrough cache and 'flush ID cache' is
* the only supported cache operation.
*/
#include <linux/linkage.h>
#include <asm/constants.h>
.text
.align 5
/*
* ARMv4 optimised copy_user_page
*
* Since we have writethrough caches, we don't have to worry about
* dirty data in the cache. However, we do have to ensure that
* subsequent reads are up to date.
*/
ENTRY(v4wt_copy_user_page)
stmfd sp!, {r4, lr} @ 2
mov r2, #PAGE_SZ/64 @ 1
ldmia r1!, {r3, r4, ip, lr} @ 4
1: stmia r0!, {r3, r4, ip, lr} @ 4
ldmia r1!, {r3, r4, ip, lr} @ 4+1
stmia r0!, {r3, r4, ip, lr} @ 4
ldmia r1!, {r3, r4, ip, lr} @ 4
stmia r0!, {r3, r4, ip, lr} @ 4
ldmia r1!, {r3, r4, ip, lr} @ 4
subs r2, r2, #1 @ 1
stmia r0!, {r3, r4, ip, lr} @ 4
ldmneia r1!, {r3, r4, ip, lr} @ 4
bne 1b @ 1
mcr p15, 0, r2, c7, c7, 0 @ flush ID cache
ldmfd sp!, {r4, pc} @ 3
.align 5
/*
* ARMv4 optimised clear_user_page
*
* Same story as above.
*/
ENTRY(v4wt_clear_user_page)
str lr, [sp, #-4]!
mov r1, #PAGE_SZ/64 @ 1
mov r2, #0 @ 1
mov r3, #0 @ 1
mov ip, #0 @ 1
mov lr, #0 @ 1
1: stmia r0!, {r2, r3, ip, lr} @ 4
stmia r0!, {r2, r3, ip, lr} @ 4
stmia r0!, {r2, r3, ip, lr} @ 4
stmia r0!, {r2, r3, ip, lr} @ 4
subs r1, r1, #1 @ 1
bne 1b @ 1
mcr p15, 0, r2, c7, c7, 0 @ flush ID cache
ldr pc, [sp], #4
.section ".text.init", #alloc, #execinstr
ENTRY(v4wt_user_fns)
.long v4wt_clear_user_page
.long v4wt_copy_user_page
......@@ -557,5 +557,5 @@ __arm1020_proc_info:
.long cpu_arm1020_info
.long arm1020_processor_functions
.long v4wbi_tlb_fns
.long v4_user_fns
.long v4wb_user_fns
.size __arm1020_proc_info, . - __arm1020_proc_info
......@@ -261,5 +261,5 @@ __arm720_proc_info:
.long cpu_arm720_info @ info
.long arm720_processor_functions
.long v4_tlb_fns
.long v4_user_fns
.long v4wt_user_fns
.size __arm720_proc_info, . - __arm720_proc_info
......@@ -543,5 +543,5 @@ __arm920_proc_info:
.long cpu_arm920_info
.long arm920_processor_functions
.long v4wbi_tlb_fns
.long v4_user_fns
.long v4wb_user_fns
.size __arm920_proc_info, . - __arm920_proc_info
......@@ -544,5 +544,5 @@ __arm922_proc_info:
.long cpu_arm922_info
.long arm922_processor_functions
.long v4wbi_tlb_fns
.long v4_user_fns
.long v4wb_user_fns
.size __arm922_proc_info, . - __arm922_proc_info
......@@ -542,5 +542,5 @@ __arm926_proc_info:
.long cpu_arm926_info
.long arm926_processor_functions
.long v4wbi_tlb_fns
.long v4_user_fns
.long v4wb_user_fns
.size __arm926_proc_info, . - __arm926_proc_info
......@@ -611,6 +611,7 @@ cpu_elf_name:
.section ".proc.info", #alloc, #execinstr
#ifdef CONFIG_CPU_SA110
.type __sa110_proc_info,#object
__sa110_proc_info:
.long 0x4401a100
......@@ -623,9 +624,11 @@ __sa110_proc_info:
.long cpu_sa110_info
.long sa110_processor_functions
.long v4wb_tlb_fns
.long v4_user_fns
.long v4wb_user_fns
.size __sa110_proc_info, . - __sa110_proc_info
#endif
#ifdef CONFIG_CPU_SA1100
.type __sa1100_proc_info,#object
__sa1100_proc_info:
.long 0x4401a110
......@@ -655,3 +658,4 @@ __sa1110_proc_info:
.long v4wb_tlb_fns
.long v4_mc_user_fns
.size __sa1110_proc_info, . - __sa1110_proc_info
#endif
......@@ -55,14 +55,13 @@ ENTRY(v4_flush_user_tlb_range)
eors r3, ip, r3 @ == mm ?
movne pc, lr @ no, we dont do anything
vma_vm_flags ip, r2
.v4_flush_kern_tlb_range:
bic r0, r0, #0x0ff
bic r0, r0, #0xf00
1: mcr p15, 0, r0, c8, c6, 1 @ invalidate D TLB entry
1: mcr p15, 0, r0, c8, c7, 1 @ invalidate TLB entry
add r0, r0, #PAGE_SZ
cmp r0, r1
blo 1b
tst ip, #VM_EXEC
mcrne p15, 0, r3, c8, c5, 0 @ invalidate I TLB
mov pc, lr
/*
......@@ -80,9 +79,8 @@ ENTRY(v4_flush_user_tlb_page)
teq r2, r3 @ equal
movne pc, lr @ no
vma_vm_flags r2, r1
mcr p15, 0, r0, c8, c6, 1 @ invalidate D TLB entry
tst r2, #VM_EXEC
mcrne p15, 0, r3, c8, c5, 0 @ invalidate I TLB
.v4_flush_kern_tlb_page:
mcr p15, 0, r0, c8, c7, 1 @ invalidate TLB entry
mov pc, lr
/*
......@@ -94,16 +92,8 @@ ENTRY(v4_flush_user_tlb_page)
* - start - virtual address (may not be aligned)
* - end - virtual address (may not be aligned)
*/
.align 5
ENTRY(v4_flush_kern_tlb_range)
bic r0, r0, #0x0ff
bic r0, r0, #0xf00
1: mcr p15, 0, r0, c8, c6, 1 @ invalidate D TLB entry
add r0, r0, #PAGE_SZ
cmp r0, r1
blo 1b
mcr p15, 0, r3, c8, c5, 0 @ invalidate I TLB
mov pc, lr
.globl v4_flush_kern_tlb_range
.equ v4_flush_kern_tlb_range, .v4_flush_kern_tlb_range
/*
......@@ -115,9 +105,8 @@ ENTRY(v4_flush_kern_tlb_range)
*
* - kaddr - Kernel virtual memory address
*/
ENTRY(v4_flush_kern_tlb_page)
mcr p15, 0, r0, c8, c6, 1 @ invalidate D TLB entry
mov pc, lr
.globl v4_flush_kern_tlb_page
.equ v4_flush_kern_tlb_page, .v4_flush_kern_tlb_page
.section ".text.init", #alloc, #execinstr
......
......@@ -77,7 +77,7 @@ void adfs_write_inode(struct inode *inode,int unused);
int adfs_notify_change(struct dentry *dentry, struct iattr *attr);
/* map.c */
extern int adfs_map_lookup(struct super_block *sb, int frag_id, int offset);
extern int adfs_map_lookup(struct super_block *sb, unsigned int frag_id, unsigned int offset);
extern unsigned int adfs_map_free(struct super_block *sb);
/* Misc */
......
......@@ -24,7 +24,7 @@
/*
* For future. This should probably be per-directory.
*/
static rwlock_t adfs_dir_lock;
static rwlock_t adfs_dir_lock = RW_LOCK_UNLOCKED;
static int
adfs_readdir(struct file *filp, void *dirent, filldir_t filldir)
......
/*
* linux/fs/adfs/map.c
*
* Copyright (C) 1997-1999 Russell King
* Copyright (C) 1997-2002 Russell King
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
......@@ -13,30 +13,64 @@
#include <linux/adfs_fs.h>
#include <linux/spinlock.h>
#include <asm/unaligned.h>
#include "adfs.h"
/*
* The ADFS map is basically a set of sectors. Each sector is called a
* zone which contains a bitstream made up of variable sized fragments.
* Each bit refers to a set of bytes in the filesystem, defined by
* log2bpmb. This may be larger or smaller than the sector size, but
* the overall size it describes will always be a round number of
* sectors. A fragment id is always idlen bits long.
*
* < idlen > < n > <1>
* +---------+-------//---------+---+
* | frag id | 0000....000000 | 1 |
* +---------+-------//---------+---+
*
* The physical disk space used by a fragment is taken from the start of
* the fragment id up to and including the '1' bit - ie, idlen + n + 1
* bits.
*
* A fragment id can be repeated multiple times in the whole map for
* large or fragmented files. The first map zone a fragment starts in
* is given by fragment id / ids_per_zone - this allows objects to start
* from any zone on the disk.
*
* Free space is described by a linked list of fragments. Each free
* fragment describes free space in the same way as the other fragments,
* however, the frag id specifies an offset (in map bits) from the end
* of this fragment to the start of the next free fragment.
*
* Objects stored on the disk are allocated object ids (we use these as
* our inode numbers.) Object ids contain a fragment id and an optional
* offset. This allows a directory fragment to contain small files
* associated with that directory.
*/
/*
* For the future...
*/
static rwlock_t adfs_map_lock;
static rwlock_t adfs_map_lock = RW_LOCK_UNLOCKED;
/*
* This is fun. We need to load up to 19 bits from the map at an
* arbitary bit alignment. (We're limited to 19 bits by F+ version 2).
*/
#define GET_FRAG_ID(_map,_start,_idmask) \
({ \
unsigned long _v2, _frag; \
unsigned int _tmp; \
_tmp = _start >> 5; \
_frag = le32_to_cpu(_map[_tmp]); \
_v2 = le32_to_cpu(_map[_tmp + 1]); \
_tmp = start & 31; \
_frag = (_frag >> _tmp) | (_v2 << (32 - _tmp)); \
unsigned char *_m = _map + (_start >> 3); \
u32 _frag = get_unaligned((u32 *)_m); \
_frag >>= (_start & 7); \
_frag & _idmask; \
})
/*
* return the map bit offset of the fragment frag_id in
* the zone dm.
* Note that the loop is optimised for best asm code -
* look at the output of:
* return the map bit offset of the fragment frag_id in the zone dm.
* Note that the loop is optimised for best asm code - look at the
* output of:
* gcc -D__KERNEL__ -O2 -I../../include -o - -S map.c
*/
static int
......@@ -44,14 +78,13 @@ lookup_zone(const struct adfs_discmap *dm, const unsigned int idlen,
const unsigned int frag_id, unsigned int *offset)
{
const unsigned int mapsize = dm->dm_endbit;
const unsigned int idmask = (1 << idlen) - 1;
unsigned long *map = ((unsigned long *)dm->dm_bh->b_data) + 1;
const u32 idmask = (1 << idlen) - 1;
unsigned char *map = dm->dm_bh->b_data + 4;
unsigned int start = dm->dm_startbit;
unsigned int mapptr;
u32 frag;
do {
unsigned long frag;
frag = GET_FRAG_ID(map, start, idmask);
mapptr = start + idlen;
......@@ -59,15 +92,17 @@ lookup_zone(const struct adfs_discmap *dm, const unsigned int idlen,
* find end of fragment
*/
{
unsigned long v2;
u32 v, *_map = (u32 *)map;
while ((v2 = map[mapptr >> 5] >> (mapptr & 31)) == 0) {
v = le32_to_cpu(_map[mapptr >> 5]) >> (mapptr & 31);
while (v == 0) {
mapptr = (mapptr & ~31) + 32;
if (mapptr >= mapsize)
goto error;
v = le32_to_cpu(_map[mapptr >> 5]);
}
mapptr += 1 + ffz(~v2);
mapptr += 1 + ffz(~v);
}
if (frag == frag_id)
......@@ -75,8 +110,11 @@ lookup_zone(const struct adfs_discmap *dm, const unsigned int idlen,
again:
start = mapptr;
} while (mapptr < mapsize);
return -1;
error:
printk(KERN_ERR "adfs: oversized fragment 0x%x at 0x%x-0x%x\n",
frag, start, mapptr);
return -1;
found:
......@@ -102,10 +140,10 @@ scan_free_map(struct adfs_sb_info *asb, struct adfs_discmap *dm)
const unsigned int mapsize = dm->dm_endbit + 32;
const unsigned int idlen = asb->s_idlen;
const unsigned int frag_idlen = idlen <= 15 ? idlen : 15;
const unsigned int idmask = (1 << frag_idlen) - 1;
unsigned long *map = (unsigned long *)dm->dm_bh->b_data;
const u32 idmask = (1 << frag_idlen) - 1;
unsigned char *map = dm->dm_bh->b_data;
unsigned int start = 8, mapptr;
unsigned long frag;
u32 frag;
unsigned long total = 0;
/*
......@@ -133,15 +171,17 @@ scan_free_map(struct adfs_sb_info *asb, struct adfs_discmap *dm)
* find end of fragment
*/
{
unsigned long v2;
u32 v, *_map = (u32 *)map;
while ((v2 = map[mapptr >> 5] >> (mapptr & 31)) == 0) {
v = le32_to_cpu(_map[mapptr >> 5]) >> (mapptr & 31);
while (v == 0) {
mapptr = (mapptr & ~31) + 32;
if (mapptr >= mapsize)
goto error;
v = le32_to_cpu(_map[mapptr >> 5]);
}
mapptr += 1 + ffz(~v2);
mapptr += 1 + ffz(~v);
}
total += mapptr - start;
......@@ -212,7 +252,9 @@ adfs_map_free(struct super_block *sb)
return signed_asl(total, asb->s_map2blk);
}
int adfs_map_lookup (struct super_block *sb, int frag_id, int offset)
int
adfs_map_lookup(struct super_block *sb, unsigned int frag_id,
unsigned int offset)
{
struct adfs_sb_info *asb = &sb->u.adfs_sb;
unsigned int zone, mapoff;
......@@ -245,12 +287,12 @@ int adfs_map_lookup (struct super_block *sb, int frag_id, int offset)
return secoff + signed_asl(result, asb->s_map2blk);
}
adfs_error(sb, "fragment %04X at offset %d not found in map",
adfs_error(sb, "fragment 0x%04x at offset %d not found in map",
frag_id, offset);
return 0;
bad_fragment:
adfs_error(sb, "fragment %X is invalid (zone = %d, max = %d)",
adfs_error(sb, "invalid fragment 0x%04x (zone = %d, max = %d)",
frag_id, zone, asb->s_map_size);
return 0;
}
......@@ -64,43 +64,9 @@ static int adfs_checkdiscrecord(struct adfs_discrecord *dr)
if (dr->disc_size_high >> dr->log2secsize)
return 1;
/*
* The following checks are not required for F+
* stage 1.
*/
#if 0
/* idlen must be smaller be no greater than 15 */
if (dr->idlen > 15)
return 1;
/* nzones must be less than 128 for the root
* directory to be addressable
*/
if (dr->nzones >= 128 && dr->nzones_high == 0)
return 1;
/* root must be of the form 0x2.. */
if ((le32_to_cpu(dr->root) & 0xffffff00) != 0x00000200)
return 1;
#else
/*
* Stage 2 F+ does not require the following check
*/
#if 0
/* idlen must be no greater than 16 v2 [1.0] */
if (dr->idlen > 16)
return 1;
/* we can't handle F+ discs yet */
if (dr->format_version || dr->root_size)
return 1;
#else
/* idlen must be no greater than 19 v2 [1.0] */
if (dr->idlen > 19)
return 1;
#endif
#endif
/* reserved bytes should be zero */
for (i = 0; i < sizeof(dr->unused52); i++)
......
......@@ -120,9 +120,10 @@
(((unsigned long)(addr) - PAGE_OFFSET) >> NODE_MAX_MEM_SHIFT)
/*
* Given a physical address, convert it to a node id.
* Given a page frame number, convert it to a node id.
*/
#define PHYS_TO_NID(addr) KVADDR_TO_NID(__phys_to_virt(addr))
#define PFN_TO_NID(pfn) \
(((pfn) - PHYS_PFN_OFFSET) >> (NODE_MAX_MEM_SHIFT - PAGE_SHIFT))
/*
* Given a kaddr, ADDR_TO_MAPBASE finds the owning node of the memory
......@@ -131,30 +132,15 @@
#define ADDR_TO_MAPBASE(kaddr) \
NODE_MEM_MAP(KVADDR_TO_NID((unsigned long)(kaddr)))
#define PFN_TO_MAPBASE(pfn) NODE_MEM_MAP(PFN_TO_NID(pfn))
/*
* Given a kaddr, LOCAL_MAR_NR finds the owning node of the memory
* and returns the index corresponding to the appropriate page in the
* node's mem_map.
*/
#define LOCAL_MAP_NR(kaddr) \
(((unsigned long)(kaddr)-LOCAL_BASE_ADDR((kaddr))) >> PAGE_SHIFT)
/*
* Given a kaddr, virt_to_page returns a pointer to the corresponding
* mem_map entry.
*/
#define virt_to_page(kaddr) \
(ADDR_TO_MAPBASE(kaddr) + LOCAL_MAP_NR(kaddr))
/*
* VALID_PAGE returns a non-zero value if given page pointer is valid.
* This assumes all node's mem_maps are stored within the node they refer to.
*/
#define VALID_PAGE(page) \
({ unsigned int node = KVADDR_TO_NID(page); \
( (node < NR_NODES) && \
((unsigned)((page) - NODE_MEM_MAP(node)) < NODE_DATA(node)->node_size) ); \
})
#define LOCAL_MAP_NR(addr) \
(((unsigned long)(addr) & (NODE_MAX_MEM_SIZE - 1)) >> PAGE_SHIFT)
/*
* The PS7211 allows up to 256MB max per DRAM bank, but the EDB7211
......@@ -167,40 +153,13 @@
#define NODE_MAX_MEM_SHIFT 24
#define NODE_MAX_MEM_SIZE (1<<NODE_MAX_MEM_SHIFT)
/*
* Given a mem_map_t, LOCAL_MAP_BASE finds the owning node for the
* physical page and returns the kaddr for the mem_map of that node.
*/
#define LOCAL_MAP_BASE(page) \
NODE_MEM_MAP(KVADDR_TO_NID((unsigned long)(page)))
/*
* Given a kaddr, LOCAL_BASE_ADDR finds the owning node of the memory
* and returns the kaddr corresponding to first physical page in the
* node's mem_map.
*/
#define LOCAL_BASE_ADDR(kaddr) ((unsigned long)(kaddr) & ~(NODE_MAX_MEM_SIZE-1))
/*
* With discontigmem, the conceptual mem_map array starts from PAGE_OFFSET.
* Given a kaddr, MAP_NR returns the appropriate global mem_map index so
* it matches the corresponding node's local mem_map.
*/
#define MAP_NR(kaddr) (LOCAL_MAP_NR((kaddr)) + \
(((unsigned long)ADDR_TO_MAPBASE((kaddr)) - PAGE_OFFSET) / \
sizeof(mem_map_t)))
#else
#define PHYS_TO_NID(addr) (0)
#define PFN_TO_NID(pfn) (0)
#endif /* CONFIG_DISCONTIGMEM */
#endif /* CONFIG_ARCH_EDB7211 */
#ifndef PHYS_TO_NID
#define PHYS_TO_NID(addr) (0)
#endif
#endif
......@@ -129,7 +129,6 @@ void __init time_init(void)
timer2->TimerControl = 0;
timer1->TimerLoad = TIMER_RELOAD;
timer1->TimerValue = TIMER_RELOAD;
timer1->TimerControl = TIMER_CTRL | 0x40; /* periodic */
/*
......
......@@ -22,6 +22,16 @@
#include "bitfield.h"
/*
* SA1100 CS line to physical address
*/
#define SA1100_CS0_PHYS 0x00000000
#define SA1100_CS1_PHYS 0x08000000
#define SA1100_CS2_PHYS 0x10000000
#define SA1100_CS3_PHYS 0x18000000
#define SA1100_CS4_PHYS 0x40000000
#define SA1100_CS5_PHYS 0x48000000
/*
* Personal Computer Memory Card International Association (PCMCIA) sockets
......
......@@ -23,15 +23,6 @@
#define UNCACHEABLE_ADDR 0xfa050000
/*
* Those are statically mapped PCMCIA IO space for designs using it as a
* generic IO bus, typically with ISA parts, hardwired IDE interfaces, etc.
* The actual PCMCIA code is mapping required IO region at run time.
*/
#define PCMCIA_IO_0_BASE 0xf6000000
#define PCMCIA_IO_1_BASE 0xf7000000
/*
* We requires absolute addresses i.e. (PCMCIA_IO_0_BASE + 0x3f8) for
* in*()/out*() macros to be usable for all cases.
......
......@@ -60,11 +60,6 @@
#define IRQ_GPIO26 47
#define IRQ_GPIO27 48
/*
* To get the GPIO number from an IRQ number
*/
#define GPIO_11_27_IRQ(i) ((i) - 21)
/*
* The next 16 interrupts are for board specific purposes. Since
* the kernel can only run on one machine at a time, we can re-use
......
......@@ -79,49 +79,36 @@
/*
* Given a kernel address, find the home node of the underlying memory.
*/
#define KVADDR_TO_NID(addr) \
(((unsigned long)(addr) - 0xc0000000) >> 27)
#define KVADDR_TO_NID(addr) (((unsigned long)(addr) - PAGE_OFFSET) >> 27)
/*
* Given a physical address, convert it to a node id.
* Given a page frame number, convert it to a node id.
*/
#define PHYS_TO_NID(addr) KVADDR_TO_NID(__phys_to_virt(addr))
#define PFN_TO_NID(pfn) (((pfn) - PHYS_PFN_OFFSET) >> (27 - PAGE_SHIFT))
/*
* Given a kaddr, ADDR_TO_MAPBASE finds the owning node of the memory
* and returns the mem_map of that node.
* and return the mem_map of that node.
*/
#define ADDR_TO_MAPBASE(kaddr) \
NODE_MEM_MAP(KVADDR_TO_NID((unsigned long)(kaddr)))
#define ADDR_TO_MAPBASE(kaddr) NODE_MEM_MAP(KVADDR_TO_NID(kaddr))
/*
* Given a kaddr, LOCAL_MEM_MAP finds the owning node of the memory
* and returns the index corresponding to the appropriate page in the
* node's mem_map.
* Given a page frame number, find the owning node of the memory
* and return the mem_map of that node.
*/
#define LOCAL_MAP_NR(kvaddr) \
(((unsigned long)(kvaddr) & 0x07ffffff) >> PAGE_SHIFT)
#define PFN_TO_MAPBASE(pfn) NODE_MEM_MAP(PFN_TO_NID(pfn))
/*
* Given a kaddr, virt_to_page returns a pointer to the corresponding
* mem_map entry.
*/
#define virt_to_page(kaddr) \
(ADDR_TO_MAPBASE(kaddr) + LOCAL_MAP_NR(kaddr))
/*
* VALID_PAGE returns a non-zero value if given page pointer is valid.
* This assumes all node's mem_maps are stored within the node they refer to.
* Given a kaddr, LOCAL_MEM_MAP finds the owning node of the memory
* and returns the index corresponding to the appropriate page in the
* node's mem_map.
*/
#define VALID_PAGE(page) \
({ unsigned int node = KVADDR_TO_NID(page); \
( (node < NR_NODES) && \
((unsigned)((page) - NODE_MEM_MAP(node)) < NODE_DATA(node)->node_size) ); \
})
#define LOCAL_MAP_NR(addr) \
(((unsigned long)(addr) & 0x07ffffff) >> PAGE_SHIFT)
#else
#define PHYS_TO_NID(addr) (0)
#define PFN_TO_NID(addr) (0)
#endif
......
......@@ -158,7 +158,8 @@
*
* We have the following to choose from:
* v3 - ARMv3
* v4 - ARMv4 without minicache
* v4wt - ARMv4 with writethrough cache, without minicache
* v4wb - ARMv4 with writeback cache, without minicache
* v4_mc - ARMv4 with minicache
* v5te_mc - ARMv5TE with minicache
*/
......@@ -173,13 +174,21 @@
# endif
#endif
#if defined(CONFIG_CPU_ARM720T) || defined(CONFIG_CPU_ARM920T) || \
defined(CONFIG_CPU_ARM922T) || defined(CONFIG_CPU_ARM926T) || \
defined(CONFIG_CPU_SA110) || defined(CONFIG_CPU_ARM1020)
#if defined(CONFIG_CPU_ARM720T)
# ifdef _USER
# define MULTI_USER 1
# else
# define _USER v4wt
# endif
#endif
#if defined(CONFIG_CPU_ARM920T) || defined(CONFIG_CPU_ARM922T) || \
defined(CONFIG_CPU_ARM926T) || defined(CONFIG_CPU_SA110) || \
defined(CONFIG_CPU_ARM1020)
# ifdef _USER
# define MULTI_USER 1
# else
# define _USER v4
# define _USER v4wb
# endif
#endif
......
......@@ -269,24 +269,6 @@ extern void *consistent_alloc(int gfp, size_t size, dma_addr_t *handle);
extern void consistent_free(void *vaddr, size_t size, dma_addr_t handle);
extern void consistent_sync(void *vaddr, size_t size, int rw);
/*
* Change "struct page" to physical address.
*/
#ifdef CONFIG_DISCONTIGMEM
#define page_to_phys(page) \
((((page) - page_zone(page)->zone_mem_map) << PAGE_SHIFT) \
+ page_zone(page)->zone_start_paddr)
#else
#define page_to_phys(page) \
(PHYS_OFFSET + (((page) - mem_map) << PAGE_SHIFT))
#endif
/*
* We should really eliminate virt_to_bus() here - it's depreciated.
*/
#define page_to_bus(page) \
(virt_to_bus(page_address(page)))
/*
* can the hardware map this into one segment or not, given no other
* constraints.
......
/*
* linux/include/asm-arm/memory.h
*
* Copyright (C) 2000 Russell King
* Copyright (C) 2000-2002 Russell King
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* Note: this file should not be included by non-asm/.h files
*
* Modifications:
*/
#ifndef __ASM_ARM_MEMORY_H
#define __ASM_ARM_MEMORY_H
#include <linux/config.h>
#include <asm/arch/memory.h>
static inline unsigned long virt_to_phys(volatile void *x)
/*
* PFNs are used to describe any physical page; this means
* PFN 0 == physical address 0.
*
* This is the PFN of the first RAM page in the kernel
* direct-mapped view. We assume this is the first page
* of RAM in the mem_map as well.
*/
#define PHYS_PFN_OFFSET (PHYS_OFFSET >> PAGE_SHIFT)
/*
* These are *only* valid on the kernel direct mapped RAM memory.
*/
static inline unsigned long virt_to_phys(void *x)
{
return __virt_to_phys((unsigned long)(x));
}
......@@ -26,10 +38,77 @@ static inline void *phys_to_virt(unsigned long x)
return (void *)(__phys_to_virt((unsigned long)(x)));
}
#define __pa(x) __virt_to_phys((unsigned long)(x))
#define __va(x) ((void *)__phys_to_virt((unsigned long)(x)))
/*
* Virtual <-> DMA view memory address translations
* Again, these are *only* valid on the kernel direct mapped RAM
* memory. Use of these is *depreciated*.
*/
#define virt_to_bus(x) (__virt_to_bus((unsigned long)(x)))
#define bus_to_virt(x) ((void *)(__bus_to_virt((unsigned long)(x))))
/*
* Conversion between a struct page and a physical address.
*
* Note: when converting an unknown physical address to a
* struct page, the resulting pointer must be validated
* using VALID_PAGE(). It must return an invalid struct page
* for any physical address not corresponding to a system
* RAM address.
*
* page_to_pfn(page) convert a struct page * to a PFN number
* pfn_to_page(pfn) convert a _valid_ PFN number to struct page *
* pfn_valid(pfn) indicates whether a PFN number is valid
*
* virt_to_page(k) convert a _valid_ virtual address to struct page *
* virt_addr_valid(k) indicates whether a virtual address is valid
*/
#ifndef CONFIG_DISCONTIGMEM
#define page_to_pfn(page) (((page) - mem_map) + PHYS_PFN_OFFSET)
#define pfn_to_page(pfn) ((mem_map + (pfn)) - PHYS_PFN_OFFSET)
#define pfn_valid(pfn) ((pfn) >= PHYS_PFN_OFFSET && (pfn) < max_mapnr)
#define virt_to_page(kaddr) (pfn_to_page(__pa(kaddr) >> PAGE_SHIFT))
#define virt_addr_valid(kaddr) ((kaddr) >= PAGE_OFFSET && (kaddr) < (unsigned long)high_memory)
#else
/*
* This is more complex. We have a set of mem_map arrays spread
* around in memory.
*/
#define page_to_pfn(page) \
(((page) - page_zone(page)->zone_mem_map) \
+ (page_zone(page)->zone_start_paddr >> PAGE_SHIFT))
#define pfn_to_page(pfn) \
(PFN_TO_MAPBASE(pfn) + LOCAL_MAP_NR((pfn) << PAGE_SHIFT))
#define pfn_valid(pfn) (PFN_TO_NID(pfn) < NR_NODES)
#define virt_to_page(kaddr) \
(ADDR_TO_MAPBASE(kaddr) + LOCAL_MAP_NR(kaddr))
#define virt_addr_valid(kaddr) (KVADDR_TO_NID(kaddr) < NR_NODES)
/*
* Common discontigmem stuff.
* PHYS_TO_NID is used by the ARM kernel/setup.c
*/
#define PHYS_TO_NID(addr) PFN_TO_NID((addr) >> PAGE_SHIFT)
#endif
/*
* For BIO. "will die". Kill me when bio_to_phys() and bvec_to_phys() die.
*/
#define page_to_phys(page) (page_to_pfn(page) << PAGE_SHIFT)
/*
* We should really eliminate virt_to_bus() here - it's depreciated.
*/
#define page_to_bus(page) (virt_to_bus(page_address(page)))
#endif
......@@ -125,18 +125,9 @@ static inline int get_order(unsigned long size)
return order;
}
#endif /* !__ASSEMBLY__ */
#include <asm/arch/memory.h>
#define __pa(x) __virt_to_phys((unsigned long)(x))
#define __va(x) ((void *)__phys_to_virt((unsigned long)(x)))
#include <asm/memory.h>
#ifndef CONFIG_DISCONTIGMEM
#define virt_to_page(kaddr) (mem_map + (__pa(kaddr) >> PAGE_SHIFT) - \
(PHYS_OFFSET >> PAGE_SHIFT))
#define VALID_PAGE(page) ((page - mem_map) < max_mapnr)
#endif
#endif /* !__ASSEMBLY__ */
#define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_EXEC | \
VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC)
......
......@@ -11,7 +11,7 @@
#define _ASMARM_PGTABLE_H
#include <linux/config.h>
#include <asm/arch/memory.h>
#include <asm/memory.h>
#include <asm/arch/vmalloc.h>
/*
......@@ -79,21 +79,12 @@ extern void __pgd_error(const char *file, int line, unsigned long val);
extern struct page *empty_zero_page;
#define ZERO_PAGE(vaddr) (empty_zero_page)
#define pte_pfn(pte) (pte_val(pte) >> PAGE_SHIFT)
#define pfn_pte(pfn,prot) (__pte(((pfn) << PAGE_SHIFT) | pgprot_val(prot)))
#define pte_none(pte) (!pte_val(pte))
#define pte_clear(ptep) set_pte((ptep), __pte(0))
#ifndef CONFIG_DISCONTIGMEM
#define pte_page(x) (mem_map + (pte_val((x)) >> PAGE_SHIFT) - \
(PHYS_OFFSET >> PAGE_SHIFT))
#else
/*
* I'm not happy with this - we needlessly convert a physical address
* to a virtual one, and then immediately back to a physical address,
* which, if __va and __pa are expensive causes twice the expense for
* zero gain. --rmk
*/
#define pte_page(x) (virt_to_page(__va(pte_val((x)))))
#endif
#define pte_page(pte) (pfn_to_page(pte_pfn(pte)))
#define pmd_none(pmd) (!pmd_val(pmd))
#define pmd_present(pmd) (pmd_val(pmd))
......@@ -107,12 +98,7 @@ extern struct page *empty_zero_page;
* Conversion functions: convert a page and protection to a page entry,
* and a page entry and page directory to the page they refer to.
*/
static inline pte_t mk_pte_phys(unsigned long physpage, pgprot_t pgprot)
{
return __pte(physpage | pgprot_val(pgprot));
}
#define mk_pte(page,pgprot) mk_pte_phys(__pa(page_address(page)), pgprot)
#define mk_pte(page,prot) pfn_pte(page_to_pfn(page),prot)
/*
* The "pgd_xxx()" functions here are trivial for a folded two-level
......
......@@ -10,77 +10,12 @@
* Structure passed to kernel to tell it about the
* hardware it's running on. See linux/Documentation/arm/Setup
* for more info.
*
* NOTE:
* This file contains two ways to pass information from the boot
* loader to the kernel. The old struct param_struct is deprecated,
* but it will be kept in the kernel for 5 years from now
* (2001). This will allow boot loaders to convert to the new struct
* tag way.
*/
#ifndef __ASMARM_SETUP_H
#define __ASMARM_SETUP_H
/*
* Usage:
* - do not go blindly adding fields, add them at the end
* - when adding fields, don't rely on the address until
* a patch from me has been released
* - unused fields should be zero (for future expansion)
* - this structure is relatively short-lived - only
* guaranteed to contain useful data in setup_arch()
*/
#define COMMAND_LINE_SIZE 1024
/* This is the old deprecated way to pass parameters to the kernel */
struct param_struct {
union {
struct {
unsigned long page_size; /* 0 */
unsigned long nr_pages; /* 4 */
unsigned long ramdisk_size; /* 8 */
unsigned long flags; /* 12 */
#define FLAG_READONLY 1
#define FLAG_RDLOAD 4
#define FLAG_RDPROMPT 8
unsigned long rootdev; /* 16 */
unsigned long video_num_cols; /* 20 */
unsigned long video_num_rows; /* 24 */
unsigned long video_x; /* 28 */
unsigned long video_y; /* 32 */
unsigned long memc_control_reg; /* 36 */
unsigned char sounddefault; /* 40 */
unsigned char adfsdrives; /* 41 */
unsigned char bytes_per_char_h; /* 42 */
unsigned char bytes_per_char_v; /* 43 */
unsigned long pages_in_bank[4]; /* 44 */
unsigned long pages_in_vram; /* 60 */
unsigned long initrd_start; /* 64 */
unsigned long initrd_size; /* 68 */
unsigned long rd_start; /* 72 */
unsigned long system_rev; /* 76 */
unsigned long system_serial_low; /* 80 */
unsigned long system_serial_high; /* 84 */
unsigned long mem_fclk_21285; /* 88 */
} s;
char unused[256];
} u1;
union {
char paths[8][128];
struct {
unsigned long magic;
char n[1024 - sizeof(unsigned long)];
} s;
} u2;
char commandline[COMMAND_LINE_SIZE];
};
/*
* The new way of passing information: a list of tagged entries
*/
/* The list ends with an ATAG_NONE node. */
#define ATAG_NONE 0x00000000
......@@ -131,8 +66,15 @@ struct tag_ramdisk {
};
/* describes where the compressed ramdisk image lives */
/*
* this one accidentally used virtual addresses - as such,
* its depreciated.
*/
#define ATAG_INITRD 0x54410005
/* describes where the compressed ramdisk image lives */
#define ATAG_INITRD2 0x54420005
struct tag_initrd {
u32 start; /* physical start address */
u32 size; /* size of compressed ramdisk image in bytes */
......
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