All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] U-boot does not silence its output
@ 2018-10-07 16:58 mrigendra
  0 siblings, 0 replies; only message in thread
From: mrigendra @ 2018-10-07 16:58 UTC (permalink / raw)
  To: u-boot

I have this uboot

    VERSION = 2017
    PATCHLEVEL = 03

I am trying to silent the console using the silent variable.I defined this
`#define CONFIG_SILENT_CONSOLE`
So at boot time I am interrupting the console, and entering

    setenv silent 1
    save
    reset

Now after reset, or power on reset I try again get console logs.After seeing
env variables

    printenv

I see my saved variable correctly in env varibles

    silent=1

but still u-boot is not silent. I suspect this function is failing at
checking for this env variable,

        char *getenv(const char *name)
    {
    	if (gd->flags & GD_FLG_ENV_READY) { /* after import into hashtable */
    		ENTRY e, *ep;
    
    		WATCHDOG_RESET();
    
    		e.key	= name;
    		e.data	= NULL;
    		hsearch_r(e, FIND, &ep, &env_htab, 0); /*this function is maybe
returning*/
    
    		return ep ? ep->data : NULL;
    	}
    
    	/* restricted capabilities before import */
    	if (getenv_f(name, (char *)(gd->env_buf), sizeof(gd->env_buf)) > 0)
    		return (char *)(gd->env_buf);
    
    	return NULL;
    }

But what exactly is happening?
Is there something like before relocation time env variables and after
relocation env variables because the function,

    static void console_update_silent(void)
    {
    #ifdef CONFIG_SILENT_CONSOLE
    	if (getenv("silent") != NULL){
    		puts("silent");
    		gd->flags |= GD_FLG_SILENT;
    	}
    	else{
    		puts("Non silent");
    		gd->flags &= ~GD_FLG_SILENT;
    	}
    #endif
    }
    
    /* Called before relocation - use serial functions */
    int console_init_f(void)
    {
    	gd->have_console = 1;
    
    	console_update_silent();
    
    	print_pre_console_buffer(PRE_CONSOLE_FLUSHPOINT1_SERIAL);
    	
    	return 0;
    }

`console_init_f` says its before relocation.
I have put some prints to see and always gets non silent, even if I have
saved the silent variable,

I am using a sd card to boot(mmc), I don't have any debugger, so I
I tried printing default environment, as

    env print default
    ## Error: "default" not defined

So there is not default environment too.

Any tips or help will make me understand.

P.S.

I explicitly defined silent in `#define CONFIG_EXTRA_ENV_SETTINGS`
Now u-boot is silent.

Doing a `setenv silent` should remove this from env variable, and I can see
that its gone, but still on reboot my uboot is silent. 
So something about environment variable is clearly mystery to me.



--
Sent from: http://u-boot.10912.n7.nabble.com/

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2018-10-07 16:58 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-07 16:58 [U-Boot] U-boot does not silence its output mrigendra

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.