30 Nov, 2018

15 commits

  • store fdt header member with name in U-Boot
    Environment variable with name .

    for example to get the total length of the fdt and store
    it in filesize, call:

    fdt header get filesize totalsize

    For membernames look into fdt header definition at
    scripts/dtc/libfdt/libfdt.h

    Signed-off-by: Heiko Schocher
    Reviewed-by: Simon Glass

    Heiko Schocher
     
  • The use of strcpy() to remove characters at the start of a string is safe
    in U-Boot, since we know the implementation. But in os.c we are using the
    C library's strcpy() function, where this behaviour is not permitted.

    Update the code to use memmove() instead.

    Reported-by: Coverity (CID: 173279)
    Signed-off-by: Simon Glass
    Reviewed-by: Alexander Graf

    Simon Glass
     
  • Now that the buffer-overflow bug is fixed, we can enable sound on sandbox.
    Drop the code which exits early.

    Signed-off-by: Simon Glass

    Simon Glass
     
  • At present we request a particular frequency but we may not get the exact
    same frequency in response. So use the actual frequency for generation of
    the square wave. This ensures that the pitch remains accurate on all host
    machines.

    Signed-off-by: Simon Glass

    Simon Glass
     
  • At present this value is hard-coded in the function that generates a
    square wave. Since sample rates vary between different hardware, it makes
    more sense to have this as a parameter.

    Update the function and its users.

    Signed-off-by: Simon Glass

    Simon Glass
     
  • This function currently outputs twice as much data as it should and
    overwrites its buffer as a result. Fix it.

    Signed-off-by: Simon Glass

    Simon Glass
     
  • Some RTC chips have child drivers, e.g. to provide access to their
    non-volatile RAM. Scan for these when binding.

    Signed-off-by: Simon Glass

    Simon Glass
     
  • Update the device tree, sandbox i2c driver and tests to use the new
    emulation parent to hold emulators.

    Signed-off-by: Simon Glass

    Simon Glass
     
  • Sandbox i2c works using emulation drivers which are currently children of
    the i2c device:

    rtc_0: rtc@43 {
    reg = ;
    compatible = "sandbox-rtc";
    emul {
    compatible = "sandbox,i2c-rtc";
    };
    };

    In this case the emulation device is attached to i2c bus on address 0x43
    and provides the Real-Time-Clock (RTC) functionality.

    However this is not ideal, since every device on an I2C bus has a child
    device. This is only really the case for sandbox, but we want to avoid
    special-case code for sandbox.

    A better approach seems to be to add a separate node on the bus, an
    'emulation parent'. This can be given a bogus address (such as 0xff) and
    hides all the emulators away. Then we can use a phandle to point from the
    device to the correct emualtor, and only on sandbox. The code to find an
    emulator does not interfere with normal i2c operation.

    Add a new UCLASS_I2C_EMUL_PARENT uclass which allows finding an emulator
    given a bus, and finding a bus given an emulator. This will be used in a
    follow-on patch.

    Signed-off-by: Simon Glass

    Simon Glass
     
  • This is currently at the top in the space for internal use. But this
    uclass is used outside driver model and test code. Move it into the
    correct alpha order.

    Signed-off-by: Simon Glass

    Simon Glass
     
  • Add two functions which can find a child device by uclass or by name.
    The first is useful with Multi-Function-Devices (MFDs) to find one of a
    particular type. The second is useful when only the name is known.

    Signed-off-by: Simon Glass

    Simon Glass
     
  • This function may be useful to code outside of the code driver-model
    implementation. Export it and add a test.

    Signed-off-by: Simon Glass

    Simon Glass
     
  • At present tests are quite slow to run, over a minute on my machine. This
    presents a considerable barrier to bisecting for failures.

    The slowest tests are the filesystem ones and the buildman --fetch-arch
    test. Add a new 'qcheck' target that skips these tests. This reduces test
    time down to about 40 second, still too long, but bearable.

    Signed-off-by: Simon Glass

    Simon Glass
     
  • There is a newline missing from quite a few printf() strings in these pmic
    files. Fix them.

    Signed-off-by: Simon Glass
    Reviewed-by: Lukasz Majewski

    Simon Glass
     
  • It is sometimes useful to see what memory is being allocated early during
    boot. Add logging to support this, using a new LOGC_ALLOC category.

    Signed-off-by: Simon Glass

    Simon Glass
     

29 Nov, 2018

19 commits


28 Nov, 2018

1 commit


27 Nov, 2018

5 commits