--- zzzz-none-000/linux-4.1.38/arch/arm/kernel/atags_parse.c 2017-01-18 18:48:06.000000000 +0000 +++ bcm63-7582-715/linux-4.1.38/arch/arm/kernel/atags_parse.c 2020-11-25 10:06:48.000000000 +0000 @@ -25,12 +25,15 @@ #include #include +#include #include #include #include #include "atags.h" +extern char eva_urlader_env[SZ_16K]; + static char default_command_line[COMMAND_LINE_SIZE] __initdata = CONFIG_CMDLINE; #ifndef MEM_SIZE @@ -70,6 +73,71 @@ __tagtable(ATAG_MEM, parse_tag_mem32); +/*------------------------------------------------------------------------------------------*\ +\*------------------------------------------------------------------------------------------*/ +static int __init parse_tag_envp(const struct tag *tag) +{ + char *end; + char **start; + char **envp; + int mem = 0; + /*--- printk("starting parse_tag_envp: %x\n", tag->u.envp.envp); ---*/ + envp = phys_to_virt(tag->u.envp.envp); + /*--- printk("Envp-Addr= 0x%lx \n", (unsigned long)envp); ---*/ + if ( !envp || !*envp ) { + printk(KERN_DEBUG "[%s] envp == NULL \n", __FUNCTION__); + return 0; + } + + /*--- printk("parse_tag_envp: envp=0x%lx, *envp=%lx \n", (unsigned long)envp, ((unsigned long)(*envp))); ---*/ + while((envp) && (*envp)) + { + /*--- printk("looping\n"); ---*/ + /*--- printk("mem=%d, [%s] \n", mem, *envp); ---*/ + mem += strlen(*envp) + 1 + sizeof(*envp); + envp++; + } + mem+= sizeof(*envp); /*--- Fuer den terminalen NULL-Pointer ---*/ + + printk("final mem=%d \n", mem); + BUG_ON(sizeof(eva_urlader_env) < mem); + envp = phys_to_virt(tag->u.envp.envp); + start = (char **)eva_urlader_env; + end = eva_urlader_env + mem; + + /*--- von vorne werden die Pointer eingefuegt von hinten die Daten ---*/ + while(envp && *envp) + { + int length = strlen(*envp); + + end -= length + 1; + strcpy(end, *envp); + + *start++ = end; + BUG_ON(end <= (char *)start); + + envp++; + } + *start++ = NULL; /*--- Terminiation wird durch NULL-Pointer symbolisiert ---*/ + printk("annex: %s \n",prom_getenv("annex")); + return 0; +} + +__tagtable(ATAG_ENVP, parse_tag_envp); + +/*------------------------------------------------------------------------------------------*\ +\*------------------------------------------------------------------------------------------*/ +static int __init parse_tag_wlandect_config(const struct tag *tag) { + + unsigned int value = tag->u.wlan_dect.address; + + set_wlan_dect_config_address(value); + return 0; + +} +__tagtable(ATAG_WLAN_DECT_CONF, parse_tag_wlandect_config); + + #if defined(CONFIG_VGA_CONSOLE) || defined(CONFIG_DUMMY_CONSOLE) static int __init parse_tag_videotext(const struct tag *tag) { @@ -140,6 +208,26 @@ __tagtable(ATAG_CMDLINE, parse_tag_cmdline); +#if defined(CONFIG_BCM_KF_ARM_BCM963XX) +static int __init parse_tag_blparm(const struct tag *tag) +{ + /* a dummy function that it has been handled in + * bcm63xx's machine setup code */ + return 0; +} + +__tagtable(ATAG_BLPARM, parse_tag_blparm); + +static int __init parse_tag_rdpsize(const struct tag *tag) +{ + /* a dummy function that it has been handled in + * bcm63xx's machine setup code */ + return 0; +} + +__tagtable(ATAG_RDPSIZE, parse_tag_rdpsize); +#endif /* (CONFIG_BCM_KF_ARM_BCM963XX) */ + /* * Scan the tag table for this tag, and call its parse function. * The tag table is built by the linker from all the __tagtable