08 Jun, 2017

14 commits

  • To prepare for adding the RK3399 VOP driver (which shares most of its
    registers and config logic with the RK3228 VOP), this change refactors
    the driver and splits the RK3288-specific driver off.

    The changes in detail are:
    - introduces a data-structure for chip-specific drivers to register
    features/callbacks with the common driver: at this time, this is
    limited to a callback for setting the pin polarities (between the
    VOP and the encoder modules) and a flag to signal 10bit RGB
    capability
    - refactors the probing of regulators into a helper function that
    can take a list of regulator names to probe and autoset
    - moves the priv data-structure into a (common) header file to be
    used by the chip-specific drivers to provide base addresses to
    the common driver
    - uses a callback into the chip-specific driver to set pin polarities
    (replacing the direct register accesses previously used)
    - splits enabling the output (towards an encoder) into a separate
    help function withint the common driver

    Signed-off-by: Philipp Tomsich
    Reviewed-by: Simon Glass

    Philipp Tomsich
     
  • This introduces two new Kconfig options that configure the maximum
    allowable framebuffer size (i.e. the memory reservation/allocation for
    the framebuffer):
    - VIDEO_ROCKCHIP_MAX_XRES
    - VIDEO_ROCKCHIP_MAX_YRES
    The resulting memory allocation will cover 4 byte per pixel for these
    resolutions.

    Signed-off-by: Philipp Tomsich
    Reviewed-by: Simon Glass

    Philipp Tomsich
     
  • For consistency sake (and as we are about to add new options to this
    file), reformat the help for VIDEO_ROCKCHIP.

    Signed-off-by: Philipp Tomsich
    Reviewed-by: Simon Glass

    Philipp Tomsich
     
  • For the RK3399-Q7, we need spl_board_init to be called during SPL
    startup to set up the pinmux for the debug UART. Enable SPL_BOARD_INIT
    via defconfig to ensure this function is in fact called.

    Signed-off-by: Philipp Tomsich

    Philipp Tomsich
     
  • RK3288_TXCLK_DLY_ENA_GMAC_ENABLE, in GRF_SOC_CON3, is supposed to be bit
    0xe and not 0xf. Otherwise, it is RGMII RX clock delayline enable and
    introduces random delays and data lose.

    This commit fixes the issue by replacing RK3288_TXCLK_DLY_ENA_GMAC_ENABLE
    with the right shift.

    Signed-off-by: Romain Perier
    Reviewed-by: Simon Glass

    Romain Perier
     
  • This adds the DDR3-1866 timing via its own DTS and wires it up. This
    (currently) is not the default timing for the RK3399-Q7 and should be
    selected explicitly via the config (CONFIG_DEFAULT_DEVICE_TREE).

    Signed-off-by: Philipp Tomsich
    Acked-by: Simon Glass

    Philipp Tomsich
     
  • This adds the DDR3-1333 timing via its own DTS and wires it up. This
    is not the default timing for the RK3399-Q7 and should be selected
    explicitly via the config (CONFIG_DEFAULT_DEVICE_TREE).

    Signed-off-by: Philipp Tomsich
    Acked-by: Simon Glass

    Philipp Tomsich
     
  • To better support different RAM timings (DDR3-1333 and DDR3-1866 are
    assembly options for the RK3399-Q7), this refactors the DTS support
    and renames the default DTS variant from rk3399-puma to
    rk3399-puma-ddr1600:
    - changes the rk3399-puma DTS into a board-specific DTSI by removing
    the inclusion of the DRAM timings
    - adds a new rk3399-puma-ddr1600.dts, which includes the (new) common
    board DTSI and the DDR3-1600 timing DTSI
    - wires this up from arch/arm/dts/Makefile and configs/puma-rk3399_defconfig

    Signed-off-by: Philipp Tomsich
    Acked-by: Simon Glass

    Philipp Tomsich
     
  • The Linux DTS for the RK3399-Q7 has moved with the times... resync
    against it to ensure a consistent configuration.

    Signed-off-by: Philipp Tomsich
    Reviewed-by: Simon Glass

    Philipp Tomsich
     
  • This commit enables HDMI output in the DTS by adding the necessary
    nodes to vopl/vopb and by adding the HDMI node.

    Signed-off-by: Philipp Tomsich
    Reviewed-by: Simon Glass

    Philipp Tomsich
     
  • The regs_otg field in uintptr_t of the platform data structure for
    dwc2-otg has thus far been an unsigned int, but will eventually be
    casted into a void*.

    This raises the following error with GCC 6.3 and buildman:
    ../drivers/usb/gadget/dwc2_udc_otg.c: In function 'dwc2_udc_probe':
    ../drivers/usb/gadget/dwc2_udc_otg.c:821:8: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    reg = (struct dwc2_usbotg_reg *)pdata->regs_otg;
    ^

    This changes regs_otg to a uintptr_t to ensure that it is large enough
    to hold any valid pointer (and fix the associated warning).

    Signed-off-by: Philipp Tomsich

    Philipp Tomsich
     
  • With HDMI output for the RK3399 working, this update the RK3399-Q7
    (Puma) defconfig for the new functionality:
    1. enables PMIC command (to check if the HDMI voltages are correct)
    +CONFIG_CMD_PMIC=y
    +CONFIG_CMD_REGULATOR=y
    2. enables video-output (via HDMI)
    +CONFIG_DM_VIDEO=y
    +CONFIG_DISPLAY=y
    +CONFIG_VIDEO_ROCKCHIP=y
    +CONFIG_DISPLAY_ROCKCHIP_HDMI=y
    3. turns on the 'dcache'-command (for a dcache flush) for our QA to
    fill the framebuffer using 'mw.l'
    +CONFIG_CMD_CACHE=y
    4. turns on the 'bmp'-command
    +CONFIG_CMD_BMP=y

    Signed-off-by: Philipp Tomsich
    Reviewed-by: Simon Glass
    Acked-by: Simon Glass

    Philipp Tomsich
     
  • When enabling CONFIG_DISPLAY_ROCKCHIP_HDMI, compile-time warning for
    the following implicitly defined functions are raised due to a missing
    include directive:

    drivers/video/rockchip/rk_hdmi.c: In function 'rk_hdmi_probe':
    drivers/video/rockchip/rk_hdmi.c:150:2: warning: implicit declaration of function 'rk_setreg' [-Wimplicit-function-declaration]
    rk_setreg(&priv->grf->soc_con6, 1 << 15);
    ^~~~~~~~~
    drivers/video/rockchip/rk_hdmi.c:153:2: warning: implicit declaration of function 'rk_clrsetreg' [-Wimplicit-function-declaration]
    rk_clrsetreg(&priv->grf->soc_con6, 1 << 4,
    ^~~~~~~~~~~~

    This change fixes this by including in rk_hdmi.c.

    Signed-off-by: Philipp Tomsich
    Acked-by: Simon Glass

    Philipp Tomsich
     
  • The usb_gadget_handle_interrupts()-function is already implemented by
    drivers/usb/gadget/dwc2_udc_otg.c, so we need to avoid defining it
    in the evb-rk3328.c board-specific file.

    This change fixes the following build error (from buildman):
    drivers/usb/gadget/built-in.o: In function `usb_gadget_handle_interrupts':
    build/../drivers/usb/gadget/dwc2_udc_otg.c:850: multiple definition of `usb_gadget_handle_interrupts'
    board/rockchip/evb_rk3328/built-in.o:build/../board/rockchip/evb_rk3328/evb-rk3328.c:37: first defined here
    make[1]: *** [u-boot] Error 1

    Signed-off-by: Philipp Tomsich
    Acked-by: Simon Glass

    Philipp Tomsich
     

07 Jun, 2017

26 commits