mirror of
https://github.com/linux-sunxi/sunxi-tools.git
synced 2024-11-23 01:46:44 +08:00
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 <bernhard.nortmann@web.de>
This commit is contained in:
parent
37e9965b1e
commit
95d8d23989
10
Makefile
10
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
|
||||
|
||||
|
@ -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
|
||||
|
BIN
bin/fel-pio.bin
BIN
bin/fel-pio.bin
Binary file not shown.
@ -1,2 +0,0 @@
|
||||
00002000 T pio_to_sram
|
||||
00002004 T sram_to_pio
|
26
fel-gpio
26
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
|
||||
|
63
fel-pio.c
63
fel-pio.c
@ -1,63 +0,0 @@
|
||||
/*
|
||||
* (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++;
|
||||
}
|
||||
}
|
28
fel-pio.lds
28
fel-pio.lds
@ -1,28 +0,0 @@
|
||||
/*
|
||||
* 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*) }
|
||||
}
|
Loading…
Reference in New Issue
Block a user