TQ210 - s5pv210 cmd_board.c analysis

Publisher:逍遥游侠Latest update time:2020-12-09 Source: eefocusKeywords:TQ210  s5pv210 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

/*

 * (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",

""

);


Keywords:TQ210  s5pv210 Reference address:TQ210 - s5pv210 cmd_board.c analysis

Previous article:TQ210——Core board and base board
Next article:TQ210 - s5pv210 mem_setup.S analysis

Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号