From 57c4563e2e4cb7a869993de981bfa7b34749e8a9 Mon Sep 17 00:00:00 2001 From: cognet Date: Sun, 2 Dec 2007 14:21:27 +0000 Subject: [PATCH] MFC: arm/at91/kb920x_machdep.c rev 1.24, 1.25 and 1.26 arm/at91/std.at91 rev 1.4 arm/at91/std.kb920x rev 1.5 arm/at91/at91rm92reg.h rev 1.6 conf/options.arm 1.18 Small tweaks to be able to load the kernel at a different address than 0x20000000 + add an option to override the default value of the master clock frequency. arm/at91/if_ate.c rev 1.21: In ate_get_mac(), try to get the mac address in the right order, at least in the same order as it's set in ate_set_mac. arm/conf/HL200: config file for the Hot-e HL200 Approved by: re (kensmith) --- sys/arm/at91/at91rm92reg.h | 2 + sys/arm/at91/if_ate.c | 12 +++--- sys/arm/at91/kb920x_machdep.c | 22 ++++++---- sys/arm/at91/std.at91 | 1 + sys/arm/at91/std.kb920x | 1 - sys/arm/conf/HL200 | 80 ++++++----------------------------- sys/conf/options.arm | 1 + 7 files changed, 35 insertions(+), 84 deletions(-) diff --git a/sys/arm/at91/at91rm92reg.h b/sys/arm/at91/at91rm92reg.h index cb0dfa03d9ed..8d67f4e12eab 100644 --- a/sys/arm/at91/at91rm92reg.h +++ b/sys/arm/at91/at91rm92reg.h @@ -339,7 +339,9 @@ #define AT91RM92_OHCI_BASE 0x00300000 #define AT91RM92_OHCI_SIZE 0x00100000 +#ifndef AT91C_MASTER_CLOCK #define AT91C_MASTER_CLOCK 60000000 +#endif /* SDRAMC */ diff --git a/sys/arm/at91/if_ate.c b/sys/arm/at91/if_ate.c index f2e2df6fca17..961d80a7ae2c 100644 --- a/sys/arm/at91/if_ate.c +++ b/sys/arm/at91/if_ate.c @@ -578,12 +578,12 @@ ate_get_mac(struct ate_softc *sc, u_char *eaddr) */ low = RD4(sc, ETH_SA1L); high = RD4(sc, ETH_SA1H); - eaddr[0] = (high >> 8) & 0xff; - eaddr[1] = high & 0xff; - eaddr[2] = (low >> 24) & 0xff; - eaddr[3] = (low >> 16) & 0xff; - eaddr[4] = (low >> 8) & 0xff; - eaddr[5] = low & 0xff; + eaddr[0] = low & 0xff; + eaddr[1] = (low >> 8) & 0xff; + eaddr[2] = (low >> 16) & 0xff; + eaddr[3] = (low >> 24) & 0xff; + eaddr[4] = high & 0xff; + eaddr[5] = (high >> 8) & 0xff; } static void diff --git a/sys/arm/at91/kb920x_machdep.c b/sys/arm/at91/kb920x_machdep.c index f62504d9fcf3..3df8067aece4 100644 --- a/sys/arm/at91/kb920x_machdep.c +++ b/sys/arm/at91/kb920x_machdep.c @@ -284,10 +284,10 @@ initarm(void *arg, void *arg2) i += 2; fake_preload[i++] = MODINFO_ADDR; fake_preload[i++] = sizeof(vm_offset_t); - fake_preload[i++] = KERNBASE; + fake_preload[i++] = KERNVIRTADDR; fake_preload[i++] = MODINFO_SIZE; fake_preload[i++] = sizeof(uint32_t); - fake_preload[i++] = (uint32_t)&end - KERNBASE; + fake_preload[i++] = (uint32_t)&end - KERNVIRTADDR; #ifdef DDB if (*(uint32_t *)KERNVIRTADDR == MAGIC_TRAMP_NUMBER) { fake_preload[i++] = MODINFO_METADATA|MODINFOMD_SSYM; @@ -369,7 +369,7 @@ initarm(void *arg, void *arg2) for (i = 0; i < KERNEL_PT_KERN_NUM; i++) pmap_link_l2pt(l1pagetable, KERNBASE + i * 0x100000, &kernel_pt_table[KERNEL_PT_KERN + i]); - pmap_map_chunk(l1pagetable, KERNBASE, KERNPHYSADDR, + pmap_map_chunk(l1pagetable, KERNBASE, PHYSADDR, (((uint32_t)(lastaddr) - KERNBASE) + PAGE_SIZE) & ~(PAGE_SIZE - 1), VM_PROT_READ|VM_PROT_WRITE, PTE_CACHE); afterkern = round_page((lastaddr + L1_S_SIZE) & ~(L1_S_SIZE @@ -473,15 +473,19 @@ initarm(void *arg, void *arg2) mutex_init(); i = 0; - dump_avail[0] = KERNPHYSADDR; - dump_avail[1] = KERNPHYSADDR + memsize; + dump_avail[0] = PHYSADDR; + dump_avail[1] = PHYSADDR + memsize; dump_avail[2] = 0; dump_avail[3] = 0; - phys_avail[0] = virtual_avail - KERNVIRTADDR + KERNPHYSADDR; - phys_avail[1] = KERNPHYSADDR + memsize; - phys_avail[2] = 0; - phys_avail[3] = 0; +#if PHYSADDR != KERNPHYSADDR + phys_avail[i++] = PHYSADDR; + phys_avail[i++] = KERNPHYSADDR; +#endif + phys_avail[i++] = virtual_avail - KERNVIRTADDR + KERNPHYSADDR; + phys_avail[i++] = PHYSADDR + memsize; + phys_avail[i++] = 0; + phys_avail[i++] = 0; /* Do basic tuning, hz etc */ init_param1(); init_param2(physmem); diff --git a/sys/arm/at91/std.at91 b/sys/arm/at91/std.at91 index bb320eb26772..b3086484fc42 100644 --- a/sys/arm/at91/std.at91 +++ b/sys/arm/at91/std.at91 @@ -3,3 +3,4 @@ files "../at91/files.at91" cpu CPU_ARM9 makeoptions CONF_CFLAGS=-mcpu=arm9 +options PHYSADDR=0x20000000 diff --git a/sys/arm/at91/std.kb920x b/sys/arm/at91/std.kb920x index 3e8be49cdf15..8af91772e042 100644 --- a/sys/arm/at91/std.kb920x +++ b/sys/arm/at91/std.kb920x @@ -6,5 +6,4 @@ makeoptions KERNPHYSADDR=0x20000000 makeoptions KERNVIRTADDR=0xc0000000 options KERNPHYSADDR=0x20000000 options KERNVIRTADDR=0xc0000000 -options PHYSADDR=0x20000000 options STARTUP_PAGETABLE_ADDR=0x20800000 diff --git a/sys/arm/conf/HL200 b/sys/arm/conf/HL200 index ef07ee654738..7c17ac6175fe 100644 --- a/sys/arm/conf/HL200 +++ b/sys/arm/conf/HL200 @@ -29,10 +29,8 @@ makeoptions KERNPHYSADDR=0x20100000 makeoptions KERNVIRTADDR=0xc0100000 options KERNPHYSADDR=0x20100000 options KERNVIRTADDR=0xc0100000 - #To statically compile in device wiring instead of /boot/device.hints #hints "GENERIC.hints" #Default places to look for devices. -hints "KB920X.hints" makeoptions DEBUG=-g #Build kernel with gdb(1) debug symbols options DDB @@ -48,15 +46,15 @@ options FFS #Berkeley Fast Filesystem #options UFS_DIRHASH #Improve performance on big directories #options MD_ROOT #MD is a potential root device #options MD_ROOT_SIZE=4096 # 3MB ram disk -#options ROOTDEVNAME=\"ufs:/dev/mmcsd0s1a\" +#options ROOTDEVNAME=\"ufs:md0\" options NFSCLIENT #Network Filesystem Client #options NFSSERVER #Network Filesystem Server options NFS_ROOT #NFS usable as /, requires NFSCLIENT -options BOOTP_NFSROOT -options BOOTP -options BOOTP_NFSV3 -options BOOTP_WIRED_TO=ate0 -options BOOTP_COMPAT +options BOOTP_NFSROOT +options BOOTP +options BOOTP_NFSV3 +options BOOTP_WIRED_TO=ate0 +options BOOTP_COMPAT #options MSDOSFS #MSDOS Filesystem #options CD9660 #ISO 9660 Filesystem @@ -70,7 +68,6 @@ options SYSVSEM #SYSV-style semaphores options _KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions #options SYSCTL_OMIT_DESCR options MUTEX_NOINLINE -options RWLOCK_NOINLINE options NO_FFS_SNAPSHOT options NO_SWAPPING device genclock @@ -78,10 +75,10 @@ device random device pty device loop device ether +device nexus device uart device ate -device mii -device lxtphy +device miibus # Debugging for use in -current #options INVARIANTS #Enable calls of extra sanity checking @@ -91,60 +88,7 @@ device lxtphy device mem # Memory and kernel memory devices device md -device at91_twi # TWI: Two Wire Interface -device at91_spi # SPI: -device spibus -# MMC/SD -device at91_mci -device mmc -device mmcsd -# iic -device iic -device iicbus -device icee - -device bpf -# USB support -device ohci # OHCI localbus->USB interface -device usb # USB Bus (required) -#device udbp # USB Double Bulk Pipe devices -device ugen # Generic -device uhid # "Human Interface Devices" -device ulpt # Printer -device umass # Disks/Mass storage - Requires scbus and da -device ural # Ralink Technology RT2500USB wireless NICs -device rum # Ralink Technology RT2501USB wireless NICs -device urio # Diamond Rio 500 MP3 player -device uscanner # Scanners -# USB Ethernet, requires miibus -device miibus -device aue # ADMtek USB Ethernet -device axe # ASIX Electronics USB Ethernet -device cdce # Generic USB over Ethernet -device cue # CATC USB Ethernet -device kue # Kawasaki LSI USB Ethernet -device rue # RealTek RTL8150 USB Ethernet -device udav -# usb serial -device ucom -device uark -device ubsa -device ubser -device uftdi -device uipaq -device uplcom -device uvisor -device uvscom -# SCSI peripherals -device scbus # SCSI bus (required for SCSI) -device da # Direct Access (disks) -device cd # CD -device pass # Passthrough device (direct SCSI access) -# Wireless NIC cards -device wlan # 802.11 support -device wlan_wep # 802.11 WEP support -device wlan_ccmp # 802.11 CCMP support -device wlan_tkip # 802.11 TKIP support -device wlan_amrr # AMRR transmit rate control algorithm -device wlan_scan_ap # 802.11 AP mode scanning -device wlan_scan_sta # 802.11 STA mode scanning +# device at91_twi # TWI: Two Wire Interface +#device at91_spi # SPI: +#device spibus +options ARM32_NEW_VM_LAYOUT diff --git a/sys/conf/options.arm b/sys/conf/options.arm index 9856070ba8f5..8635844605ab 100644 --- a/sys/conf/options.arm +++ b/sys/conf/options.arm @@ -5,6 +5,7 @@ ARM_CACHE_LOCK_ENABLE opt_global.h ARMFPE opt_global.h ARM_KERN_DIRECTMAP opt_vm.h ARM_USE_SMALL_ALLOC opt_global.h +AT91C_MASTER_CLOCK opt_global.h COUNTS_PER_SEC opt_timer.h CPU_SA1100 opt_global.h CPU_SA1110 opt_global.h