Commit 95d8d239 authored by Bernhard Nortmann's avatar Bernhard Nortmann
Browse files

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: default avatarBernhard Nortmann <bernhard.nortmann@web.de>
parent 37e9965b
...@@ -50,7 +50,7 @@ MISC_TOOLS = phoenix_info sunxi-nand-image-builder ...@@ -50,7 +50,7 @@ MISC_TOOLS = phoenix_info sunxi-nand-image-builder
# ARM binaries and images # ARM binaries and images
# Note: To use this target, set/adjust CROSS_COMPILE and MKSUNXIBOOT if needed # 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_COMPILE ?= arm-none-eabi-
CROSS_CC ?= $(CROSS_COMPILE)gcc CROSS_CC ?= $(CROSS_COMPILE)gcc
...@@ -148,19 +148,11 @@ phoenix_info: phoenix_info.c ...@@ -148,19 +148,11 @@ phoenix_info: phoenix_info.c
%.sunxi: %.bin %.sunxi: %.bin
$(MKSUNXIBOOT) $< $@ $(MKSUNXIBOOT) $< $@
fel-pio.bin: fel-pio.elf fel-pio.nm
ARM_ELF_FLAGS = -Os -marm -fpic -Wall ARM_ELF_FLAGS = -Os -marm -fpic -Wall
ARM_ELF_FLAGS += -fno-common -fno-builtin -ffreestanding -nostdinc -fno-strict-aliasing 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 += -mno-thumb-interwork -fno-stack-protector -fno-toplevel-reorder
ARM_ELF_FLAGS += -Wstrict-prototypes -Wno-format-nonliteral -Wno-format-security 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 jtag-loop.elf: jtag-loop.c jtag-loop.lds
$(CROSS_CC) -g $(ARM_ELF_FLAGS) $< -nostdlib -o $@ -T jtag-loop.lds -Wl,-N $(CROSS_CC) -g $(ARM_ELF_FLAGS) $< -nostdlib -o $@ -T jtag-loop.lds -Wl,-N
......
...@@ -44,7 +44,7 @@ finds. You can print a list of all FEL devices currently connected/detected ...@@ -44,7 +44,7 @@ finds. You can print a list of all FEL devices currently connected/detected
with `./sunxi-fel --list --verbose`. with `./sunxi-fel --list --verbose`.
### fel-gpio ### 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 to allow GPIO manipulations via FEL
### fel-sdboot ### fel-sdboot
...@@ -58,11 +58,8 @@ Allwinner devices and can be used for testing. Additionally, it may ...@@ -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 serve as a template/example for developing simple bare metal code
(LED blinking and other similar GPIO related things). (LED blinking and other similar GPIO related things).
### fel-pio
ARM native helper (binary) for `fel-gpio`
### sunxi-pio ### sunxi-pio
Manipulate PIO register dumps Manipulate PIO registers/dumps
### sunxi-nand-part ### sunxi-nand-part
Tool for manipulating Allwinner NAND partition tables Tool for manipulating Allwinner NAND partition tables
......
00002000 T pio_to_sram
00002004 T sram_to_pio
...@@ -20,26 +20,24 @@ ...@@ -20,26 +20,24 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE. # THE SOFTWARE.
pio_to_sram=0x2000 pio_base=0x01c20800
sram_to_pio=0x2004 pio_size=0x228
sram_addr=0x3000
if [ -f fel-pio.bin ]; then # read PIO
./sunxi-fel write 0x2000 fel-pio.bin ./sunxi-fel memmove $sram_addr $pio_base $pio_size
else ./sunxi-fel read $sram_addr $pio_size pio.reg
./sunxi-fel write 0x2000 bin/fel-pio.bin
fi
./sunxi-fel exec $pio_to_sram
./sunxi-fel read 0x3000 0x228 pio.reg
./sunxi-pio -i pio.reg print > pio.old ./sunxi-pio -i pio.reg print > pio.old
cat pio.old | fgrep -v '<0><0><0><0>' cat pio.old | fgrep -v '<0><0><0><0>'
while read cmd; do while read cmd; do
./sunxi-pio -i pio.reg -o pio.reg $cmd ./sunxi-pio -i pio.reg -o pio.reg $cmd
./sunxi-fel write 0x3000 pio.reg # write PIO
./sunxi-fel exe 0x2004 ./sunxi-fel write $sram_addr pio.reg
./sunxi-fel exe 0x2000 ./sunxi-fel memmove $pio_base $sram_addr $pio_size
./sunxi-fel read 0x3000 0x228 pio.reg # (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 ./sunxi-pio -i pio.reg print > pio.new
diff -U0 pio.old pio.new || true diff -U0 pio.old pio.new || true
mv -f pio.new pio.old mv -f pio.new pio.old
......
/*
* (C) Copyright 2011 Henrik Nordstrom <henrik@henriknordstrom.net>
*
* 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++;
}
}
/*
* Copyright (C) 2012 Henrik Nordstrom <henrik@henriknordstrom.net>
*
* 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 <http://www.gnu.org/licenses/>.
*/
SECTIONS
{
. = 0x2000;
.text : { *(.text) }
/DISCARD/ : { *(.dynstr*) }
/DISCARD/ : { *(.dynamic*) }
/DISCARD/ : { *(.plt*) }
/DISCARD/ : { *(.interp*) }
/DISCARD/ : { *(.gnu*) }
/DISCARD/ : { *(.note*) }
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment