/*
* (C) Copyright 2000-2003
* Wolfgang Denk, DENX Software Engineering, wd@denx.de.
*
* See file CREDITS for list of people who contributed to this
* project.
*
* 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
*/
/*
* Misc boot support
*/
#include #include #include /* Allow ports to override the default behavior */ __attribute__((weak)) unsigned long do_go_exec (ulong (*entry)(int, char *[]), int argc, char *argv[]) { return entry (argc, argv); } int do_go (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) { long addr, rc; int rcode = 0; if (argc < 2) { cmd_usage(cmdtp); return 1; } /************* farsight **************/ char *commandline = getenv("bootargs"); /************* farsight **************/ // Get the kernel parameter data structure address struct param_struct *lht_params=(struct param_struct *)0x20000100; printf("setup linux parameters at 0x20000100n"); memset(lht_params,0,sizeof(struct param_struct)); // Pass the physical memory page size lht_params->u1.s.page_size=4096; // Pass the number of physical memory pages lht_params->u1.s.nr_pages=0x10000000>>12; // Pass kernel parameters memcpy(lht_params->commandline,commandline,strlen(commandline)+1); printf("linux command line is: "%s"n",commandline); /************* farsight **************/ // Get the kernel startup address argv[1]="20008000" addr = simple_strtoul(argv[1], NULL, 16); printf ("## Starting application at 0x%08lX ...n", addr); /************** farsight *************/ __asm__( "ldr r1, =1826n" // 传递machine type id(arch number) // Disable TLB/icache "mov ip, #0n" "mcr p15, 0, ip, c8, c7, 0n" "mcr p15, 0, ip, c7, c5, 0n" "mcr p15, 0, ip, c7, c5, 6n" "mcr p15, 0, ip, c7, c10, 4n" "mcr p15, 0, ip, c7, c5, 4n" // Close mmu "mrc p15, 0, ip, c1, c0, 0n" "bic ip, ip, #0x00002000n" "bic ip, ip, #0x00000007n" "orr ip, ip, #0x00000002n" "orr ip, ip, #0x00000800n" "bic ip, ip, #0x00001000n" "mcr p15, 0, ip, c1, c0, 0n" // Jump to the kernel "mov pc, %[zImage]n" // Clear the pipeline "nopn" : :[zImage]"r"(addr) :"r1" ); /**************** farsight ************/ /* * pass address parameter as argv[0] (aka command name), * and all remaining args */ rc = do_go_exec ((void *)addr, argc - 1, argv + 1); if (rc != 0) rcode = 1; printf ("## Application terminated, rc = 0x%lXn", rc); return rcode; } /* -------------------------------------------------------------------- */ U_BOOT_CMD( go, CONFIG_SYS_MAXARGS, 1, do_go, "start application at address 'addr'", "addr [arg ...]n - start application at address 'addr'n" " passing 'arg' as arguments" ); extern int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]); U_BOOT_CMD( reset, 1, 0, do_reset, "Perform RESET of the CPU", "" );
Previous article:TQ210——Core board and base board
Next article:TQ210 - s5pv210 mem_setup.S analysis
- Popular Resources
- Popular amplifiers
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- LED chemical incompatibility test to see which chemicals LEDs can be used with
- Application of ARM9 hardware coprocessor on WinCE embedded motherboard
- What are the key points for selecting rotor flowmeter?
- LM317 high power charger circuit
- A brief analysis of Embest's application and development of embedded medical devices
- Single-phase RC protection circuit
- stm32 PVD programmable voltage monitor
- Introduction and measurement of edge trigger and level trigger of 51 single chip microcomputer
- Improved design of Linux system software shell protection technology
- What to do if the ABB robot protection device stops
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- RT-Thread's new book is here, full of useful information
- 【Resistors】How to quickly read the color ring? Calculate the resistance value?
- MSP432 Serial Port Settings
- Practice together in 2021 + tomorrow will be better
- TMS320C66x dual loop and multiple loop optimization summary
- Can anyone share the third-party extension library of mixly?
- 【Perf-V Evaluation】Chip Temperature Collection
- [Domestic RISC-V Linux Board Fang·Starlight VisionFive Trial Report] Successfully communicated with DWIN screen
- Looking for unboxing test of AWR1642BOOST
- What happens when a low-speed AD collects a high-frequency signal? (Those who have tried it or done a circuit experiment are welcome to come in!)