1. 12 8月, 2019 1 次提交
  2. 08 8月, 2019 2 次提交
    • P
      console: execute flush on uart when silent is removed · 13551b91
      Patrick Delaunay 提交于
      Avoid to flush buffer when silent console is activated as the
      console can be reactivate later, after relocation, when the env will
      be updated with the saved one.
      
      Solve issue (missing beginning of U-Boot trace) when:
      - CONFIG_SILENT_CONSOLE is activated
      - silent=1 is defined in default environment (CONFIG_EXTRA_ENV_SETTINGS)
      - silent is removed in saved environment with:
            > env delete silent; env save
      
      Only functional when PRE_CONSOLE_BUFFER is activated.
      Signed-off-by: NPatrick Delaunay <patrick.delaunay@st.com>
      Signed-off-by: NPatrice Chotard <patrice.chotard@st.com>
      13551b91
    • P
      console: update silent tag after env load · bf46be72
      Patrick Delaunay 提交于
      Update the "silent" property with the variable "silent" get from
      saved environment, it solves the issue when:
      - CONFIG_SILENT_CONSOLE and CONFIG_SYS_CONSOLE_IS_IN_ENV are activated
      - silent is not defined in default environment
      - silent is requested in saved environment with:
        > env set silent 1; env save
      
      On next reboot the console is not disabled as expected after relocation
      and the environment load from flash (the callback is not called when
      the INSERT is requested in the created hash table)
      Signed-off-by: NPatrick Delaunay <patrick.delaunay@st.com>
      Signed-off-by: NPatrice Chotard <patrice.chotard@st.com>
      bf46be72
  3. 26 11月, 2018 1 次提交
  4. 11 9月, 2018 1 次提交
  5. 27 7月, 2018 2 次提交
  6. 19 6月, 2018 1 次提交
  7. 07 5月, 2018 2 次提交
    • T
      SPDX: Convert all of our single license tags to Linux Kernel style · 83d290c5
      Tom Rini 提交于
      When U-Boot started using SPDX tags we were among the early adopters and
      there weren't a lot of other examples to borrow from.  So we picked the
      area of the file that usually had a full license text and replaced it
      with an appropriate SPDX-License-Identifier: entry.  Since then, the
      Linux Kernel has adopted SPDX tags and they place it as the very first
      line in a file (except where shebangs are used, then it's second line)
      and with slightly different comment styles than us.
      
      In part due to community overlap, in part due to better tag visibility
      and in part for other minor reasons, switch over to that style.
      
      This commit changes all instances where we have a single declared
      license in the tag as both the before and after are identical in tag
      contents.  There's also a few places where I found we did not have a tag
      and have introduced one.
      Signed-off-by: NTom Rini <trini@konsulko.com>
      83d290c5
    • T
      stdio_names: Ensure MAX_NAMES is defined before use, don't use 3 directly · 27b4225b
      Tom Rini 提交于
      With tighter build flags the fact that <stdio_dev.h> doesn't have a
      reference back to MAX_NAMES causes an error.  Include <stdio.h> here and
      then in common/console.c use MAX_NAMES rather than 3 when working with
      stdio_names.
      Reported-by: NPeter Robinson <pbrobinson@gmail.com>
      Signed-off-by: NTom Rini <trini@konsulko.com>
      Tested-by: NPeter Robinson <pbrobinson@gmail.com>
      27b4225b
  8. 08 12月, 2017 1 次提交
  9. 13 11月, 2017 1 次提交
  10. 28 8月, 2017 1 次提交
    • W
      common: console: Fix duplicated CONFIG in silent env callback · 5daf6e56
      Wilson Lee 提交于
      The silent environment callback function does not update the silent
      flag during silent env set or unset. That is because of duplicated
      CONFIG keyword at preprocessor condition in silent environment
      callback function and cause silent env callback unable to work.
      
      This patch is to remove the duplicated CONFIG keywork in silent
      environment callback function.
      Signed-off-by: NWilson Lee <wilson.lee@ni.com>
      Cc: Keng Soon Cheah <keng.soon.cheah@ni.com>
      Cc: Chen Yee Chew <chen.yee.chew@ni.com>
      Cc: Joe Hershberger <joe.hershberger@ni.com>
      5daf6e56
  11. 16 8月, 2017 2 次提交
  12. 01 8月, 2017 2 次提交
  13. 29 7月, 2017 1 次提交
  14. 12 7月, 2017 3 次提交
  15. 06 2月, 2017 1 次提交
  16. 24 10月, 2016 2 次提交
  17. 18 10月, 2016 1 次提交
    • A
      watchdog: Fix Watchdog Reset while in U-Boot Prompt · 64407467
      Andreas J. Reichel 提交于
      Hardware: CM-FX6 Module from Compulab
      
      This patch fixes unwanted watchdog resets while the user enters
      a command at the U-Boot prompt.
      
      As found on the CM-FX6 board from Compulab, when having enabled the
      watchdog, a missing WATCHDOG_RESET call in common/console.c causes
      this and alike boards to reset when the watchdog's timeout has
      elapsed while waiting at the U-Boot prompt.
      
      Despite the user could press several keys within the watchdog
      timeout limit, the while loop in cli_readline.c, line 261, does only
      call WATCHDOG_RESET if first == 1, which gets set to 0 in the 1st
      loop iteration. This leads to a watchdog timeout no matter if the
      user presses keys or not.
      
      Although, this affects other boards as well as it touches
      common/console.c, the macro WATCHDOG_RESET expands to {} if watchdog
      support isn't configured. Hence, there's no harm caused and no need to
      surround it by #ifdef in this case.
      
       * Symptom:
         U-Boot resets after watchdog times out when in commandline prompt
         and watchdog is enabled.
      
       * Reasoning:
         When U-Boot shows the commandline prompt, the following function
         call stack is executed while waiting for a keypress:
      
         common/main.c:
                          main_loop          => common/cli.c: cli_loop() =>
         common/cli_hush.c:
                          parse_file_outer   => parse_stream_outer       =>
                          parse_stream       => b_getch(i)               =>
                          i->get(i)          => file_get                 =>
                          get_user_input     => cmdedit_read_input       =>
                          uboot_cli_readline =>
         common/cli_readline.c:
                          cli_readline       => cli_readline_into_buffer =>
                          cread_line         => getcmd_getch (== getc)   =>
         common/console.c:
                          fgetc              => console_tstc
      
         common/console.c:
         (with CONFIG_CONSOLE_MUX is set)
      
         - in console_tstc line 181:
         If dev->tstc(dev) returns 0, the global tstcdev variable doesn't get
         set. This is the case if no character is in the serial buffer.
      
         - in fgetc(int file), line 297:
         Program flow keeps looping because tstcdev does not get set.
         Therefore WATCHDOG_RESET is not called, as mx_serial_tstc from
         drivers/serial/serial_mxc.c does not call it.
      
       * Solution:
         Add WATCHDOG_RESET into the loop of console_tstc.
      
         Note: Macro expands to {} if not configured, so no #ifdef is needed.
      
       * Comment:
      Signed-off-by: NChristian Storm <christian.storm@tngtech.com>
      Signed-off-by: NJan Kiszka <jan.kiszka@siemens.com>
      Signed-off-by: NAndreas J. Reichel <Andreas.Reichel@tngtech.com>
      Acked-by: NSimon Glass <sjg@chromium.org>
      64407467
  18. 07 10月, 2016 1 次提交
  19. 27 3月, 2016 1 次提交
  20. 12 2月, 2016 1 次提交
  21. 25 1月, 2016 1 次提交
  22. 23 11月, 2015 3 次提交
    • S
      lib/tiny-printf.c: Add tiny printf function for space limited environments · 7d9cde10
      Stefan Roese 提交于
      This patch adds a small printf() version that supports all basic formats.
      Its intented to be used in U-Boot SPL versions on platforms with very
      limited internal RAM sizes.
      
      To enable it, just define CONFIG_USE_TINY_PRINTF in your defconfig. This
      will result in the SPL using this tiny function and the main U-Boot
      still using the full-blown printf() function.
      
      This code was copied from:
      http://www.sparetimelabs.com/printfrevisited
      With mostly only coding style related changes so that its checkpatch
      clean.
      
      The size reduction is about 2.5KiB. Here a comparison for the db-mv784mp-gp
      (Marvell AXP) SPL:
      
      Without this patch:
        58963   18536    1928   79427   13643 ./spl/u-boot-spl
      
      With this patch:
        56542   18536    1956   77034   12cea ./spl/u-boot-spl
      
      Note:
      To make it possible to compile tiny-printf.c instead of vsprintf.c when
      CONFIG_USE_TINY_PRINTF is defined, the functions printf() and vprintf() are
      moved from common/console.c into vsprintf.c in this patch.
      Signed-off-by: NStefan Roese <sr@denx.de>
      Cc: Simon Glass <sjg@chromium.org>
      Cc: Hans de Goede <hdegoede@redhat.com>
      Cc: Tom Rini <trini@konsulko.com>
      Cc: Albert Aribaud <albert.u.boot@aribaud.net>
      7d9cde10
    • S
      common/console.c: Small coding style cleanup · ddf7355a
      Stefan Roese 提交于
      Change some comments to match the U-Boot coding style rules.
      Signed-off-by: NStefan Roese <sr@denx.de>
      Cc: Simon Glass <sjg@chromium.org>
      Acked-by: NSimon Glass <sjg@chromium.org>
      ddf7355a
    • S
      common/console.c: Drop sandbox special-case console code · dd557770
      Stefan Roese 提交于
      As done in commit da229e4e [sandbox: Drop special-case sandbox console code],
      this patch drops the sandbox special-case code in vprintf() that was
      missed by Simon at that time.
      Signed-off-by: NStefan Roese <sr@denx.de>
      Cc: Simon Glass <sjg@chromium.org>
      Acked-by: NSimon Glass <sjg@chromium.org>
      dd557770
  23. 20 11月, 2015 2 次提交
    • S
      console: Add a console buffer · 9854a874
      Simon Glass 提交于
      It is useful to be able to record console output and provide console input
      via a buffer. This provides sandbox with the ability to run a command and
      check its output. If the console is set to silent then no visible output
      is generated.
      
      This also provides a means to fix the problem where tests produce unwanted
      output, such as errors or warnings. This can be confusing. We can instead
      set the console to silent and record this output. It can be checked later
      in the test if required.
      
      It is possible that this may prove useful for non-test situations. For
      example the console output may be suppressed for normal operations, but
      recorded and stored for access by the OS. That feature is not implemented
      at present.
      Signed-off-by: NSimon Glass <sjg@chromium.org>
      9854a874
    • S
      Move console definitions into a new console.h file · 24b852a7
      Simon Glass 提交于
      The console includes a global variable and several functions that are only
      used by a small subset of U-Boot files. Before adding more functions, move
      the definitions into their own header file.
      Signed-off-by: NSimon Glass <sjg@chromium.org>
      24b852a7
  24. 22 7月, 2015 2 次提交
  25. 20 5月, 2015 1 次提交
    • H
      console: Fix pre-console flushing via cfb_console being very slow · a8552c7c
      Hans de Goede 提交于
      On my A10 OlinuxIno Lime I noticed a huge (5+ seconds) delay coming from
      console_init_r. This turns out to be caused by the preconsole buffer flushing
      to the cfb_console. The Lime only has a 16 bit memory bus and that is already
      heavy used to scan out the 1920x1080 framebuffer.
      
      The problem is that print_pre_console_buffer() was printing the buffer once
      character at a time and the cfb_console code then ends up doing a cache-flush
      for touched display lines for each character.
      
      This commit fixes this by first building a 0 terminated buffer and then
      printing it in one puts() call, avoiding unnecessary cache flushes.
      
      This changes the time for the flush from 5+ seconds to not noticable.
      
      The downside of this approach is that the pre-console buffer needs to fit
      on the stack, this is not that much to ask since we are talking about plain
      text here. This commit also adjusts the sunxi CONFIG_PRE_CON_BUF_SZ to
      actually fit on the stack. Sunxi currently is the only user of the pre-console
      code so no other boards need to be adjusted.
      Signed-off-by: NHans de Goede <hdegoede@redhat.com>
      Reviewed-by: NTom Rini <trini@konsulko.com>
      a8552c7c
  26. 30 1月, 2015 1 次提交
    • M
      Export redesign · 49cad547
      Martin Dorwig 提交于
      this is an atempt to make the export of functions typesafe.
      I replaced the jumptable void ** by a struct (jt_funcs) with function pointers.
      The EXPORT_FUNC macro now has 3 fixed parameters and one
      variadic parameter
      The first is the name of the exported function,
      the rest of the parameters are used to format a functionpointer
      in the jumptable,
      
      the EXPORT_FUNC macros are expanded three times,
      1. to declare the members of the struct
      2. to initialize the structmember pointers
      3. to call the functions in stubs.c
      Signed-off-by: NMartin Dorwig <dorwig@tetronik.com>
      Acked-by: NSimon Glass <sjg@chromium.org>
      Signed-off-by: NSimon Glass <sjg@chromium.org>
      (resending to the list since my tweaks are not quite trivial)
      49cad547
  27. 14 1月, 2015 1 次提交
  28. 08 12月, 2014 1 次提交
    • S
      Fix console functions for U-Boot API · d8727713
      Simon Glass 提交于
      Commit 709ea543 made a subtle change to the way the U-Boot API jump table
      is set up. So at present putc(), getc(), tstc() and puts() do not work
      correctly from functions that use the U-Boot API.
      
      Previously these were set to the stdio functions, but these now take a
      parameter specifying which stdio device to use. Instead, we should change
      them to use the global functions which do not have a parameter.
      
      This is a slight change in behaviour. The functions will now output to
      all selected stdio devices - for example putc() will output a character to
      all devices selected by stdout. However in most cases there is only one,
      and it isn't necessarily incorrect behaviour anyway.
      
      The API version is not changed since it is compatible with what was there
      before.
      Reported-by: NMartin Dorwig <dorwig@tektronik.com>
      Signed-off-by: NSimon Glass <sjg@chromium.org>
      d8727713