1 /******************************************************************************
5 * Instantiation of basic routines that create linux-boot tag list.
7 * Revision information:
9 * 22AUG2004 kb_admin initial creation
12 * No warranty, expressed or implied, is included with this software. It is
13 * provided "AS IS" and no warranty of any kind including statutory or aspects
14 * relating to merchantability or fitness for any purpose is provided. All
15 * intellectual property rights of others is maintained with the respective
16 * owners. This software is not copyrighted and is intended for reference
21 *****************************************************************************/
23 /******************************* GLOBALS *************************************/
25 /********************** PRIVATE FUNCTIONS/DATA/DEFINES ***********************/
28 #define u16 unsigned short
29 #define u8 unsigned char
31 // #include "/usr/src/arm/linux/include/asm/setup.h"
32 #include <linux/asm/setup.h>
35 #define PAGE_SIZE 0x1000
36 #define MEM_SIZE 0x2000000
37 #define PHYS_OFFSET 0x20000000
39 /*************************** GLOBAL FUNCTIONS ********************************/
42 * .KB_C_FN_DEFINITION_START
43 * void InitTagList(char*, void *)
44 * This global function populates a linux-boot style tag list from the
45 * string passed in the pointer at the location specified.
46 * .KB_C_FN_DEFINITION_END
48 void InitTagList(char *parms, void *output) {
51 struct tag *tagList = (struct tag*)output;
53 tagList->hdr.size = tag_size(tag_core);
54 tagList->hdr.tag = ATAG_CORE;
55 tagList->u.core.flags = 1;
56 tagList->u.core.pagesize = PAGE_SIZE;
57 tagList->u.core.rootdev = 0xff;
58 tagList = tag_next(tagList);
60 tagList->hdr.size = tag_size(tag_mem32);
61 tagList->hdr.tag = ATAG_MEM;
62 tagList->u.mem.size = MEM_SIZE;
63 tagList->u.mem.start = PHYS_OFFSET;
64 tagList = tag_next(tagList);
66 tagList->hdr.size = tag_size(tag_cmdline);
67 tagList->hdr.tag = ATAG_CMDLINE;
70 dst = tagList->u.cmdline.cmdline;
76 tagList->hdr.size += ((unsigned)(src - parms) + 1) / sizeof(unsigned);
77 tagList = tag_next(tagList);
79 tagList->hdr.size = 0;
80 tagList->hdr.tag = ATAG_NONE;