[U-Boot] [PATCH V3 2/2] ARM: tegra: Add p2371-0000 board

Simon Glass sjg at chromium.org
Wed Aug 5 16:39:18 CEST 2015


Hi Stephen,

On 31 July 2015 at 17:21, Stephen Warren <swarren at wwwdotorg.org> wrote:
> From: Stephen Warren <swarren at nvidia.com>
>
> P2371-0000 is a P2581 or P2530 CPU board married to a P2595 I/O
> board. The combination contains SoC, DRAM, eMMC, SD card slot,
> HDMI, USB micro-B port, Ethernet via USB3, USB3 host port, SATA,
> a GPIO expansion header, and an analog audio jack.
>
> Signed-off-by: Stephen Warren <swarren at nvidia.com>
> v3:
> * More descriptions.
> * Add auto-generation notice to pinmux header.
> * Incorporate equivalent cleanups to those made to p2571.
> v2: Use named constants for PMIC I2C and register addresses.
> ---
>  arch/arm/dts/Makefile                              |   1 +
>  arch/arm/dts/tegra210-p2371-0000.dts               |  59 +++++
>  arch/arm/mach-tegra/tegra210/Kconfig               |   9 +
>  board/nvidia/p2371-0000/Kconfig                    |  12 +
>  board/nvidia/p2371-0000/MAINTAINERS                |   6 +
>  board/nvidia/p2371-0000/Makefile                   |   8 +
>  board/nvidia/p2371-0000/p2371-0000.c               |  51 ++++
>  board/nvidia/p2371-0000/pinmux-config-p2371-0000.h | 268 +++++++++++++++++++++
>  configs/p2371-0000_defconfig                       |  17 ++
>  include/configs/p2371-0000.h                       |  69 ++++++
>  10 files changed, 500 insertions(+)
>  create mode 100644 arch/arm/dts/tegra210-p2371-0000.dts
>  create mode 100644 board/nvidia/p2371-0000/Kconfig
>  create mode 100644 board/nvidia/p2371-0000/MAINTAINERS
>  create mode 100644 board/nvidia/p2371-0000/Makefile
>  create mode 100644 board/nvidia/p2371-0000/p2371-0000.c
>  create mode 100644 board/nvidia/p2371-0000/pinmux-config-p2371-0000.h
>  create mode 100644 configs/p2371-0000_defconfig
>  create mode 100644 include/configs/p2371-0000.h
>

[snip]


> diff --git a/board/nvidia/p2371-0000/p2371-0000.c b/board/nvidia/p2371-0000/p2371-0000.c
> new file mode 100644
> index 000000000000..9df543a4c9e8
> --- /dev/null
> +++ b/board/nvidia/p2371-0000/p2371-0000.c
> @@ -0,0 +1,51 @@
> +/*
> + * (C) Copyright 2013-2015
> + * NVIDIA Corporation <www.nvidia.com>
> + *
> + * SPDX-License-Identifier:     GPL-2.0+
> + */
> +
> +#include <common.h>
> +#include <i2c.h>
> +#include <asm/arch/gpio.h>
> +#include <asm/arch/pinmux.h>
> +#include "../p2571/max77620_init.h"

This is a consequence of not having a proper driver.

> +#include "pinmux-config-p2371-0000.h"
> +
> +void pin_mux_mmc(void)
> +{
> +       struct udevice *dev;
> +       uchar val;
> +       int ret;
> +
> +       /* Turn on MAX77620 LDO2 to 3.3V for SD card power */
> +       debug("%s: Set LDO2 for VDDIO_SDMMC_AP power to 3.3V\n", __func__);
> +       ret = i2c_get_chip_for_busnum(0, MAX77620_I2C_ADDR_7BIT, 1, &dev);
> +       if (ret) {
> +               printf("%s: Cannot find MAX77620 I2C chip\n", __func__);
> +               return;
> +       }
> +       /* 0xF2 for 3.3v, enabled: bit7:6 = 11 = enable, bit5:0 = voltage */
> +       val = 0xF2;
> +       ret = dm_i2c_write(dev, MAX77620_CNFG1_L2_REG, &val, 1);
> +       if (ret)
> +               printf("i2c_write 0 0x3c 0x27 failed: %d\n", ret);
> +}
> +
> +/*
> + * Routine: pinmux_init
> + * Description: Do individual peripheral pinmux configs
> + */
> +void pinmux_init(void)
> +{
> +       pinmux_clear_tristate_input_clamping();
> +
> +       gpio_config_table(p2371_0000_gpio_inits,
> +                         ARRAY_SIZE(p2371_0000_gpio_inits));
> +
> +       pinmux_config_pingrp_table(p2371_0000_pingrps,
> +                                  ARRAY_SIZE(p2371_0000_pingrps));
> +
> +       pinmux_config_drvgrp_table(p2371_0000_drvgrps,
> +                                  ARRAY_SIZE(p2371_0000_drvgrps));
> +}

[snip]

> diff --git a/include/configs/p2371-0000.h b/include/configs/p2371-0000.h
> new file mode 100644
> index 000000000000..016aa16d1422
> --- /dev/null
> +++ b/include/configs/p2371-0000.h
> @@ -0,0 +1,69 @@
> +/*
> + * (C) Copyright 2013-2015
> + * NVIDIA Corporation <www.nvidia.com>
> + *
> + * SPDX-License-Identifier:     GPL-2.0+
> + */
> +
> +#ifndef _P2371_0000_H
> +#define _P2371_0000_H
> +
> +#include <linux/sizes.h>
> +
> +/* enable PMIC */
> +#define CONFIG_MAX77620_POWER

That should go in Kconfig.

> +
> +#include "tegra210-common.h"
> +
> +/* High-level configuration options */
> +#define V_PROMPT                       "Tegra210 (P2371-0000) # "
> +#define CONFIG_TEGRA_BOARD_STRING      "NVIDIA P2371-0000"
> +
> +/* Board-specific serial config */
> +#define CONFIG_SERIAL_MULTI

Is that used?

> +#define CONFIG_TEGRA_ENABLE_UARTA
> +
> +/* I2C */
> +#define CONFIG_SYS_I2C_TEGRA
> +#define CONFIG_CMD_I2C
> +
> +/* SD/MMC */
> +#define CONFIG_MMC
> +#define CONFIG_GENERIC_MMC
> +#define CONFIG_TEGRA_MMC
> +#define CONFIG_CMD_MMC
> +
> +/* Environment in eMMC, at the end of 2nd "boot sector" */
> +#define CONFIG_ENV_IS_IN_MMC
> +#define CONFIG_SYS_MMC_ENV_DEV         0
> +#define CONFIG_SYS_MMC_ENV_PART                2
> +#define CONFIG_ENV_OFFSET              (-CONFIG_ENV_SIZE)
> +
> +/* SPI */
> +#define CONFIG_SPI_FLASH_WINBOND
> +#define CONFIG_SF_DEFAULT_MODE         SPI_MODE_0
> +#define CONFIG_SF_DEFAULT_SPEED                24000000
> +#define CONFIG_CMD_SPI
> +#define CONFIG_CMD_SF
> +#define CONFIG_SPI_FLASH_SIZE          (4 << 20)
> +
> +/* USB2.0 Host support */
> +#define CONFIG_USB_EHCI
> +#define CONFIG_USB_EHCI_TEGRA
> +#define CONFIG_USB_MAX_CONTROLLER_COUNT        1
> +#define CONFIG_USB_STORAGE
> +#define CONFIG_CMD_USB
> +
> +/* USB networking support */
> +#define CONFIG_USB_HOST_ETHER
> +#define CONFIG_USB_ETHER_ASIX
> +
> +/* General networking support */
> +#define CONFIG_CMD_DHCP
> +
> +#include "tegra-common-usb-gadget.h"
> +#include "tegra-common-post.h"
> +
> +#define COUNTER_FREQUENCY      38400000
> +
> +#endif /* _P2371_0000_H */
> --
> 1.9.1
>

Regards,
Simon


More information about the U-Boot mailing list