Update of /cvsroot/blob/blob/src/blob In directory sc8-pr-cvs1:/tmp/cvs-serv20927/src/blob Modified Files: Makefile.am accelent_sa.c assabet.c badge4.c brutus.c cep.c clart.c frodo.c h3600.c hackkit.c idr.c jornada720.c lart.c lubbock.c miniprint.c nesa.c pleb.c pxa_idp.c shannon.c system3.c trizeps.c Added Files: ledasm-mmap.S ledasm-sa11x0.S Removed Files: ledasm.S Log Message: LED driver modularisation from Kevin O'Neill. --- NEW FILE: ledasm-mmap.S --- /* * ledasm-mmap.S: simple LED control code for a memory mapped arch * * Copyright (C) 2003 by SOMA Networks, Inc. * * Derived from: * Copyright (C) 2001 Erik Mouw (J.A...@it...) * * $Id: ledasm-mmap.S,v 1.1 2003/02/13 01:10:53 erikm Exp $ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ .ident "$Id: ledasm-mmap.S,v 1.1 2003/02/13 01:10:53 erikm Exp $" #ifdef HAVE_CONFIG_H # include <blob/config.h> #endif #include <blob/arch.h> .globl ledinit ledinit: mov pc, lr .globl led_on /* turn LED on. clobbers r0 and r1 */ led_on: ldr r0, =LED_ADDR ldr r1, =LED_ON str r1, [r0] ldr r1, [r0] mov pc, lr .globl led_off /* turn LED off. clobbers r0 - r1 */ led_off: ldr r0, =LED_ADDR ldr r1, =LED_OFF str r1, [r0] ldr r1, [r0] mov pc, lr .globl led_blink led_blink: mov pc, lr --- NEW FILE: ledasm-sa11x0.S --- /* * ledasm-sa11x0.S: simple LED control code * * Copyright (C) 2001 Erik Mouw (J.A...@it...) * * $Id: ledasm-sa11x0.S,v 1.1 2003/02/13 01:10:53 erikm Exp $ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ /* * Documentation: * [1] Intel Corporation, "Intel StrongARM SA-1100 Microprocessor * Developer's Manual", April 1999 * [2] Intel Corporation, "Intel StrongARM SA-1110 Microprocessor * Advanced Developer's manual, December 1999 */ .ident "$Id: ledasm-sa11x0.S,v 1.1 2003/02/13 01:10:53 erikm Exp $" #ifdef HAVE_CONFIG_H # include <blob/config.h> #endif #include <blob/arch.h> .text LED: .long LED_GPIO GPIO_BASE: .long 0x90040000 #define GPDR 0x00000004 #define GPSR 0x00000008 #define GPCR 0x0000000c .globl ledinit /* initialise LED GPIO and turn LED on. * clobbers r0 and r1 */ ledinit: #if defined (NO_GPIO_LED_SUPPORT) mov pc, lr #endif ldr r0, GPIO_BASE ldr r1, LED str r1, [r0, #GPDR] /* LED GPIO is output */ str r1, [r0, #GPSR] /* turn LED on */ mov pc, lr .globl led_on /* turn LED on. clobbers r0 and r1 */ led_on: #if defined (NO_GPIO_LED_SUPPORT) mov pc, lr #endif ldr r0, GPIO_BASE ldr r1, LED str r1, [r0, #GPSR] mov pc, lr .globl led_off /* turn LED off. clobbers r0 - r2 */ led_off: #if defined (NO_GPIO_LED_SUPPORT) mov pc, lr #endif ldr r0, GPIO_BASE ldr r1, LED str r1, [r0, #GPCR] mov pc, lr /* busy wait loop. clobbers r0 */ wait_loop: mov r0, #0x400000 wait_loop1: subs r0, r0, #1 bne wait_loop1 mov pc, lr blinky: /* blink LED. clobbers r0 and r1 */ mov r2, lr bl led_on bl wait_loop bl led_off bl wait_loop mov pc, r2 .globl led_blink /* blinks LED r0 times */ /* clobbers r0 - r4 */ led_blink: #if defined (NO_GPIO_LED_SUPPORT) mov pc, lr #endif mov r4, lr mov r3, r0 /* switch LED off if it wasn't already off */ bl led_off bl wait_loop blink0: bl blinky subs r3, r3, #1 bne blink0 mov pc, r4 Index: Makefile.am =================================================================== RCS file: /cvsroot/blob/blob/src/blob/Makefile.am,v retrieving revision 1.36 retrieving revision 1.37 diff -u -d -r1.36 -r1.37 --- Makefile.am 10 Feb 2003 23:07:03 -0000 1.36 +++ Makefile.am 13 Feb 2003 01:10:52 -0000 1.37 @@ -143,16 +143,18 @@ # be linked in the wrong order! blob_elf32_SOURCES = \ start.S \ - ledasm.S \ testmem.S EXTRA_blob_elf32_SOURCES = \ + ledasm-mmap.S \ + ledasm-sa11x0.S \ memsetup-sa1100.S \ memsetup-sa1110.S \ start-pxa.S \ start-sa11x0.S blob_elf32_DEPENDENCIES = \ + @BLOB_LED_STARTCODE@ \ @BLOB_MEMSETUP_OBJS@ \ @BLOB_STARTCODE_OBJS@ \ start-ld-script \ @@ -163,6 +165,7 @@ -Wl,-Map,blob-start-elf32.map blob_elf32_LDADD += \ + @BLOB_LED_STARTCODE@ \ @BLOB_MEMSETUP_OBJS@ \ @BLOB_STARTCODE_OBJS@ \ -lgcc @@ -180,11 +183,15 @@ # WARNING: chain.S *must* be the first file, otherwise the target will # be linked in the wrong order! blob_chain_elf32_SOURCES = \ - chain.S \ - ledasm.S + chain.S + +EXTRA_blob_chain_elf32_SOURCES= \ + ledasm-mmap.S \ + ledasm-sa11x0.S blob_chain_elf32_DEPENDENCIES =\ start-ld-script \ + @BLOB_LED_STARTCODE@ \ blob-rest-piggy.o blob_chain_elf32_LDFLAGS += \ @@ -192,6 +199,7 @@ -Wl,-Map,blob-start-chain-elf32.map blob_chain_elf32_LDADD += \ + @BLOB_LED_STARTCODE@ \ -lgcc Index: accelent_sa.c =================================================================== RCS file: /cvsroot/blob/blob/src/blob/accelent_sa.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- accelent_sa.c 4 Jan 2003 02:11:42 -0000 1.3 +++ accelent_sa.c 13 Feb 2003 01:10:52 -0000 1.4 @@ -43,6 +43,8 @@ #include <blob/init.h> #include <blob/command.h> #include <blob/uucodec.h> +#include <blob/serial.h> +#include <blob/led.h> extern blob_status_t blob_status; @@ -102,6 +104,7 @@ /* select drivers */ reboot_driver = &sa11x0_reboot_driver; serial_driver = &sa11x0_serial_driver; + led_driver = &sa11x0_gpio_led_driver; } __initlist(accelent_sa_init_hardware, INIT_LEVEL_DRIVER_SELECTION); Index: assabet.c =================================================================== RCS file: /cvsroot/blob/blob/src/blob/assabet.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- assabet.c 4 Jan 2003 02:11:42 -0000 1.8 +++ assabet.c 13 Feb 2003 01:10:53 -0000 1.9 @@ -29,6 +29,7 @@ #include <blob/init.h> #include <blob/reboot.h> #include <blob/serial.h> +#include <blob/led.h> @@ -74,6 +75,7 @@ /* select drivers */ reboot_driver = &sa11x0_reboot_driver; serial_driver = &sa11x0_serial_driver; + led_driver = &sa11x0_gpio_led_driver; } Index: badge4.c =================================================================== RCS file: /cvsroot/blob/blob/src/blob/badge4.c,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- badge4.c 28 Jan 2003 03:41:28 -0000 1.15 +++ badge4.c 13 Feb 2003 01:10:53 -0000 1.16 @@ -37,6 +37,7 @@ #include <blob/i2c-gpio.h> #include <blob/spd.h> #include <blob/partition.h> +#include <blob/led.h> #define DEBUG @@ -132,8 +133,10 @@ static void badge4_select_drivers(void) { + /* select drivers */ reboot_driver = &sa11x0_reboot_driver; serial_driver = &sa11x0_serial_driver; + led_driver = &sa11x0_gpio_led_driver; flash_driver = &intel16_flash_driver; flash_descriptors = badge4_flash_descriptors; Index: brutus.c =================================================================== RCS file: /cvsroot/blob/blob/src/blob/brutus.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- brutus.c 4 Jan 2003 02:11:42 -0000 1.7 +++ brutus.c 13 Feb 2003 01:10:53 -0000 1.8 @@ -29,6 +29,7 @@ #include <blob/init.h> #include <blob/reboot.h> #include <blob/serial.h> +#include <blob/led.h> @@ -63,6 +64,7 @@ /* select drivers */ reboot_driver = &sa11x0_reboot_driver; serial_driver = &sa11x0_serial_driver; + led_driver = &sa11x0_gpio_led_driver; } __initlist(brutus_init_hardware, INIT_LEVEL_DRIVER_SELECTION); Index: cep.c =================================================================== RCS file: /cvsroot/blob/blob/src/blob/cep.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- cep.c 4 Jan 2003 02:11:42 -0000 1.2 +++ cep.c 13 Feb 2003 01:10:53 -0000 1.3 @@ -29,6 +29,7 @@ #include <blob/init.h> #include <blob/reboot.h> #include <blob/serial.h> +#include <blob/led.h> @@ -74,6 +75,7 @@ /* select drivers */ reboot_driver = &sa11x0_reboot_driver; serial_driver = &sa11x0_serial_driver; + led_driver = &sa11x0_gpio_led_driver; /* switch on the LED D3 */ *((volatile u8*)(0x40000004))= 0x02; Index: clart.c =================================================================== RCS file: /cvsroot/blob/blob/src/blob/clart.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- clart.c 4 Jan 2003 02:11:42 -0000 1.7 +++ clart.c 13 Feb 2003 01:10:53 -0000 1.8 @@ -29,6 +29,7 @@ #include <blob/init.h> #include <blob/reboot.h> #include <blob/serial.h> +#include <blob/led.h> @@ -66,6 +67,7 @@ /* select drivers */ reboot_driver = &sa11x0_reboot_driver; serial_driver = &sa11x0_serial_driver; + led_driver = &sa11x0_gpio_led_driver; } __initlist(clart_init_hardware, INIT_LEVEL_DRIVER_SELECTION); Index: frodo.c =================================================================== RCS file: /cvsroot/blob/blob/src/blob/frodo.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- frodo.c 4 Jan 2003 02:11:43 -0000 1.6 +++ frodo.c 13 Feb 2003 01:10:53 -0000 1.7 @@ -29,6 +29,7 @@ #include <blob/init.h> #include <blob/reboot.h> #include <blob/serial.h> +#include <blob/led.h> @@ -83,6 +84,7 @@ /* select drivers */ reboot_driver = &sa11x0_reboot_driver; serial_driver = &sa11x0_serial_driver; + led_driver = &sa11x0_gpio_led_driver; } Index: h3600.c =================================================================== RCS file: /cvsroot/blob/blob/src/blob/h3600.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- h3600.c 4 Jan 2003 02:11:43 -0000 1.7 +++ h3600.c 13 Feb 2003 01:10:53 -0000 1.8 @@ -31,6 +31,7 @@ #include <blob/init.h> #include <blob/reboot.h> #include <blob/serial.h> +#include <blob/led.h> @@ -130,6 +131,7 @@ /* select drivers */ reboot_driver = &sa11x0_reboot_driver; serial_driver = &sa11x0_serial_driver; + led_driver = &sa11x0_gpio_led_driver; } __initlist(h3600_init_hardware, INIT_LEVEL_DRIVER_SELECTION); Index: hackkit.c =================================================================== RCS file: /cvsroot/blob/blob/src/blob/hackkit.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- hackkit.c 4 Jan 2003 02:11:43 -0000 1.3 +++ hackkit.c 13 Feb 2003 01:10:53 -0000 1.4 @@ -44,6 +44,7 @@ #include <blob/uucodec.h> #include <blob/time.h> #include <blob/partition.h> +#include <blob/led.h> #include <blob/sa1100.h> @@ -119,5 +120,6 @@ /* select drivers */ reboot_driver = &sa11x0_reboot_driver; serial_driver = &sa11x0_serial_driver; + led_driver = &sa11x0_gpio_led_driver; } __initlist(hackkit_init_hardware, INIT_LEVEL_DRIVER_SELECTION); Index: idr.c =================================================================== RCS file: /cvsroot/blob/blob/src/blob/idr.c,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- idr.c 4 Jan 2003 02:11:43 -0000 1.11 +++ idr.c 13 Feb 2003 01:10:53 -0000 1.12 @@ -32,6 +32,7 @@ #include <blob/serial.h> #include <blob/sa1100.h> #include <blob/sa1111.h> +#include <blob/led.h> /* flash descriptor for IDR flash */ /* 1x Intel 28F128J3A strataflash (16MB) */ @@ -123,6 +124,7 @@ /* select drivers */ reboot_driver = &sa11x0_reboot_driver; serial_driver = &sa11x0_serial_driver; + led_driver = &sa11x0_gpio_led_driver; /* tweak blob config */ blob_status.boot_delay = 1; Index: jornada720.c =================================================================== RCS file: /cvsroot/blob/blob/src/blob/jornada720.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- jornada720.c 4 Jan 2003 02:11:43 -0000 1.6 +++ jornada720.c 13 Feb 2003 01:10:53 -0000 1.7 @@ -32,6 +32,7 @@ #include <blob/reboot.h> #include <blob/serial.h> #include <blob/time.h> +#include <blob/led.h> /* flash descriptor for Jornada720 flash */ @@ -78,6 +79,7 @@ /* select drivers */ reboot_driver = &sa11x0_reboot_driver; serial_driver = &sa11x0_serial_driver; + led_driver = &sa11x0_gpio_led_driver; } __initlist(init_driver, INIT_LEVEL_DRIVER_SELECTION); Index: lart.c =================================================================== RCS file: /cvsroot/blob/blob/src/blob/lart.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- lart.c 4 Jan 2003 02:11:43 -0000 1.8 +++ lart.c 13 Feb 2003 01:10:53 -0000 1.9 @@ -31,6 +31,7 @@ #include <blob/partition.h> #include <blob/reboot.h> #include <blob/serial.h> +#include <blob/led.h> @@ -134,6 +135,7 @@ { reboot_driver = &sa11x0_reboot_driver; serial_driver = &sa11x0_serial_driver; + led_driver = &sa11x0_gpio_led_driver; /* we could do funky detection over here, because the LART can * have both internal and external flash with different Index: lubbock.c =================================================================== RCS file: /cvsroot/blob/blob/src/blob/lubbock.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- lubbock.c 4 Jan 2003 02:11:43 -0000 1.2 +++ lubbock.c 13 Feb 2003 01:10:53 -0000 1.3 @@ -28,6 +28,7 @@ #include <blob/init.h> #include <blob/reboot.h> #include <blob/serial.h> +#include <blob/led.h> @@ -73,6 +74,7 @@ /* select drivers */ reboot_driver = &pxa_reboot_driver; serial_driver = &pxa_serial_driver; + led_driver = &sa11x0_gpio_led_driver; } Index: miniprint.c =================================================================== RCS file: /cvsroot/blob/blob/src/blob/miniprint.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- miniprint.c 4 Jan 2003 02:11:43 -0000 1.2 +++ miniprint.c 13 Feb 2003 01:10:53 -0000 1.3 @@ -29,6 +29,7 @@ #include <blob/init.h> #include <blob/reboot.h> #include <blob/serial.h> +#include <blob/led.h> /* flash descriptor for Miniprint flash */ /* 2x Intel 28F128J3A strataflash (a 16MB) */ @@ -56,5 +57,6 @@ /* select drivers */ reboot_driver = &sa11x0_reboot_driver; serial_driver = &sa11x0_serial_driver; + led_driver = &sa11x0_gpio_led_driver; } __initlist(miniprint_init_hardware, INIT_LEVEL_DRIVER_SELECTION); Index: nesa.c =================================================================== RCS file: /cvsroot/blob/blob/src/blob/nesa.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- nesa.c 4 Jan 2003 02:11:43 -0000 1.8 +++ nesa.c 13 Feb 2003 01:10:53 -0000 1.9 @@ -29,6 +29,7 @@ #include <blob/init.h> #include <blob/reboot.h> #include <blob/serial.h> +#include <blob/led.h> @@ -77,6 +78,7 @@ /* select drivers */ reboot_driver = &sa11x0_reboot_driver; serial_driver = &sa11x0_serial_driver; + led_driver = &sa11x0_gpio_led_driver; } __initlist(nesa_init_hardware, INIT_LEVEL_DRIVER_SELECTION); Index: pleb.c =================================================================== RCS file: /cvsroot/blob/blob/src/blob/pleb.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- pleb.c 4 Jan 2003 02:11:43 -0000 1.7 +++ pleb.c 13 Feb 2003 01:10:53 -0000 1.8 @@ -80,6 +80,7 @@ /* select drivers */ reboot_driver = &sa11x0_reboot_driver; serial_driver = &sa11x0_serial_driver; + led_driver = &sa11x0_gpio_led_driver; } __initlist(pleb_init_hardware, INIT_LEVEL_DRIVER_SELECTION); Index: pxa_idp.c =================================================================== RCS file: /cvsroot/blob/blob/src/blob/pxa_idp.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- pxa_idp.c 4 Jan 2003 02:11:43 -0000 1.2 +++ pxa_idp.c 13 Feb 2003 01:10:53 -0000 1.3 @@ -41,6 +41,7 @@ #include <blob/init.h> #include <blob/command.h> #include <blob/uucodec.h> +#include <blob/led.h> extern blob_status_t blob_status; @@ -99,6 +100,7 @@ /* select drivers */ reboot_driver = &pxa_reboot_driver; serial_driver = &pxa_serial_driver; + led_driver = &sa11x0_gpio_led_driver; } __initlist(accelent_sa_init_hardware, INIT_LEVEL_DRIVER_SELECTION); Index: shannon.c =================================================================== RCS file: /cvsroot/blob/blob/src/blob/shannon.c,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- shannon.c 4 Jan 2003 02:11:43 -0000 1.12 +++ shannon.c 13 Feb 2003 01:10:53 -0000 1.13 @@ -30,6 +30,7 @@ #include <blob/init.h> #include <blob/reboot.h> #include <blob/serial.h> +#include <blob/led.h> /* flash descriptor for SHANNON flash */ /* 2x AMD *whatever* flash (4MB) */ @@ -70,6 +71,7 @@ /* select drivers */ reboot_driver = &sa11x0_reboot_driver; serial_driver = &sa11x0_serial_driver; + led_driver = &sa11x0_gpio_led_driver; /* tweak blob config */ blob_status.boot_delay = 1; Index: system3.c =================================================================== RCS file: /cvsroot/blob/blob/src/blob/system3.c,v retrieving revision 1.24 retrieving revision 1.25 diff -u -d -r1.24 -r1.25 --- system3.c 4 Jan 2003 02:11:43 -0000 1.24 +++ system3.c 13 Feb 2003 01:10:53 -0000 1.25 @@ -44,6 +44,7 @@ #include <blob/uucodec.h> #include <blob/time.h> #include <blob/partition.h> +#include <blob/led.h> #include <blob/sa1100.h> #include <blob/sa1111.h> @@ -266,6 +267,7 @@ /* select drivers */ reboot_driver = &sa11x0_reboot_driver; serial_driver = &sa11x0_serial_driver; + led_driver = &sa11x0_gpio_led_driver; } __initlist(system3_init_hardware, INIT_LEVEL_DRIVER_SELECTION); Index: trizeps.c =================================================================== RCS file: /cvsroot/blob/blob/src/blob/trizeps.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- trizeps.c 4 Jan 2003 02:11:43 -0000 1.2 +++ trizeps.c 13 Feb 2003 01:10:53 -0000 1.3 @@ -43,6 +43,7 @@ #include <blob/init.h> #include <blob/command.h> #include <blob/uucodec.h> +#include <blob/led.h> /********************************************************************** * defines @@ -109,6 +110,7 @@ /* select drivers */ reboot_driver = &sa11x0_reboot_driver; serial_driver = &sa11x0_serial_driver; + led_driver = &sa11x0_gpio_led_driver; } __initlist(trizeps_init_hardware, INIT_LEVEL_DRIVER_SELECTION); --- ledasm.S DELETED --- |