From 95d8d239895a4beff936e41e198bd58d744a4e6b Mon Sep 17 00:00:00 2001 From: Bernhard Nortmann Date: Fri, 30 Dec 2016 12:13:54 +0100 Subject: [PATCH] fel: Remove obsolete fel-pio (thunk) code This functionality is now available via "sunxi-fel memmove", so change the fel-gpio script accordingly and remove the thunk code. Signed-off-by: Bernhard Nortmann --- Makefile | 10 +------- README.md | 7 ++---- bin/fel-pio.bin | Bin 92 -> 0 bytes bin/fel-pio.nm | 2 -- fel-gpio | 26 +++++++++----------- fel-pio.c | 63 ------------------------------------------------ fel-pio.lds | 28 --------------------- 7 files changed, 15 insertions(+), 121 deletions(-) delete mode 100755 bin/fel-pio.bin delete mode 100644 bin/fel-pio.nm delete mode 100644 fel-pio.c delete mode 100644 fel-pio.lds diff --git a/Makefile b/Makefile index f4175f4..11721e4 100644 --- a/Makefile +++ b/Makefile @@ -50,7 +50,7 @@ MISC_TOOLS = phoenix_info sunxi-nand-image-builder # ARM binaries and images # Note: To use this target, set/adjust CROSS_COMPILE and MKSUNXIBOOT if needed -BINFILES = fel-pio.bin jtag-loop.sunxi fel-sdboot.sunxi uart0-helloworld-sdboot.sunxi +BINFILES = jtag-loop.sunxi fel-sdboot.sunxi uart0-helloworld-sdboot.sunxi CROSS_COMPILE ?= arm-none-eabi- CROSS_CC ?= $(CROSS_COMPILE)gcc @@ -148,19 +148,11 @@ phoenix_info: phoenix_info.c %.sunxi: %.bin $(MKSUNXIBOOT) $< $@ -fel-pio.bin: fel-pio.elf fel-pio.nm - ARM_ELF_FLAGS = -Os -marm -fpic -Wall ARM_ELF_FLAGS += -fno-common -fno-builtin -ffreestanding -nostdinc -fno-strict-aliasing ARM_ELF_FLAGS += -mno-thumb-interwork -fno-stack-protector -fno-toplevel-reorder ARM_ELF_FLAGS += -Wstrict-prototypes -Wno-format-nonliteral -Wno-format-security -fel-pio.elf: fel-pio.c fel-pio.lds - $(CROSS_CC) -g $(ARM_ELF_FLAGS) $< -nostdlib -o $@ -T fel-pio.lds - -fel-pio.nm: fel-pio.elf - $(CROSS_COMPILE)nm $< | grep -v " _" >$@ - jtag-loop.elf: jtag-loop.c jtag-loop.lds $(CROSS_CC) -g $(ARM_ELF_FLAGS) $< -nostdlib -o $@ -T jtag-loop.lds -Wl,-N diff --git a/README.md b/README.md index bdfb443..ef43d90 100644 --- a/README.md +++ b/README.md @@ -44,7 +44,7 @@ finds. You can print a list of all FEL devices currently connected/detected with `./sunxi-fel --list --verbose`. ### fel-gpio -Simple wrapper (script) around `fel-pio` and `sunxi-fel` +Simple wrapper (script) around `sunxi-pio` and `sunxi-fel` to allow GPIO manipulations via FEL ### fel-sdboot @@ -58,11 +58,8 @@ Allwinner devices and can be used for testing. Additionally, it may serve as a template/example for developing simple bare metal code (LED blinking and other similar GPIO related things). -### fel-pio -ARM native helper (binary) for `fel-gpio` - ### sunxi-pio -Manipulate PIO register dumps +Manipulate PIO registers/dumps ### sunxi-nand-part Tool for manipulating Allwinner NAND partition tables diff --git a/bin/fel-pio.bin b/bin/fel-pio.bin deleted file mode 100755 index 86373df1c7467ea85abbb2722f90bdd111aaf8ba..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 92 zcmZQzV0gs|#1abgpGpYKf68pN;4ursrl%|n%}*E^f*=0=|6fY(zy8BN?1vaNj2IZe V>I@)iv8vN&U|`??s^vPw2mpS?Bs%~A diff --git a/bin/fel-pio.nm b/bin/fel-pio.nm deleted file mode 100644 index e17c689..0000000 --- a/bin/fel-pio.nm +++ /dev/null @@ -1,2 +0,0 @@ -00002000 T pio_to_sram -00002004 T sram_to_pio diff --git a/fel-gpio b/fel-gpio index d65ef85..bc231d0 100755 --- a/fel-gpio +++ b/fel-gpio @@ -20,26 +20,24 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -pio_to_sram=0x2000 -sram_to_pio=0x2004 +pio_base=0x01c20800 +pio_size=0x228 +sram_addr=0x3000 -if [ -f fel-pio.bin ]; then - ./sunxi-fel write 0x2000 fel-pio.bin -else - ./sunxi-fel write 0x2000 bin/fel-pio.bin -fi - -./sunxi-fel exec $pio_to_sram -./sunxi-fel read 0x3000 0x228 pio.reg +# read PIO +./sunxi-fel memmove $sram_addr $pio_base $pio_size +./sunxi-fel read $sram_addr $pio_size pio.reg ./sunxi-pio -i pio.reg print > pio.old cat pio.old | fgrep -v '<0><0><0><0>' while read cmd; do ./sunxi-pio -i pio.reg -o pio.reg $cmd - ./sunxi-fel write 0x3000 pio.reg - ./sunxi-fel exe 0x2004 - ./sunxi-fel exe 0x2000 - ./sunxi-fel read 0x3000 0x228 pio.reg + # write PIO + ./sunxi-fel write $sram_addr pio.reg + ./sunxi-fel memmove $pio_base $sram_addr $pio_size + # (re-)read PIO + ./sunxi-fel memmove $sram_addr $pio_base $pio_size + ./sunxi-fel read $sram_addr $pio_size pio.reg ./sunxi-pio -i pio.reg print > pio.new diff -U0 pio.old pio.new || true mv -f pio.new pio.old diff --git a/fel-pio.c b/fel-pio.c deleted file mode 100644 index d40e861..0000000 --- a/fel-pio.c +++ /dev/null @@ -1,63 +0,0 @@ -/* - * (C) Copyright 2011 Henrik Nordstrom - * - * 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 - */ - -/* - -Build instructions: - -arm-none-eabi-gcc -g -Os -fno-common -fno-builtin -ffreestanding -nostdinc -mno-thumb-interwork -Wall -Wstrict-prototypes -fno-stack-protector -Wno-format-nonliteral -Wno-format-security -fno-toplevel-reorder fel-pio.c -nostdlib -o fel-pio.elf - -arm-none-eabi-objcopy -O binary fel-pio.elf fel-pio.bin - -arm-none-eabi-nm fel-pio.o - -*/ - -void _pio_to_sram(void); -void _sram_to_pio(void); - -void pio_to_sram(void) -{ - _pio_to_sram(); -} - -void sram_to_pio(void) -{ - _sram_to_pio(); -} - -void _pio_to_sram(void) -{ - unsigned long *a = (void *)0x1c20800; - unsigned long *b = (void *)0x3000; - int i = 0x228 >> 2; - while (i--) { - *b++ = *a++; - } -} - -void _sram_to_pio(void) -{ - unsigned long *a = (void *)0x1c20800; - unsigned long *b = (void *)0x3000; - int i = 0x228 >> 2; - while (i--) { - *a++ = *b++; - } -} diff --git a/fel-pio.lds b/fel-pio.lds deleted file mode 100644 index f35da1a..0000000 --- a/fel-pio.lds +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (C) 2012 Henrik Nordstrom - * - * 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, see . - */ - -SECTIONS -{ - . = 0x2000; - .text : { *(.text) } - /DISCARD/ : { *(.dynstr*) } - /DISCARD/ : { *(.dynamic*) } - /DISCARD/ : { *(.plt*) } - /DISCARD/ : { *(.interp*) } - /DISCARD/ : { *(.gnu*) } - /DISCARD/ : { *(.note*) } -}