Re: [Openocd-development] [PATCH] contrib: add ram loader src code
On Thu, Oct 28, 2010 at 11:12 AM, Spencer Oliver wrote: > On 27/10/2010 18:50, Øyvind Harboe wrote: >> >> On Wed, Oct 27, 2010 at 6:21 PM, Peter Stuge wrote: >>> >>> Spencer Oliver wrote: Having a bit of a tidy up and found the src to the various ram loaders i have written over the years - no objections i will commit. >>> >>> Acked-by: Peter Stuge >>> >>> Could they also be magically hooked up to OpenOCD? >> >> I think a good start would be to add comments in the >> code where these stubs are used(now as binary sequences) >> that the next time these sequences need to change, then >> they should be built using a script. >> >> I don't think we want to require target cross compilers to be >> available to build OpenOCD. >> >> > > updated patchset attached - is this better? Much better. Anyone who wants to work on these magic sequences will then know where the source is and then take it from there. -- Øyvind Harboe US toll free 1-866-980-3434 / International +47 51 63 25 00 http://www.zylin.com/zy1000.html ARM7 ARM9 ARM11 XScale Cortex JTAG debugger and flash programmer ___ Openocd-development mailing list Openocd-development@lists.berlios.de https://lists.berlios.de/mailman/listinfo/openocd-development
Re: [Openocd-development] [PATCH] contrib: add ram loader src code
On 27/10/2010 18:50, Øyvind Harboe wrote: On Wed, Oct 27, 2010 at 6:21 PM, Peter Stuge wrote: Spencer Oliver wrote: Having a bit of a tidy up and found the src to the various ram loaders i have written over the years - no objections i will commit. Acked-by: Peter Stuge Could they also be magically hooked up to OpenOCD? I think a good start would be to add comments in the code where these stubs are used(now as binary sequences) that the next time these sequences need to change, then they should be built using a script. I don't think we want to require target cross compilers to be available to build OpenOCD. updated patchset attached - is this better? Cheers Spen From 1fafb669c99744b986d85b5c4a4e276767898654 Mon Sep 17 00:00:00 2001 From: Spencer Oliver Date: Thu, 28 Oct 2010 09:19:37 +0100 Subject: [PATCH 1/2] contrib: add ram loader src code Add src code for ram loaders to contrib directory. Signed-off-by: Spencer Oliver --- contrib/loaders/README | 33 contrib/loaders/checksum/armv4_5_crc.s | 58 ++ contrib/loaders/checksum/armv7m_crc.s | 66 contrib/loaders/checksum/mips32.s | 72 + contrib/loaders/flash/pic32mx.s| 131 contrib/loaders/flash/stellaris.s | 66 contrib/loaders/flash/stm32x.s | 52 + contrib/loaders/flash/str7x.s | 57 ++ contrib/loaders/flash/str9x.s | 54 + 9 files changed, 589 insertions(+), 0 deletions(-) create mode 100644 contrib/loaders/README create mode 100644 contrib/loaders/checksum/armv4_5_crc.s create mode 100644 contrib/loaders/checksum/armv7m_crc.s create mode 100644 contrib/loaders/checksum/mips32.s create mode 100644 contrib/loaders/flash/pic32mx.s create mode 100644 contrib/loaders/flash/stellaris.s create mode 100644 contrib/loaders/flash/stm32x.s create mode 100644 contrib/loaders/flash/str7x.s create mode 100644 contrib/loaders/flash/str9x.s diff --git a/contrib/loaders/README b/contrib/loaders/README new file mode 100644 index 000..2b123cf --- /dev/null +++ b/contrib/loaders/README @@ -0,0 +1,33 @@ +Included in these directories are the src to the various ram loaders used +within openocd. + +** target checksum loaders ** + +checksum/armv4_5_crc.s : + - ARMv4 and ARMv5 checksum loader : see target/arm_crc_code.c:arm_crc_code + +checksum/armv7m_crc.s : + - ARMv7m checksum loader : see target/armv7m.c:cortex_m3_crc_code + +checksum/mips32.s : + - MIPS32 checksum loader : see target/mips32.c:mips_crc_code + +** target flash loaders ** + +flash/pic32mx.s : + - Microchip PIC32 flash loader : see flash/nor/pic32mx.c:pic32mx_flash_write_code + +flash/stellaris.s : + - TI Stellaris flash loader : see flash/nor/stellaris.c:stellaris_write_code + +flash/stm32x.s : + - ST STM32 flash loader : see flash/nor/stm32x.c:stm32x_flash_write_code + +flash/str7x.s : + - ST STR7 flash loader : see flash/nor/str7x.c:str7x_flash_write_code + +flash/str9x.s : + - ST STR9 flash loader : see flash/nor/str9x.c:str9x_flash_write_code + +Spencer Oliver +s...@spen-soft.co.uk diff --git a/contrib/loaders/checksum/armv4_5_crc.s b/contrib/loaders/checksum/armv4_5_crc.s new file mode 100644 index 000..950a8d0 --- /dev/null +++ b/contrib/loaders/checksum/armv4_5_crc.s @@ -0,0 +1,58 @@ +/*** + * Copyright (C) 2010 by Spencer Oliver * + * s...@spen-soft.co.uk * + * * + * 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. * + ***/ + +/* + r0 - address in - crc out + r1 - char count +*/ + + .text + .arm + +_start: +ma
Re: [Openocd-development] [PATCH] contrib: add ram loader src code
On 10/27/2010 10:29 PM, Øyvind Harboe wrote: > I actually don't think it is an unreasonable expectation. I know I >> have not had OpenOCD without the cross toolchain. >> >> However, compiling them could be done in make dist, rather than make. >> (Ie. when preparing a tarball, rather than when compiling OpenOCD.) > I'm loathe to make building OpenOCD from the master branch > any more difficult than it is already: learning git, installing > the right tools, etc. Yes. However, having scripts that compile these assembler parts and create the corresponding C source files with the arrays would be nice. The generated files can be checked in (just like they are now), so only someone who wants to modify that code needs the cross compiler installed. cu Michael ___ Openocd-development mailing list Openocd-development@lists.berlios.de https://lists.berlios.de/mailman/listinfo/openocd-development
Re: [Openocd-development] [PATCH] contrib: add ram loader src code
On Wed, Oct 27, 2010 at 10:10 PM, Peter Stuge wrote: > Øyvind Harboe wrote: >> >> Having a bit of a tidy up and found the src to the various ram loaders >> >> i have written over the years - no objections i will commit. >> > >> > Could they also be magically hooked up to OpenOCD? >> >> I think a good start would be to add comments in the >> code where these stubs are used(now as binary sequences) > > Oh! So they are already magically hooked up! Great. Actually, I think they are the source code for the unsigned code[] ={0x12345678,...} codelets you find here and there. >> that the next time these sequences need to change, then >> they should be built using a script. >> >> I don't think we want to require target cross compilers to be >> available to build OpenOCD. > > I actually don't think it is an unreasonable expectation. I know I > have not had OpenOCD without the cross toolchain. > > However, compiling them could be done in make dist, rather than make. > (Ie. when preparing a tarball, rather than when compiling OpenOCD.) I'm loathe to make building OpenOCD from the master branch any more difficult than it is already: learning git, installing the right tools, etc. -- Øyvind Harboe US toll free 1-866-980-3434 / International +47 51 63 25 00 http://www.zylin.com/zy1000.html ARM7 ARM9 ARM11 XScale Cortex JTAG debugger and flash programmer ___ Openocd-development mailing list Openocd-development@lists.berlios.de https://lists.berlios.de/mailman/listinfo/openocd-development
Re: [Openocd-development] [PATCH] contrib: add ram loader src code
Øyvind Harboe wrote: > >> Having a bit of a tidy up and found the src to the various ram loaders > >> i have written over the years - no objections i will commit. > > > > Could they also be magically hooked up to OpenOCD? > > I think a good start would be to add comments in the > code where these stubs are used(now as binary sequences) Oh! So they are already magically hooked up! Great. > that the next time these sequences need to change, then > they should be built using a script. > > I don't think we want to require target cross compilers to be > available to build OpenOCD. I actually don't think it is an unreasonable expectation. I know I have not had OpenOCD without the cross toolchain. However, compiling them could be done in make dist, rather than make. (Ie. when preparing a tarball, rather than when compiling OpenOCD.) //Peter ___ Openocd-development mailing list Openocd-development@lists.berlios.de https://lists.berlios.de/mailman/listinfo/openocd-development
Re: [Openocd-development] [PATCH] contrib: add ram loader src code
On Wed, Oct 27, 2010 at 6:21 PM, Peter Stuge wrote: > Spencer Oliver wrote: >> Having a bit of a tidy up and found the src to the various ram loaders >> i have written over the years - no objections i will commit. > > Acked-by: Peter Stuge > > Could they also be magically hooked up to OpenOCD? I think a good start would be to add comments in the code where these stubs are used(now as binary sequences) that the next time these sequences need to change, then they should be built using a script. I don't think we want to require target cross compilers to be available to build OpenOCD. -- Øyvind Harboe US toll free 1-866-980-3434 / International +47 51 63 25 00 http://www.zylin.com/zy1000.html ARM7 ARM9 ARM11 XScale Cortex JTAG debugger and flash programmer ___ Openocd-development mailing list Openocd-development@lists.berlios.de https://lists.berlios.de/mailman/listinfo/openocd-development