05 Nov, 2015

1 commit

  • Commit: sandbox: add ADC driver

    adds the driver without its main header file.
    It causes build brake for sandbox_defonfig.

    This commit adds a missing header:
    - include/sandbox-adc.h

    Signed-off-by: Przemyslaw Marczak
    Cc: Minkyu Kang
    Cc: Simon Glass
    Signed-off-by: Minkyu Kang

    Przemyslaw Marczak
     

02 Nov, 2015

21 commits

  • This patch will fix these checkpatch issues.

    CHECK: Alignment should match open parenthesis
    + printf("Enter: %s %s\n", mode_name[mode][0],
    + mode_info[mode]);

    CHECK: Alignment should match open parenthesis
    + lcd_printf("\n\n\t%s %s\n", mode_name[mode][0],
    + mode_info[mode]);

    CHECK: Alignment should match open parenthesis
    + lcd_printf("\t%s %s - %s\n\n", selection[i],
    + mode_name[i][0],

    Signed-off-by: Minkyu Kang

    Minkyu Kang
     
  • This patch will fix these checkpatch issues.

    +static const char *mmc_regulators[] = {

    CHECK: Blank lines aren't necessary before a close brace '}'
    +
    +}

    Signed-off-by: Minkyu Kang

    Minkyu Kang
     
  • This patch will fix these checkpatch issues.

    ERROR: spaces required around that '==' (ctx:VxV)
    +#if FCLK_SPEED==0 /* Fout = 203MHz, Fin = 12MHz for Audio */

    ERROR: spaces required around that '==' (ctx:VxV)
    +#elif FCLK_SPEED==1 /* Fout = 202.8MHz */

    ERROR: spaces required around that '==' (ctx:VxV)
    +#if USB_CLOCK==0

    ERROR: spaces required around that '==' (ctx:VxV)
    +#elif USB_CLOCK==1

    CHECK: spaces required around that ':' (ctx:VxV)
    + "bne 1b":"=r" (loops):"0" (loops));

    Signed-off-by: Minkyu Kang

    Minkyu Kang
     
  • This patch will fix these checkpatch issues.

    WARNING: Avoid unnecessary line continuations
    + gd->bd->bi_dram[0].size = get_ram_size((long *)PHYS_SDRAM_1, \

    WARNING: Avoid unnecessary line continuations
    + gd->bd->bi_dram[1].size = get_ram_size((long *)PHYS_SDRAM_2, \

    WARNING: Avoid unnecessary line continuations
    + gd->bd->bi_dram[2].size = get_ram_size((long *)PHYS_SDRAM_3, \

    WARNING: Avoid unnecessary line continuations
    + gd->bd->bi_dram[3].size = get_ram_size((long *)PHYS_SDRAM_4, \

    Signed-off-by: Minkyu Kang

    Minkyu Kang
     
  • This patch will fix these checkpatch issues.

    ERROR: Macros with complex values should be enclosed in parentheses
    +#define DEFAULT_DQS_X4 (DEFAULT_DQS << 24) || (DEFAULT_DQS << 16) \
    + || (DEFAULT_DQS << 8) || (DEFAULT_DQS << 0)

    ERROR: space prohibited before that ',' (ctx:WxW)
    + writel(val , &drex0->concontrol);
    ^

    ERROR: space prohibited before that ',' (ctx:WxW)
    + writel(val , &drex1->concontrol);
    ^

    Signed-off-by: Minkyu Kang

    Minkyu Kang
     
  • The SD card detection depends on checking one pin state.
    But the pin was configured after card was detected, which is wrong.

    This commit fixes this, by moving call to pinmux before use the pin.

    Tested-on: Odroid U3 and Odroid X2.

    Signed-off-by: Przemyslaw Marczak
    Cc: Guillaume GARDET
    Cc: Lukasz Majewski
    Cc: Jaehoon Chung
    Cc: Minkyu Kang
    Cc: Simon Glass
    Acked-by: Jaehoon Chung
    Tested-by: Lukasz Majewski
    Signed-off-by: Minkyu Kang

    Przemyslaw Marczak
     
  • There are 8 pins for SD card in Exynos, but the MUX was configured
    only for 7, since the one was used for card detection.
    This caused the pin's pull wrong configuration.

    This commit fixes this and the card detect can work properly,
    after call this function.

    Tested-on: Odroid U3 and Odroid X2.

    Signed-off-by: Przemyslaw Marczak
    Cc: Guillaume GARDET
    Cc: Lukasz Majewski
    Cc: Jaehoon Chung
    Cc: Minkyu Kang
    Cc: Simon Glass
    Acked-by: Jaehoon Chung
    Tested-by: Lukasz Majewski
    Signed-off-by: Minkyu Kang

    Przemyslaw Marczak
     
  • This commit adds unit tests for ADC uclass's methods using sandbox ADC.

    Testing proper ADC binding:
    - dm_test_adc_bind() - device binding
    - dm_test_adc_wrong_channel_selection() - checking wrong channel selection

    Testing ADC supply operations:
    - dm_test_adc_supply():
    - Vdd/Vss values validating
    - Vdd regulator updated value validating
    - Vdd regulator's auto enable state validating

    Testing ADC operations results:
    - dm_test_adc_single_channel_conversion() - single channel start/data
    - dm_test_adc_single_channel_shot() - single channel shot
    - dm_test_adc_multi_channel_conversion() - multi channel start/data
    - dm_test_adc_multi_channel_shot() - multi channel single shot

    Signed-off-by: Przemyslaw Marczak
    Cc: Simon Glass
    Signed-off-by: Minkyu Kang

    Przemyslaw Marczak
     
  • This commit adds implementation of Sandbox ADC device emulation.
    The device provides:
    - single and multi-channel conversion
    - 4 channels with predefined conversion output data
    - 16-bit resolution

    Signed-off-by: Przemyslaw Marczak
    Cc: Simon Glass
    Signed-off-by: Minkyu Kang

    Przemyslaw Marczak
     
  • This commit adds additional file with implementation of board
    detection code for Odroid-XU3/XU4.

    The detection depends on compatible found in fdt:
    - "samsung,exynos5" - uses Exynos5 generic code
    - "samsung,odroidxu3" - try detect XU3 revision

    There are few revisions of Odroid XU3/XU4, each can be detected
    by checking the value of channel 9 of built-in ADC:
    Rev ADC Board
    0.1 0 XU3 0.1
    0.2 372 XU3 0.2 | XU3L - no DISPLAYPORT
    0.3 1280 XU4 0.1

    The detection code depends on the ADC+10% value.

    Implementation of functions:
    - set_board_type() - read ADC and set type
    - get_board_rev() - returns board revision: 1..3
    - get_board_type() - returns board type string

    Additional functions with return values of bool:
    - board_is_generic() - true if found compatible "samsung,exynos5"
    but not "samsung,odroidxu3"
    - board_is_odroidxu3() - true if found compatible "samsung,odroidxu3"
    and one of XU3 revision.
    - board_is_odroidxu4() - true if found compatible "samsung,odroidxu3"
    and XU4 revision.

    After I2C controller init, the get_board_type() can check
    if the XU3 board is a "Lite" variant, by probing chip
    0x40 on I2C0 (INA231 - exists only on non-lite).
    This is useful for setting fdt file name at misc_init_r().

    Enabled configs:
    - CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
    - CONFIG_ODROID_REV_AIN
    - CONFIG_REVISION_TAG
    - CONFIG_BOARD_TYPES

    Signed-off-by: Przemyslaw Marczak
    Cc: Minkyu Kang
    Cc: Simon Glass
    Tested-by: Anand Moon
    Signed-off-by: Minkyu Kang

    Przemyslaw Marczak
     
  • This ADC is required for Odroid's board revision detection.
    The pre-reloc request is enabled, since board detection will
    be done in one of early function call.

    Signed-off-by: Przemyslaw Marczak
    Cc: Minkyu Kang
    Cc: Simon Glass
    Signed-off-by: Minkyu Kang

    Przemyslaw Marczak
     
  • This commit adds common ADC node, which is disabled as default.

    Signed-off-by: Przemyslaw Marczak
    Cc: Minkyu Kang
    Cc: Simon Glass
    Reviewed-by: Simon Glass
    Signed-off-by: Minkyu Kang

    Przemyslaw Marczak
     
  • Signed-off-by: Przemyslaw Marczak
    Cc: Minkyu Kang
    Cc: Simon Glass
    Tested-by: Anand Moon
    Signed-off-by: Minkyu Kang

    Przemyslaw Marczak
     
  • This commit adds driver for Exynos54xx ADC subsystem.

    The driver is implemented using driver model, amd provides
    ADC uclass's methods for ADC single channel operations:
    - adc_start_channel()
    - adc_channel_data()
    - adc_stop()

    The basic parameters of ADC conversion, are:
    - sample rate: 600KSPS
    - output the data as average of 8 time conversion

    ADC features:
    - sample rate: 600KSPS
    - resolution: 12-bit
    - channels: 10 (analog multiplexer)

    Signed-off-by: Przemyslaw Marczak
    Cc: Minkyu Kang
    Cc: Simon Glass
    Signed-off-by: Minkyu Kang

    Przemyslaw Marczak
     
  • This commit adds:
    - new uclass id: UCLASS_ADC
    - new uclass driver: drivers/adc/adc-uclass.c

    The new uclass's API allows for ADC operation on:
    * single-channel with channel selection by a number
    * multti-channel with channel selection by bit mask

    ADC uclass's functions:
    * single-channel:
    - adc_start_channel() - start channel conversion
    - adc_channel_data() - get conversion data
    - adc_channel_single_shot() - start/get conversion data
    * multi-channel:
    - adc_start_channels() - start selected channels conversion
    - adc_channels_data() - get conversion data
    - adc_channels_single_shot() - start/get conversion data for channels
    selected by bit mask
    * general:
    - adc_stop() - stop the conversion
    - adc_vdd_value() - positive reference Voltage value with polarity [uV]
    - adc_vss_value() - negative reference Voltage value with polarity [uV]
    - adc_data_mask() - conversion data bit mask

    The device tree can provide below constraints/properties:
    - vdd-polarity-negative: if true: Vdd = vdd-microvolts * (-1)
    - vss-polarity-negative: if true: Vss = vss-microvolts * (-1)
    - vdd-supply: phandle to Vdd regulator's node
    - vss-supply: phandle to Vss regulator's node
    And optional, checked only if the above corresponding, doesn't exist:
    - vdd-microvolts: positive reference Voltage [uV]
    - vss-microvolts: negative reference Voltage [uV]

    Signed-off-by: Przemyslaw Marczak
    Cc: Simon Glass
    Signed-off-by: Minkyu Kang

    Przemyslaw Marczak
     
  • Some devices are supplied by configurable regulator's output.
    But there was no function for getting it. This commit adds
    function, that allows for getting the supply device by it's phandle.

    The returned regulator device can be used with regulator uclass's API.

    Signed-off-by: Przemyslaw Marczak
    Cc: Simon Glass
    Signed-off-by: Minkyu Kang

    Przemyslaw Marczak
     
  • This driver allows I/O operations on the Samsung S2MPS11 PMIC,
    which provides lots of LDO/BUCK outputs.

    To enable it, update defconfig with:
    - CONFIG_PMIC_S2MPS11
    and additional, if were not defined:
    - CONFIG_CMD_PMIC
    - CONFIG_ERRNO_STR

    The binding info: doc/device-tree-bindings/pmic/s2mps11.txt

    Signed-off-by: Przemyslaw Marczak
    Reviewed-by: Simon Glass
    Tested-by: Anand Moon
    Signed-off-by: Minkyu Kang

    Przemyslaw Marczak
     
  • The proper CPU ID for those Exynos variants is 0x5422,
    but before the 0x5800 was set. This commit fix this back.

    Changes:
    - set cpu id to 0x5422 instead of 0x5800
    - remove macro proid_is_exynos5800()
    - add macro proid_is_exynos5422()
    - change the calls to proid_is_exynos5800() with new macro

    Signed-off-by: Przemyslaw Marczak
    Cc: Minkyu Kang
    Cc: Simon Glass
    Tested-by: Anand Moon
    Signed-off-by: Minkyu Kang

    Przemyslaw Marczak
     
  • This platform is based on Exynos5800 but the cpu id is 0x5422.
    This doesn't fit the common Exynos SoC name convention, so now,
    the CPU name is defined by device tree string, to be printed
    properly.

    Signed-off-by: Przemyslaw Marczak
    Cc: Minkyu Kang
    Cc: Simon Glass
    Reviewed-by: Simon Glass
    Tested-by: Anand Moon
    Signed-off-by: Minkyu Kang

    Przemyslaw Marczak
     
  • The CPU name for Exynos was concatenated with cpu id,
    but for new Exynos platforms, like Chromebook Peach Pi
    based on Exynos5800, the name of SoC variant does not
    include the real SoC cpu id (0x5422).

    For such case, the CPU name should be defined in device tree.

    This commit introduces new device-tree property for Exynos:
    - "cpu-model" - with cpu name string
    If defined, then the cpu id is not printed.

    Signed-off-by: Przemyslaw Marczak
    Cc: Minkyu Kang
    Cc: Simon Glass
    Reviewed-by: Simon Glass
    Tested-by: Anand Moon
    Signed-off-by: Minkyu Kang

    Przemyslaw Marczak
     
  • The function get_board_type() is called in two places by common code,
    but the returned pointer was never check.

    This commit adds checking the returned pointer, before use it.

    Signed-off-by: Przemyslaw Marczak
    Cc: Minkyu Kang
    Reviewed-by: Simon Glass
    Tested-by: Anand Moon
    Signed-off-by: Minkyu Kang

    Przemyslaw Marczak
     

31 Oct, 2015

7 commits


30 Oct, 2015

11 commits