Re: [PATCH] linux-2.6.0-test2 h8300 archtecure support update (1/6)

From: Yoshinori Sato (ysato@users.sourceforge.jp)
Date: Wed Jul 30 2003 - 07:20:12 EST


At Tue, 29 Jul 2003 21:20:56 +0200,
Sam Ravnborg wrote:
>
> On Mon, Jul 28, 2003 at 11:18:23PM +0900, Yoshinori Sato wrote:
> > BOARD := $(board-y)
>
> There is no need for renaming this variable, it is only reference three
> times, so board-y would be fine.
> Same goes for MODEL.

Because use MODEL by selection of rom/ram, cannot use it with this intended use.
Do not need to see it outside, I mean if there is not a problem.

> > +
> > +vmlinux.bin: vmlinux
> > + $(OBJCOPY) -Obinary $< $@
> > +
> > +vmlinux.srec: vmlinux
> > + $(OBJCOPY) -Osrec $< $@
> The above is more suited for a seperate boot/ directory.
>
> Example:
> boot := arch/$(ARCH)/boot
> vmlinux.srec vmlinux.bin: vmlinux
> $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@
>
> archclean:
> $(Q)$(MAKE) $(clean)=$(boot)
>
> (The current archclean rule is plain wrong).
>
>
> And in boot/Makefile
>
> OBJCOPYFLAGS_vmlinux.srec := -Osrec
> OBJCOPYFLAGS_vmlinux.bin := -Obinary
> $(obj)/vmlinux.srec $(obj)/vmlinux.bin: vmlinux FORCE
> $(call if_changed,objcopy)
> @echo ' Kernel: $@ is ready'
>
> targets += vmlinux.srec vmlinux.bin
>
>
> > +
> > +define archhelp
> > + echo 'vmlinux.bin - Create raw binary'
> > + echo 'vmlinux.srec - Create srec binary'
> > +endef
> OK - shall stay in arch/$(ARCH)/Makefile
>
> > +
> > +CLEAN_FILES += arch/$(ARCH)/vmlinux.bin arch/$(ARCH)/vmlinux.srec
>
> Replaced by targets assignment in boot/Makefile.
> But you shall add files related to asm-offsets:
> CLEAN_FILES += include/asm-$(ARCH)/asm-offsets.h
>
> Sam

fixed.
thank you.

-- 
Yoshinori Sato
<ysato@users.sourceforge.jp>

diff -Nru linux-2.6.0-test2-h8300/arch/h8300/Makefile linux-2.6.0-test2-h8300-makefix/arch/h8300/Makefile --- linux-2.6.0-test2-h8300/arch/h8300/Makefile 2003-07-28 12:40:08.000000000 +0900 +++ linux-2.6.0-test2-h8300-makefix/arch/h8300/Makefile 2003-07-30 18:42:25.000000000 +0900 @@ -5,7 +5,7 @@ # License. See the file "COPYING" in the main directory of this archive # for more details. # -# (C) Copyright 2002, Yoshinori Sato <ysato@users.sourceforge.jp> +# (C) Copyright 2002,2003 Yoshinori Sato <ysato@users.sourceforge.jp> # ifndef include-config -include $(TOPDIR)/.config @@ -37,8 +37,8 @@ CFLAGS += -mint32 -fno-builtin -Os CFLAGS += -g CFLAGS += -D__linux__ -CFLAGS += -DUTS_SYSNAME=\"uClinux\" -DTARGET=$(BOARD) -AFLAGS += -DPLATFORM=$(PLATFORM) -DTARGET=$(BOARD) -DMODEL=$(MODEL) $(cflags-y) +CFLAGS += -DUTS_SYSNAME=\"uClinux\" +AFLAGS += -DPLATFORM=$(PLATFORM) -DMODEL=$(MODEL) $(cflags-y) LDFLAGS += $(ldflags-y) CROSS_COMPILE = h8300-elf- @@ -53,28 +53,32 @@ libs-y += arch/$(ARCH)/lib/ $(LIBGCC) -export MODEL +boot := arch/h8300/boot + +export MODEL PLATFORM archmrproper: archclean: - $(call descend arch/$(ARCH), subdirclean) + $(Q)$(MAKE) $(clean)=$(boot) + +prepare: include/asm-$(ARCH)/machine-depend.h include/asm-$(ARCH)/asm-offsets.h -prepare: include/asm-$(ARCH)/asm-offsets.h +include/asm-$(ARCH)/machine-depend.h: include/asm-$(ARCH)/$(BOARD)/machine-depend.h + $(Q)ln -sf $(BOARD)/machine-depend.h \ + include/asm-$(ARCH)/machine-depend.h + @echo ' Create include/asm-$(ARCH)/machine-depend.h' include/asm-$(ARCH)/asm-offsets.h: arch/$(ARCH)/kernel/asm-offsets.s \ include/asm include/linux/version.h $(call filechk,gen-asm-offsets) -vmlinux.bin: vmlinux - $(OBJCOPY) -Obinary $< $@ - -vmlinux.srec: vmlinux - $(OBJCOPY) -Osrec $< $@ +vmlinux.srec vmlinux.bin: vmlinux + $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@ define archhelp echo 'vmlinux.bin - Create raw binary' echo 'vmlinux.srec - Create srec binary' endef -CLEAN_FILES += arch/$(ARCH)/vmlinux.bin arch/$(ARCH)/vmlinux.srec +CLEAN_FILES += include/asm-$(ARCH)/asm-offsets.h include/asm-$(ARCH)/machine-depend.h diff -Nru linux-2.6.0-test2-h8300/arch/h8300/boot/Makefile linux-2.6.0-test2-h8300-makefix/arch/h8300/boot/Makefile --- linux-2.6.0-test2-h8300/arch/h8300/boot/Makefile 1970-01-01 09:00:00.000000000 +0900 +++ linux-2.6.0-test2-h8300-makefix/arch/h8300/boot/Makefile 2003-07-30 19:35:31.000000000 +0900 @@ -0,0 +1,12 @@ +# arch/h8300/boot/Makefile + +targets := vmlinux.srec vmlinux.bin + +OBCOPYFLAGS_vmlinux.srec := -Osrec +OBCOPYFLAGS_vmlinux.bin := -Obin + +$(obj)/vmlinux.srec $(obj)/vmlinux.bin: vmlinux FORCE + $(call if_changed,objcopy) + @echo ' Kernel: $@ is ready' + +CLEAN_FILES += arch/$(ARCH)/vmlinux.bin arch/$(ARCH)/vmlinux.srec diff -Nru linux-2.6.0-test2-h8300/include/asm-h8300/aki3068net/machine-depend.h linux-2.6.0-test2-h8300-makefix/include/asm-h8300/aki3068net/machine-depend.h --- linux-2.6.0-test2-h8300/include/asm-h8300/aki3068net/machine-depend.h 1970-01-01 09:00:00.000000000 +0900 +++ linux-2.6.0-test2-h8300-makefix/include/asm-h8300/aki3068net/machine-depend.h 2003-07-30 18:42:26.000000000 +0900 @@ -0,0 +1,35 @@ +/* AE-3068 board depend header */ + +/* TIMER rate define */ +#ifdef H8300_TIMER_DEFINE +#include <linux/config.h> +#define H8300_TIMER_COUNT_DATA 20000*10/8192 +#define H8300_TIMER_FREQ 20000*1000/8192 +#endif + +/* AE-3068 RTL8019AS Config */ +#ifdef H8300_NE_DEFINE + +#define NE2000_ADDR 0x200000 +#define NE2000_IRQ 5 +#define NE2000_IRQ_VECTOR (12 + NE2000_IRQ) +#define NE2000_BYTE volatile unsigned short + +#define IER 0xfee015 +#define ISR 0xfee016 +#define IRQ_MASK (1 << NE2000_IRQ) + +#define WCRL 0xfee023 +#define MAR0A 0xffff20 +#define ETCR0A 0xffff24 +#define DTCR0A 0xffff27 +#define MAR0B 0xffff28 +#define DTCR0B 0xffff2f + +#define H8300_INIT_NE() \ +do { \ + wordlength = 1; \ + outb_p(0x48, ioaddr + EN0_DCFG); \ +} while(0) + +#endif diff -Nru linux-2.6.0-test2-h8300/include/asm-h8300/aki3068net/ne.h linux-2.6.0-test2-h8300-makefix/include/asm-h8300/aki3068net/ne.h --- linux-2.6.0-test2-h8300/include/asm-h8300/aki3068net/ne.h 2003-07-19 21:41:33.000000000 +0900 +++ linux-2.6.0-test2-h8300-makefix/include/asm-h8300/aki3068net/ne.h 1970-01-01 09:00:00.000000000 +0900 @@ -1,28 +0,0 @@ -/* AE-3068 (aka. aki3068net) RTL8019AS Config */ - -#ifndef __H8300_AKI3068NET_NE__ -#define __H8300_AKI3068NET_NE__ - -#define NE2000_ADDR 0x200000 -#define NE2000_IRQ 5 -#define NE2000_IRQ_VECTOR (12 + NE2000_IRQ) -#define NE2000_BYTE volatile unsigned short - -#define IER 0xfee015 -#define ISR 0xfee016 -#define IRQ_MASK (1 << NE2000_IRQ) - -#define WCRL 0xfee023 -#define MAR0A 0xffff20 -#define ETCR0A 0xffff24 -#define DTCR0A 0xffff27 -#define MAR0B 0xffff28 -#define DTCR0B 0xffff2f - -#define H8300_INIT_NE() \ -do { \ - wordlength = 1; \ - outb_p(0x48, ioaddr + EN0_DCFG); \ -} while(0) - -#endif diff -Nru linux-2.6.0-test2-h8300/include/asm-h8300/aki3068net/timer_rate.h linux-2.6.0-test2-h8300-makefix/include/asm-h8300/aki3068net/timer_rate.h --- linux-2.6.0-test2-h8300/include/asm-h8300/aki3068net/timer_rate.h 2003-07-20 01:19:25.000000000 +0900 +++ linux-2.6.0-test2-h8300-makefix/include/asm-h8300/aki3068net/timer_rate.h 1970-01-01 09:00:00.000000000 +0900 @@ -1,9 +0,0 @@ -#ifndef __H8300_AKI3068NET_TIMER_RATE__ -#define __H8300_AKI3068NET_TIMER_RATE__ - -#include <linux/config.h> - -#define H8300_TIMER_COUNT_DATA CONFIG_CPU_CLOCK*10/8192 -#define H8300_TIMER_FREQ CONFIG_CPU_CLOCK*1000/8192 - -#endif diff -Nru linux-2.6.0-test2-h8300/include/asm-h8300/edosk2674/machine-depend.h linux-2.6.0-test2-h8300-makefix/include/asm-h8300/edosk2674/machine-depend.h --- linux-2.6.0-test2-h8300/include/asm-h8300/edosk2674/machine-depend.h 1970-01-01 09:00:00.000000000 +0900 +++ linux-2.6.0-test2-h8300-makefix/include/asm-h8300/edosk2674/machine-depend.h 2003-07-30 18:42:26.000000000 +0900 @@ -0,0 +1,70 @@ +/* EDOSK2674 board depend header */ + +/* TIMER rate define */ +#ifdef H8300_TIMER_DEFINE +#define H8300_TIMER_COUNT_DATA 33000*10/8192 +#define H8300_TIMER_FREQ 33000*1000/8192 +#endif + +/* EDOSK-2674R SMSC Network Controler Target Depend impliments */ +#ifdef H8300_SMSC_DEFINE + +#define SMSC_BASE 0xf80000 +#define SMSC_IRQ 16 + +/* sorry quick hack */ +#if defined(outw) +# undef outw +#endif +#define outw(d,a) edosk2674_smsc_outw(d,(volatile unsigned short *)(a)) +#if defined(inw) +# undef inw +#endif +#define inw(a) edosk2674_smsc_inw((volatile unsigned short *)(a)) +#if defined(outsw) +# undef outsw +#endif +#define outsw(a,p,l) edosk2674_smsc_outsw((volatile unsigned short *)(a),p,l) +#if defined(insw) +# undef insw +#endif +#define insw(a,p,l) edosk2674_smsc_insw((volatile unsigned short *)(a),p,l) + +static inline void edosk2674_smsc_outw( + unsigned short d, + volatile unsigned short *a + ) +{ + *a = (d >> 8) | (d << 8); +} + +static inline unsigned short edosk2674_smsc_inw( + volatile unsigned short *a + ) +{ + unsigned short d; + d = *a; + return (d >> 8) | (d << 8); +} + +static inline void edosk2674_smsc_outsw( + volatile unsigned short *a, + unsigned short *p, + unsigned long l + ) +{ + for (; l != 0; --l, p++) + *a = *p; +} + +static inline void edosk2674_smsc_insw( + volatile unsigned short *a, + unsigned short *p, + unsigned long l + ) +{ + for (; l != 0; --l, p++) + *p = *a; +} + +#endif diff -Nru linux-2.6.0-test2-h8300/include/asm-h8300/edosk2674/timer_rate.h linux-2.6.0-test2-h8300-makefix/include/asm-h8300/edosk2674/timer_rate.h --- linux-2.6.0-test2-h8300/include/asm-h8300/edosk2674/timer_rate.h 2003-07-20 01:18:09.000000000 +0900 +++ linux-2.6.0-test2-h8300-makefix/include/asm-h8300/edosk2674/timer_rate.h 1970-01-01 09:00:00.000000000 +0900 @@ -1,4 +0,0 @@ -#include <linux/config.h> - -#define H8300_TIMER_COUNT_DATA CONFIG_CPU_CLOCK*10/8192 -#define H8300_TIMER_FREQ CONFIG_CPU_CLOCK*1000/8192 diff -Nru linux-2.6.0-test2-h8300/include/asm-h8300/generic/machine-depend.h linux-2.6.0-test2-h8300-makefix/include/asm-h8300/generic/machine-depend.h --- linux-2.6.0-test2-h8300/include/asm-h8300/generic/machine-depend.h 1970-01-01 09:00:00.000000000 +0900 +++ linux-2.6.0-test2-h8300-makefix/include/asm-h8300/generic/machine-depend.h 2003-07-30 18:42:26.000000000 +0900 @@ -0,0 +1,17 @@ +/* machine depend header */ + +/* TIMER rate define */ +#ifdef H8300_TIMER_DEFINE +#include <linux/config.h> +#if defined(CONFIG_H83007) || defined(CONFIG_H83068) || defined(CONFIG_H8S2678) +#define H8300_TIMER_COUNT_DATA CONFIG_CPU_CLOCK*10/8192 +#define H8300_TIMER_FREQ CONFIG_CPU_CLOCK*1000/8192 +#endif + +#if defined(CONFIG_H8_3002) || defined(CONFIG_H83048) +#define H8300_TIMER_COUNT_DATA CONFIG_CPU_CLOCK*10/8 +#define H8300_TIMER_FREQ CONFIG_CPU_CLOCK*1000/8 +#endif + +#endif + diff -Nru linux-2.6.0-test2-h8300/include/asm-h8300/generic/timer_rate.h linux-2.6.0-test2-h8300-makefix/include/asm-h8300/generic/timer_rate.h --- linux-2.6.0-test2-h8300/include/asm-h8300/generic/timer_rate.h 2003-07-19 21:41:33.000000000 +0900 +++ linux-2.6.0-test2-h8300-makefix/include/asm-h8300/generic/timer_rate.h 1970-01-01 09:00:00.000000000 +0900 @@ -1,15 +0,0 @@ -#include <linux/config.h> - -#if defined(CONFIG_H83007) || defined(CONFIG_H83068) || defined(CONFIG_H8S2678) -#define H8300_TIMER_COUNT_DATA CONFIG_CPU_CLOCK*10/8192 -#define H8300_TIMER_FREQ CONFIG_CPU_CLOCK*1000/8192 -#endif - -#if defined(H8_3002) || defined(CONFIG_H83048) -#define H8300_TIMER_COUNT_DATA CONFIG_CPU_CLOCK*10/8 -#define H8300_TIMER_FREQ CONFIG_CPU_CLOCK*1000/8 -#endif - -#if !defined(H8300_TIMER_COUNT_DATA) -#error illigal configuration -#endif diff -Nru linux-2.6.0-test2-h8300/include/asm-h8300/h8300_ne.h linux-2.6.0-test2-h8300-makefix/include/asm-h8300/h8300_ne.h --- linux-2.6.0-test2-h8300/include/asm-h8300/h8300_ne.h 2003-07-14 15:04:49.000000000 +0900 +++ linux-2.6.0-test2-h8300-makefix/include/asm-h8300/h8300_ne.h 2003-07-30 17:41:06.000000000 +0900 @@ -11,9 +11,9 @@ #define h8300ne_h /****************************************************************************/ -/* Such a description is OK ? */ -#define DEPEND_HEADER(target) <asm/target/ne.h> -#include DEPEND_HEADER(TARGET) +#define H8300_NE_DEFINE +#include <asm/machine-depend.h> +#undef H8300_NE_DEFINE /****************************************************************************/ #endif /* h8300ne_h */ diff -Nru linux-2.6.0-test2-h8300/include/asm-h8300/h8max/ide.h linux-2.6.0-test2-h8300-makefix/include/asm-h8300/h8max/ide.h --- linux-2.6.0-test2-h8300/include/asm-h8300/h8max/ide.h 2003-07-14 15:04:49.000000000 +0900 +++ linux-2.6.0-test2-h8300-makefix/include/asm-h8300/h8max/ide.h 1970-01-01 09:00:00.000000000 +0900 @@ -1,60 +0,0 @@ -/* H8MAX IDE I/F Config */ - -#define H8300_IDE_BASE 0x200000 -#define H8300_IDE_CTRL 0x60000c -#define H8300_IDE_IRQ 5 -#define H8300_IDE_REG_OFFSET 2 - -#undef outb -#undef inb -#undef outb_p -#undef inb_p -#undef outsw -#undef insw - -#define outb(d,a) h8max_outb(d,(unsigned short *)a) -#define inb(a) h8max_inb((unsigned char *)a) -#define outb_p(d,a) h8max_outb(d,(unsigned short *)a) -#define inb_p(a) h8max_inb((unsigned char *)a) -#define outsw(addr,buf,len) h8max_outsw(addr,buf,len); -#define insw(addr,buf,len) h8max_insw(addr,buf,len); - -static inline void h8max_outb(unsigned short d,unsigned short *a) -{ - *a = d; -} - -static inline unsigned char h8max_inb(unsigned char *a) -{ - return *(a+1); -} - -static inline void h8max_outsw(void *addr, void *buf, int len) -{ - unsigned volatile short *ap = (unsigned volatile short *)addr; - unsigned short *bp = (unsigned short *)buf; - unsigned short d; - while(len--) { - d = *bp++; - *ap = (d >> 8) | (d << 8); - } -} - -static inline void h8max_insw(void *addr, void *buf, int len) -{ - unsigned volatile short *ap = (unsigned volatile short *)addr; - unsigned short *bp = (unsigned short *)buf; - unsigned short d; - while(len--) { - d = *ap; - *bp++ = (d >> 8) | (d << 8); - } -} - -static inline void target_ide_fix_driveid(struct hd_driveid *id) -{ - int c; - unsigned short *p = (unsigned short *)id; - for (c = 0; c < SECTOR_WORDS; c++, p++) - *p = (*p >> 8) | (*p << 8); -} diff -Nru linux-2.6.0-test2-h8300/include/asm-h8300/h8max/machine-depend.h linux-2.6.0-test2-h8300-makefix/include/asm-h8300/h8max/machine-depend.h --- linux-2.6.0-test2-h8300/include/asm-h8300/h8max/machine-depend.h 1970-01-01 09:00:00.000000000 +0900 +++ linux-2.6.0-test2-h8300-makefix/include/asm-h8300/h8max/machine-depend.h 2003-07-30 18:42:26.000000000 +0900 @@ -0,0 +1,167 @@ +/* H8MAX board depend header */ + +/* TIMER rate define */ +#ifdef H8300_TIMER_DEFINE +#define H8300_TIMER_COUNT_DATA 25000*10/8192 +#define H8300_TIMER_FREQ 25000*1000/8192 +#endif + +/* H8MAX RTL8019AS Config */ +#ifdef H8300_NE_DEFINE + +#define NE2000_ADDR 0x800600 +#define NE2000_IRQ 4 +#define NE2000_IRQ_VECTOR (12 + NE2000_IRQ) +#define NE2000_BYTE volatile unsigned short + +#define IER 0xfee015 +#define ISR 0xfee016 +#define IRQ_MASK (1 << NE2000_IRQ) +/* sorry quick hack */ +#if defined(outb) +# undef outb +#endif +#define outb(d,a) h8max_outb((d),(a) - NE2000_ADDR) +#if defined(inb) +# undef inb +#endif +#define inb(a) h8max_inb((a) - NE2000_ADDR) +#if defined(outb_p) +# undef outb_p +#endif +#define outb_p(d,a) h8max_outb((d),(a) - NE2000_ADDR) +#if defined(inb_p) +# undef inb_p +#endif +#define inb_p(a) h8max_inb((a) - NE2000_ADDR) +#if defined(outsw) +# undef outsw +#endif +#define outsw(a,p,l) h8max_outsw((a) - NE2000_ADDR,(unsigned short *)p,l) +#if defined(insw) +# undef insw +#endif +#define insw(a,p,l) h8max_insw((a) - NE2000_ADDR,(unsigned short *)p,l) +#if defined(outsb) +# undef outsb +#endif +#define outsb(a,p,l) h8max_outsb((a) - NE2000_ADDR,(unsigned char *)p,l) +#if defined(insb) +# undef insb +#endif +#define insb(a,p,l) h8max_insb((a) - NE2000_ADDR,(unsigned char *)p,l) + +#define H8300_INIT_NE() \ +do { \ + wordlength = 2; \ + h8max_outb(0x49, ioaddr + EN0_DCFG); \ + SA_prom[14] = SA_prom[15] = 0x57;\ +} while(0) + +static inline void h8max_outb(unsigned char d,unsigned char a) +{ + *(unsigned short *)(NE2000_ADDR + (a << 1)) = d; +} + +static inline unsigned char h8max_inb(unsigned char a) +{ + return *(unsigned char *)(NE2000_ADDR + (a << 1) +1); +} + +static inline void h8max_outsw(unsigned char a,unsigned short *p,unsigned long l) +{ + unsigned short d; + for (; l != 0; --l, p++) { + d = (((*p) >> 8) & 0xff) | ((*p) << 8); + *(unsigned short *)(NE2000_ADDR + (a << 1)) = d; + } +} + +static inline void h8max_insw(unsigned char a,unsigned short *p,unsigned long l) +{ + unsigned short d; + for (; l != 0; --l, p++) { + d = *(unsigned short *)(NE2000_ADDR + (a << 1)); + *p = (d << 8)|((d >> 8) & 0xff); + } +} + +static inline void h8max_outsb(unsigned char a,unsigned char *p,unsigned long l) +{ + for (; l != 0; --l, p++) { + *(unsigned short *)(NE2000_ADDR + (a << 1)) = *p; + } +} + +static inline void h8max_insb(unsigned char a,unsigned char *p,unsigned long l) +{ + for (; l != 0; --l, p++) { + *p = *((unsigned char *)(NE2000_ADDR + (a << 1))+1); + } +} + +#endif + +/* H8MAX IDE I/F Config */ +#ifdef H8300_IDE_DEFINE + +#define H8300_IDE_BASE 0x200000 +#define H8300_IDE_CTRL 0x60000c +#define H8300_IDE_IRQ 5 +#define H8300_IDE_REG_OFFSET 2 + +#undef outb +#undef inb +#undef outb_p +#undef inb_p +#undef outsw +#undef insw + +#define outb(d,a) h8max_outb(d,(unsigned short *)a) +#define inb(a) h8max_inb((unsigned char *)a) +#define outb_p(d,a) h8max_outb(d,(unsigned short *)a) +#define inb_p(a) h8max_inb((unsigned char *)a) +#define outsw(addr,buf,len) h8max_outsw(addr,buf,len); +#define insw(addr,buf,len) h8max_insw(addr,buf,len); + +static inline void h8max_outb(unsigned short d,unsigned short *a) +{ + *a = d; +} + +static inline unsigned char h8max_inb(unsigned char *a) +{ + return *(a+1); +} + +static inline void h8max_outsw(void *addr, void *buf, int len) +{ + unsigned volatile short *ap = (unsigned volatile short *)addr; + unsigned short *bp = (unsigned short *)buf; + unsigned short d; + while(len--) { + d = *bp++; + *ap = (d >> 8) | (d << 8); + } +} + +static inline void h8max_insw(void *addr, void *buf, int len) +{ + unsigned volatile short *ap = (unsigned volatile short *)addr; + unsigned short *bp = (unsigned short *)buf; + unsigned short d; + while(len--) { + d = *ap; + *bp++ = (d >> 8) | (d << 8); + } +} + +static inline void target_ide_fix_driveid(struct hd_driveid *id) +{ + int c; + unsigned short *p = (unsigned short *)id; + for (c = 0; c < SECTOR_WORDS; c++, p++) + *p = (*p >> 8) | (*p << 8); +} + +#endif diff -Nru linux-2.6.0-test2-h8300/include/asm-h8300/h8max/ne.h linux-2.6.0-test2-h8300-makefix/include/asm-h8300/h8max/ne.h --- linux-2.6.0-test2-h8300/include/asm-h8300/h8max/ne.h 2003-07-19 21:41:33.000000000 +0900 +++ linux-2.6.0-test2-h8300-makefix/include/asm-h8300/h8max/ne.h 1970-01-01 09:00:00.000000000 +0900 @@ -1,97 +0,0 @@ -/* H8MAX RTL8019AS Config */ - -#ifndef __H8300_H8MAX_NE__ -#define __H8300_H8MAX_NE__ - -#define NE2000_ADDR 0x800600 -#define NE2000_IRQ 4 -#define NE2000_IRQ_VECTOR (12 + NE2000_IRQ) -#define NE2000_BYTE volatile unsigned short - -#define IER 0xfee015 -#define ISR 0xfee016 -#define IRQ_MASK (1 << NE2000_IRQ) -/* sorry quick hack */ -#if defined(outb) -# undef outb -#endif -#define outb(d,a) h8max_outb((d),(a) - NE2000_ADDR) -#if defined(inb) -# undef inb -#endif -#define inb(a) h8max_inb((a) - NE2000_ADDR) -#if defined(outb_p) -# undef outb_p -#endif -#define outb_p(d,a) h8max_outb((d),(a) - NE2000_ADDR) -#if defined(inb_p) -# undef inb_p -#endif -#define inb_p(a) h8max_inb((a) - NE2000_ADDR) -#if defined(outsw) -# undef outsw -#endif -#define outsw(a,p,l) h8max_outsw((a) - NE2000_ADDR,(unsigned short *)p,l) -#if defined(insw) -# undef insw -#endif -#define insw(a,p,l) h8max_insw((a) - NE2000_ADDR,(unsigned short *)p,l) -#if defined(outsb) -# undef outsb -#endif -#define outsb(a,p,l) h8max_outsb((a) - NE2000_ADDR,(unsigned char *)p,l) -#if defined(insb) -# undef insb -#endif -#define insb(a,p,l) h8max_insb((a) - NE2000_ADDR,(unsigned char *)p,l) - -#define H8300_INIT_NE() \ -do { \ - wordlength = 2; \ - h8max_outb(0x49, ioaddr + EN0_DCFG); \ - SA_prom[14] = SA_prom[15] = 0x57;\ -} while(0) - -static inline void h8max_outb(unsigned char d,unsigned char a) -{ - *(unsigned short *)(NE2000_ADDR + (a << 1)) = d; -} - -static inline unsigned char h8max_inb(unsigned char a) -{ - return *(unsigned char *)(NE2000_ADDR + (a << 1) +1); -} - -static inline void h8max_outsw(unsigned char a,unsigned short *p,unsigned long l) -{ - unsigned short d; - for (; l != 0; --l, p++) { - d = (((*p) >> 8) & 0xff) | ((*p) << 8); - *(unsigned short *)(NE2000_ADDR + (a << 1)) = d; - } -} - -static inline void h8max_insw(unsigned char a,unsigned short *p,unsigned long l) -{ - unsigned short d; - for (; l != 0; --l, p++) { - d = *(unsigned short *)(NE2000_ADDR + (a << 1)); - *p = (d << 8)|((d >> 8) & 0xff); - } -} - -static inline void h8max_outsb(unsigned char a,unsigned char *p,unsigned long l) -{ - for (; l != 0; --l, p++) { - *(unsigned short *)(NE2000_ADDR + (a << 1)) = *p; - } -} - -static inline void h8max_insb(unsigned char a,unsigned char *p,unsigned long l) -{ - for (; l != 0; --l, p++) { - *p = *((unsigned char *)(NE2000_ADDR + (a << 1))+1); - } -} - -#endif diff -Nru linux-2.6.0-test2-h8300/include/asm-h8300/h8max/timer_rate.h linux-2.6.0-test2-h8300-makefix/include/asm-h8300/h8max/timer_rate.h --- linux-2.6.0-test2-h8300/include/asm-h8300/h8max/timer_rate.h 2003-07-20 01:19:25.000000000 +0900 +++ linux-2.6.0-test2-h8300-makefix/include/asm-h8300/h8max/timer_rate.h 1970-01-01 09:00:00.000000000 +0900 @@ -1,10 +0,0 @@ -#ifndef __H8300_H8MAX_TIMER_RATE__ -#define __H8300_H8MAX_TIMER_RATE__ - -#include <linux/config.h> - -#define H8300_TIMER_COUNT_DATA CONFIG_CPU_CLOCK*10/8192 -#define H8300_TIMER_FREQ CONFIG_CPU_CLOCK*1000/8192 - -#endif - diff -Nru linux-2.6.0-test2-h8300/include/asm-h8300/ide.h linux-2.6.0-test2-h8300-makefix/include/asm-h8300/ide.h --- linux-2.6.0-test2-h8300/include/asm-h8300/ide.h 2003-07-14 15:04:49.000000000 +0900 +++ linux-2.6.0-test2-h8300-makefix/include/asm-h8300/ide.h 2003-07-30 17:41:06.000000000 +0900 @@ -70,9 +70,10 @@ * Our list of ports/irq's for different boards. */ -/* Such a description is OK ? */ -#define DEPEND_HEADER(target) <asm/target/ide.h> -#include DEPEND_HEADER(TARGET) +/* machine depend header include */ +#define H8300_IDE_DEFINE +#include <asm/machine-depend.h> +#undef H8300_IDE_DEFINE /****************************************************************************/ diff -Nru linux-2.6.0-test2-h8300/include/asm-h8300/machine-depend.h linux-2.6.0-test2-h8300-makefix/include/asm-h8300/machine-depend.h --- linux-2.6.0-test2-h8300/include/asm-h8300/machine-depend.h 1970-01-01 09:00:00.000000000 +0900 +++ linux-2.6.0-test2-h8300-makefix/include/asm-h8300/machine-depend.h 2003-07-30 18:42:26.000000000 +0900 @@ -0,0 +1,70 @@ +/* EDOSK2674 board depend header */ + +/* TIMER rate define */ +#ifdef H8300_TIMER_DEFINE +#define H8300_TIMER_COUNT_DATA 33000*10/8192 +#define H8300_TIMER_FREQ 33000*1000/8192 +#endif + +/* EDOSK-2674R SMSC Network Controler Target Depend impliments */ +#ifdef H8300_SMSC_DEFINE + +#define SMSC_BASE 0xf80000 +#define SMSC_IRQ 16 + +/* sorry quick hack */ +#if defined(outw) +# undef outw +#endif +#define outw(d,a) edosk2674_smsc_outw(d,(volatile unsigned short *)(a)) +#if defined(inw) +# undef inw +#endif +#define inw(a) edosk2674_smsc_inw((volatile unsigned short *)(a)) +#if defined(outsw) +# undef outsw +#endif +#define outsw(a,p,l) edosk2674_smsc_outsw((volatile unsigned short *)(a),p,l) +#if defined(insw) +# undef insw +#endif +#define insw(a,p,l) edosk2674_smsc_insw((volatile unsigned short *)(a),p,l) + +static inline void edosk2674_smsc_outw( + unsigned short d, + volatile unsigned short *a + ) +{ + *a = (d >> 8) | (d << 8); +} + +static inline unsigned short edosk2674_smsc_inw( + volatile unsigned short *a + ) +{ + unsigned short d; + d = *a; + return (d >> 8) | (d << 8); +} + +static inline void edosk2674_smsc_outsw( + volatile unsigned short *a, + unsigned short *p, + unsigned long l + ) +{ + for (; l != 0; --l, p++) + *a = *p; +} + +static inline void edosk2674_smsc_insw( + volatile unsigned short *a, + unsigned short *p, + unsigned long l + ) +{ + for (; l != 0; --l, p++) + *p = *a; +} + +#endif diff -Nru linux-2.6.0-test2-h8300/include/asm-h8300/timex.h linux-2.6.0-test2-h8300-makefix/include/asm-h8300/timex.h --- linux-2.6.0-test2-h8300/include/asm-h8300/timex.h 2003-07-14 15:04:49.000000000 +0900 +++ linux-2.6.0-test2-h8300-makefix/include/asm-h8300/timex.h 2003-07-30 17:41:06.000000000 +0900 @@ -6,9 +6,9 @@ #ifndef _ASM_H8300_TIMEX_H #define _ASM_H8300_TIMEX_H -/* Such a description is OK ? */ -#define TIMEX_DEPEND_HEADER(target) <asm/target/timer_rate.h> -#include TIMEX_DEPEND_HEADER(TARGET) +#define H8300_TIMER_DEFINE +#include <asm/machine-depend.h> +#undef H8300_TIMER_DEFINE #define CLOCK_TICK_RATE H8300_TIMER_FREQ #define CLOCK_TICK_FACTOR 20 /* Factor of both 1000000 and CLOCK_TICK_RATE */ - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Thu Jul 31 2003 - 22:00:45 EST