Mercurial > ecos
changeset 265:96fac1fabc4c
RedBoot 'exec' command is now controlled by RedBoot CDL.
line wrap: on
line diff
--- a/packages/hal/arm/arch/current/ChangeLog +++ b/packages/hal/arm/arch/current/ChangeLog @@ -1,3 +1,7 @@ +2002-08-02 Andrew Lunn <Andrew.Lunn@ascom.ch> + + * cdl/hal_arm.cdl: Redboot exec command can now be disabled by CDL + 2002-07-15 Mark Salter <msalter@redhat.com> * include/arm_stub.h: Comment out NUMREGBYTES.
--- a/packages/hal/arm/arch/current/cdl/hal_arm.cdl +++ b/packages/hal/arm/arch/current/cdl/hal_arm.cdl @@ -222,43 +222,46 @@ cdl_package CYGPKG_HAL_ARM { This option lists the target's requirements for a valid Redboot configuration." - cdl_option CYGSEM_REDBOOT_ARM_LINUX_BOOT { - display "Support booting Linux via RedBoot" - flavor bool - default_value 0 + cdl_component CYGPKG_REDBOOT_ARM_LINUX_EXEC { + display "Provide the exec command in RedBoot" + flavor none + parent CYGPKG_REDBOOT_ARM_OPTIONS + active_if CYGBLD_BUILD_REDBOOT_WITH_EXEC description " - This option enables RedBoot to support booting of a Linux kernel." - + This option contains requirements for booting linux + from RedBoot. The component is enabled/disabled from + RedBoots CDL." compile -library=libextras.a redboot_linux_exec.c - } - cdl_option CYGHWR_REDBOOT_ARM_LINUX_EXEC_ADDRESS { - display "Physical base address of linux kernel" - flavor data - default_value CYGHWR_REDBOOT_ARM_LINUX_EXEC_ADDRESS_DEFAULT - description " - This is the physical address of the base of the Linux kernel - image." - } + cdl_option CYGHWR_REDBOOT_ARM_LINUX_EXEC_ADDRESS { + display "Physical base address of linux kernel" + flavor data + default_value CYGHWR_REDBOOT_ARM_LINUX_EXEC_ADDRESS_DEFAULT + description " + This is the physical address of the base of the + Linux kernel image." + } - cdl_option CYGHWR_REDBOOT_ARM_LINUX_EXEC_ADDRESS_DEFAULT { - display "Default physical base address of linux kernel" - flavor data - default_value 0x00008000 - no_define - description " - This is the physical address of the base of the Linux kernel - image. This option gets set by the platform CDL." - } + cdl_option CYGHWR_REDBOOT_ARM_LINUX_EXEC_ADDRESS_DEFAULT { + display "Default physical base address of linux kernel" + flavor data + default_value 0x00008000 + no_define + description " + This is the physical address of the base of the + Linux kernel image. This option gets set by the + platform CDL." + } - cdl_option CYGHWR_REDBOOT_ARM_LINUX_TAGS_ADDRESS { - display "Base address of linux kernel parameter tags" - flavor data - default_value 0x100 - description " - This is the base address of the area of memory used to - pass parameters to the Linux kernel. This should be chosen - to avoid overlap with the kernel and any ramdisk image." + cdl_option CYGHWR_REDBOOT_ARM_LINUX_TAGS_ADDRESS { + display "Base address of linux kernel parameter tags" + flavor data + default_value 0x100 + description " + This is the base address of the area of memory used to + pass parameters to the Linux kernel. This should be chosen + to avoid overlap with the kernel and any ramdisk image." + } } }
--- a/packages/hal/arm/arm9/aaed2000/current/cdl/hal_arm_arm9_aaed2000.cdl +++ b/packages/hal/arm/arm9/aaed2000/current/cdl/hal_arm_arm9_aaed2000.cdl @@ -517,7 +517,7 @@ cdl_package CYGPKG_HAL_ARM_ARM9_AAED2000 requires {!CYGPKG_REDBOOT_FLASH || CYGOPT_REDBOOT_FIS_REDBOOT_BACKUP == 0} # RedBoot details - requires { CYGSEM_REDBOOT_ARM_LINUX_BOOT } + requires { CYGPKG_REDBOOT_ARM_LINUX_EXEC } requires { CYGHWR_REDBOOT_ARM_LINUX_EXEC_ADDRESS_DEFAULT == 0xf0008000 } define_proc { puts $::cdl_header "#define CYGHWR_REDBOOT_ARM_TRAMPOLINE_ADDRESS 0x00001f00"
--- a/packages/hal/arm/ebsa285/current/ChangeLog +++ b/packages/hal/arm/ebsa285/current/ChangeLog @@ -1,3 +1,8 @@ +2002-08-02 Andrew Lunn <Andrew.Lunn@ascom.ch> + + * src/redboot_cmds.c: Redboot exec command can now be disabled by CDL + * cdl/hal_arm_ebsa285.cdl: Support needed for above. + 2002-05-14 Jesper Skov <jskov@redhat.com> * src/ebsa285_misc.c: Fixed warning.
--- a/packages/hal/arm/ebsa285/current/cdl/hal_arm_ebsa285.cdl +++ b/packages/hal/arm/ebsa285/current/cdl/hal_arm_ebsa285.cdl @@ -376,9 +376,7 @@ cdl_package CYGPKG_HAL_ARM_EBSA285 { description " This option lists the target's requirements for a valid Redboot configuration." - - compile -library=libextras.a redboot_cmds.c - + cdl_option CYGBLD_BUILD_REDBOOT_BIN { display "Build Redboot ROM binary image" active_if CYGBLD_BUILD_REDBOOT
--- a/packages/hal/arm/ebsa285/current/include/plf_io.h +++ b/packages/hal/arm/ebsa285/current/include/plf_io.h @@ -63,6 +63,9 @@ #include <cyg/hal/hal_io.h> // IO macros #include <cyg/hal/hal_platform_ints.h> // Interrupt vectors +// Memory map is 1-1 +#define CYGARC_PHYSICAL_ADDRESS(_x_) (_x_) + // The PCI resources required by the EBSA are hardcoded to the lowest // addresses in the PCI address space, thus: // PCI Memory Space
deleted file mode 100644 --- a/packages/hal/arm/ebsa285/current/src/redboot_cmds.c +++ /dev/null @@ -1,200 +0,0 @@ -//========================================================================== -// -// redboot_cmds.c -// -// EBSA-285 [platform] specific RedBoot commands -// -//========================================================================== -//####ECOSGPLCOPYRIGHTBEGIN#### -// ------------------------------------------- -// This file is part of eCos, the Embedded Configurable Operating System. -// Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc. -// -// eCos 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 or (at your option) any later version. -// -// eCos 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 eCos; if not, write to the Free Software Foundation, Inc., -// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. -// -// As a special exception, if other files instantiate templates or use macros -// or inline functions from this file, or you compile this file and link it -// with other works to produce a work based on this file, this file does not -// by itself cause the resulting work to be covered by the GNU General Public -// License. However the source code for this file must still be made available -// in accordance with section (3) of the GNU General Public License. -// -// This exception does not invalidate any other reasons why a work based on -// this file might be covered by the GNU General Public License. -// -// Alternative licenses for eCos may be arranged by contacting Red Hat, Inc. -// at http://sources.redhat.com/ecos/ecos-license/ -// ------------------------------------------- -//####ECOSGPLCOPYRIGHTEND#### -//========================================================================== -//#####DESCRIPTIONBEGIN#### -// -// Author(s): gthomas -// Contributors: gthomas -// Date: 2000-07-14 -// Purpose: -// Description: -// -// This code is part of RedBoot (tm). -// -//####DESCRIPTIONEND#### -// -//========================================================================== - -#include <redboot.h> - -#include <cyg/hal/hal_ebsa285.h> // Board definitions -#include <cyg/hal/hal_intr.h> -#include <cyg/hal/hal_cache.h> - -// Exported CLI function(s) -static void do_exec(int argc, char *argv[]); -RedBoot_cmd("exec", - "Execute an image - with MMU off", - "[-w timeout] [-b <load addr> [-l <length>]] - [-r <ramdisk addr> [-s <ramdisk length>]] - [-c \"kernel command line\"] [<entry_point>]", - do_exec - ); - -typedef void code_fun(void); - -static void -do_exec(int argc, char *argv[]) -{ - unsigned long entry; - unsigned long oldints; - code_fun *fun, *prg; - bool wait_time_set; - int wait_time, res, i; - bool base_addr_set, length_set, cmd_line_set; - bool ramdisk_addr_set, ramdisk_size_set; - unsigned long base_addr, length; - unsigned long ramdisk_addr, ramdisk_size; - struct option_info opts[6]; - char line[8]; - unsigned long *_prg, *ip; - char *cmd_line; - struct param_struct { - unsigned long key; - unsigned long rd_start; - unsigned long rd_size; - unsigned char cmdline[256]; - } *params = (struct param_struct *)0x100; - - entry = (unsigned long)entry_address; // Default from last 'load' operation - base_addr = 0x8000; - init_opts(&opts[0], 'w', true, OPTION_ARG_TYPE_NUM, - (void **)&wait_time, (bool *)&wait_time_set, "wait timeout"); - init_opts(&opts[1], 'b', true, OPTION_ARG_TYPE_NUM, - (void **)&base_addr, (bool *)&base_addr_set, "base address"); - init_opts(&opts[2], 'l', true, OPTION_ARG_TYPE_NUM, - (void **)&length, (bool *)&length_set, "length"); - init_opts(&opts[3], 'c', true, OPTION_ARG_TYPE_STR, - (void **)&cmd_line, (bool *)&cmd_line_set, "kernel command line"); - init_opts(&opts[4], 'r', true, OPTION_ARG_TYPE_NUM, - (void **)&ramdisk_addr, (bool *)&ramdisk_addr_set, "ramdisk_addr"); - init_opts(&opts[5], 's', true, OPTION_ARG_TYPE_NUM, - (void **)&ramdisk_size, (bool *)&ramdisk_size_set, "ramdisk_size"); - if (!scan_opts(argc, argv, 1, opts, 6, (void *)&entry, OPTION_ARG_TYPE_NUM, "starting address")) - { - return; - } - if (cmd_line_set || ramdisk_addr_set) { - params->key = 0xDEADF00D;; - params->rd_size = 0; - } - if (cmd_line_set) { - strcpy(params->cmdline, cmd_line); - } - if (ramdisk_addr_set) { - params->rd_start = ramdisk_addr; - if (ramdisk_size_set) { - params->rd_size = ramdisk_size; - } else { - params->rd_size = 4096*1024; - } - } - if (wait_time_set) { - diag_printf("About to start execution at %p - abort with ^C within %d seconds\n", - (void *)entry, wait_time); - res = _rb_gets(line, sizeof(line), wait_time*1000); - if (res == _GETS_CTRLC) { - return; - } - } - if (base_addr_set && !length_set) { - diag_printf("Length required for non-standard base address\n"); - return; - } - ip = (unsigned long *)&&lab1; - _prg = (unsigned long *)0x1F00; // Should be a very safe location to execute from - for (i = 0; i < (unsigned long)&&end1-(unsigned long)&&lab1; i++) { - _prg[i] = *ip++; - } - HAL_DISABLE_INTERRUPTS(oldints); - HAL_DCACHE_SYNC(); - HAL_ICACHE_DISABLE(); - HAL_DCACHE_DISABLE(); - HAL_DCACHE_SYNC(); - HAL_ICACHE_INVALIDATE_ALL(); - HAL_DCACHE_INVALIDATE_ALL(); - ip = (unsigned long *)_prg; - // Now call this code - fun = (code_fun *)((entry & 0x0FFFFFFF) + EBSA285_RAM_BANK0_BASE); // Absolute address - prg = (code_fun *)((unsigned long)ip + EBSA285_RAM_BANK0_BASE); // Absolute address - asm volatile ("mov r5,%0;" - "mov r2,%1;" - "mov r3,%2;" - "mov r1,%3;" - "mov pc,r1" : : - "r"(fun),"r"(base_addr),"r"(length),"r"(prg) : "r5","r2","r3","r1"); - // asm volatile ("mov r2,%0" : : "r"(base_addr) : "r2"); - // asm volatile ("mov r3,%0" : : "r"(length) : "r3"); - // asm volatile ("mov r1,%0; mov pc,r1" : : "r"(prg) : "r1"); - lab1: - // Tricky code. We are currently running with the MMU on and the - // memory map convoluted from 1-1. This code must be copied to RAM - // and then executed at the non-mapped address. Then when the code - // turns off the MMU, the control flow is unchanged and control can - // be passed safely to the program to be executed. - // This magic was created in order to be able to execute standard - // Linux kernels with as little change/perturberance as possible. - // ".long 0xE7FFDEFE;" // Illegal - asm volatile ("mrs r1,cpsr;" - "bic r0,r1,#0x1F;" // Put processor in IRQ mode - "orr r0,r0,#0x12;" - "msr cpsr,r0;" - "msr spsr,r1;" - "mov lr,r5;" - "mov sp,r5;" // Give the kernel a stack just below the entry point - "mov r1,#0;" - "mcr p15,0,r1,c1,c0;" // Turns off MMU, caches - "mov r1,#0x8000;" // Default kernel load address - "cmp r2,r1;" // Is it there? - "beq 10f;" - "ldr r4,=0x40012000;mov r5,#0;str r5,[r4];" - "05:;" - "ldr r4,[r2],#4;" - "str r4,[r1],#4;" - "sub r3,r3,#4;" - "cmp r3,#0;" - "bne 05b;" - "10:;" - "mov r0,#0;" // Set up SA110 load magic - "mov r1,#0x4;" - "ldr r4,=0x40012000;mov r5,#1;str r5,[r4];" - "movs pc,lr" : : ); - end1: -}
--- a/packages/hal/mips/arch/current/ChangeLog +++ b/packages/hal/mips/arch/current/ChangeLog @@ -1,3 +1,8 @@ +2002-08-02 Andrew Lunn <Andrew.Lunn@ascom.ch> + + * cdl/hal_mips.cdl: Redboot exec command can now be disabled + by CDL + 2002-05-17 Jesper Skov <jskov@redhat.com> * include/hal_intr.h: Fix CYGNUM_HAL_EXCEPTION_MIN definition so
--- a/packages/hal/mips/arch/current/cdl/hal_mips.cdl +++ b/packages/hal/mips/arch/current/cdl/hal_mips.cdl @@ -153,6 +153,7 @@ cdl_package CYGPKG_HAL_MIPS { configuration." cdl_component CYGSEM_REDBOOT_MIPS_LINUX_BOOT { + active_if CYGBLD_BUILD_REDBOOT_WITH_EXEC display "Support booting Linux via RedBoot" flavor bool default_value 1
--- a/packages/hal/mn10300/asb2305/current/ChangeLog +++ b/packages/hal/mn10300/asb2305/current/ChangeLog @@ -1,3 +1,8 @@ +2002-08-02 Andrew Lunn <Andrew.Lunn@ascom.ch> + + * cdl/hal_mn10300_am33_asb2305.cdl: Redboot exec command can now + be disabled by CDL + 2001-10-18 David Howells <dhowells@redhat.com> * cdl/hal_mn10300_am33_asb2305.cdl: change incorrect "BootFlash"
--- a/packages/hal/mn10300/asb2305/current/cdl/hal_mn10300_am33_asb2305.cdl +++ b/packages/hal/mn10300/asb2305/current/cdl/hal_mn10300_am33_asb2305.cdl @@ -373,8 +373,19 @@ cdl_package CYGPKG_HAL_MN10300_AM33_ASB2 description " This option lists the target's requirements for a valid Redboot configuration." - - compile -library=libextras.a redboot_cmds.c + + cdl_component CYGPKG_REDBOOT_HAL_LINUX_EXEC { + display "Provide the exec command in RedBoot" + flavor none + no_define + parent CYGPKG_REDBOOT_HAL_OPTIONS + active_if CYGBLD_BUILD_REDBOOT_WITH_EXEC + description " + This option contains requirements for booting linux + from RedBoot. The component is enabled/disabled from + RedBoots CDL." + compile -library=libextras.a redboot_cmds.c + } cdl_option CYGBLD_BUILD_REDBOOT_BIN { display "Build Redboot ROM binary image"
--- a/packages/hal/powerpc/mbx/current/ChangeLog +++ b/packages/hal/powerpc/mbx/current/ChangeLog @@ -1,3 +1,8 @@ +2002-08-02 Andrew Lunn <Andrew.Lunn@ascom.ch> + + * cdl/hal_powerpc_mbx.cdl: Redboot exec command can now be disabled + by CDL + 2002-06-27 Gary Thomas <gary@chez-thomas.org> * include/plf_regs.h: New file - platform overrides.
--- a/packages/hal/powerpc/mbx/current/cdl/hal_powerpc_mbx.cdl +++ b/packages/hal/powerpc/mbx/current/cdl/hal_powerpc_mbx.cdl @@ -348,6 +348,7 @@ cdl_package CYGPKG_HAL_POWERPC_MBX { configuration." cdl_option CYGSEM_REDBOOT_HAL_LINUX_BOOT { + active_if CYGBLD_BUILD_REDBOOT_WITH_EXEC display "Support booting Linux via RedBoot" flavor bool default_value 1
--- a/packages/hal/powerpc/viper/current/ChangeLog +++ b/packages/hal/powerpc/viper/current/ChangeLog @@ -1,3 +1,8 @@ +2002-08-02 Andrew Lunn <Andrew.Lunn@ascom.ch> + + * cdl/hal_powerpc_viper.cdl: the RedBoot exec command can now + be disabled by CDL + 2002-07-31 Gary Thomas <gary@chez-thomas.org> * misc/redboot_ROMRAM.ecm:
--- a/packages/hal/powerpc/viper/current/cdl/hal_powerpc_viper.cdl +++ b/packages/hal/powerpc/viper/current/cdl/hal_powerpc_viper.cdl @@ -335,6 +335,7 @@ cdl_package CYGPKG_HAL_POWERPC_VIPER { configuration." cdl_option CYGSEM_REDBOOT_HAL_LINUX_BOOT { + active_if CYGBLD_BUILD_REDBOOT_WITH_EXEC display "Support booting Linux via RedBoot" flavor bool default_value 1
--- a/packages/hal/sh/arch/current/ChangeLog +++ b/packages/hal/sh/arch/current/ChangeLog @@ -1,3 +1,8 @@ +2002-08-02 Andrew Lunn <Andrew.Lunn@ascom.ch> + + * cdl/hal_sh.cdl: The Redboot exec command can now be + disabled by CDL + 2002-04-30 Jesper Skov <jskov@redhat.com> * include/hal_var_sp.inc: Allow variant to provide custom
--- a/packages/hal/sh/arch/current/cdl/hal_sh.cdl +++ b/packages/hal/sh/arch/current/cdl/hal_sh.cdl @@ -231,6 +231,7 @@ cdl_package CYGPKG_HAL_SH { configuration." cdl_component CYGSEM_REDBOOT_SH_LINUX_BOOT { + active_if CYGBLD_BUILD_REDBOOT_WITH_EXEC display "Support booting Linux via RedBoot" flavor bool default_value 1 @@ -294,3 +295,4 @@ cdl_package CYGPKG_HAL_SH { } } } +
