From owner-p4-projects@FreeBSD.ORG Sat Jun 10 18:11:31 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id B2A8416A473; Sat, 10 Jun 2006 18:11:31 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 76E0416A41F for ; Sat, 10 Jun 2006 18:11:31 +0000 (UTC) (envelope-from imp@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 08BBD43D70 for ; Sat, 10 Jun 2006 18:11:31 +0000 (GMT) (envelope-from imp@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k5AI9Ocb070541 for ; Sat, 10 Jun 2006 18:09:24 GMT (envelope-from imp@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k5AI9O3A070538 for perforce@freebsd.org; Sat, 10 Jun 2006 18:09:24 GMT (envelope-from imp@freebsd.org) Date: Sat, 10 Jun 2006 18:09:24 GMT Message-Id: <200606101809.k5AI9O3A070538@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to imp@freebsd.org using -f From: Warner Losh To: Perforce Change Reviews Cc: Subject: PERFORCE change 98926 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Jun 2006 18:11:31 -0000 http://perforce.freebsd.org/chv.cgi?CH=98926 Change 98926 by imp@imp_lighthouse on 2006/06/10 18:09:18 Initialize the SD card, load the first 16MB of the card into RAM and jump to it. This is a big hack to get something that we can boot off of. the SPI part is too small w/o compression, and compression doesn't work for large kernels (and kernels?) with big ram disks. Affected files ... .. //depot/projects/arm/src/sys/boot/arm/at91/bootsd/Makefile#2 edit .. //depot/projects/arm/src/sys/boot/arm/at91/bootsd/main.c#2 edit Differences ... ==== //depot/projects/arm/src/sys/boot/arm/at91/bootsd/Makefile#2 (text+ko) ==== @@ -15,3 +15,4 @@ .if ${MK_FPGA} != "no" CFLAGS += -DTSC_FPGA .endif +CFLAGS += -I${.CURDIR}/../bootspi ==== //depot/projects/arm/src/sys/boot/arm/at91/bootsd/main.c#2 (text+ko) ==== @@ -39,6 +39,7 @@ #include "emac.h" #include "lib.h" #include "spi_flash.h" +#include "sd-card.h" #ifdef TSC_FPGA #include "fpga.h" @@ -73,9 +74,13 @@ } #endif +unsigned char mac[6] = { 0x42, 0x53, 0x44, 0, 0, 1 }; + int main(void) { + unsigned low_addr, high_addr; + printf("\r\nTSC SD Card boot...\r\n"); SPI_InitFlash(); #ifdef TSC_FPGA @@ -86,5 +91,11 @@ AT91C_BASE_PIOC->PIO_SODR = AT91C_PIO_PC7; #endif EMAC_Init(); + sdcard_init(); + low_addr = (mac[3] << 24) | (mac[2] << 16) | (mac[1] << 8) | mac[0]; + high_addr = (mac[5] << 8) | mac[4]; + SetMACAddress(low_addr, high_addr); + MCI_read((char *)0x20000000, 0, 16 << 20); + ((void(*)())0x20000000)(); return (1); }