- Update cmdline parameter to be an env var in zimage boot
- Various minor fixes for Intel Edison board
This commit is contained in:
Tom Rini 2020-12-16 08:13:37 -05:00
commit 25e6bd18c5
9 changed files with 77 additions and 53 deletions

View File

@ -10,9 +10,11 @@ config INTEL_TANGIER
imply MMC_SDHCI
imply MMC_SDHCI_SDMA
imply MMC_SDHCI_TANGIER
imply MISC
imply USB
imply USB_XHCI_HCD
imply USB_DWC3
imply BINMAN
imply USB_DWC3_GENERIC
if INTEL_TANGIER
@ -27,8 +29,4 @@ config SYS_CAR_SIZE
Space in bytes in eSRAM used as Cache-As-RAM (CAR).
Note this size must not exceed eSRAM's total size.
config SYS_USB_OTG_BASE
hex
default 0xf9100000
endif

View File

@ -196,6 +196,49 @@ unsigned int install_e820_map(unsigned int max_entries,
return sfi_setup_e820(max_entries, entries);
}
/*
* This function looks for the highest region of memory lower than 2GB which
* has enough space for U-Boot where U-Boot is aligned on a page boundary. It
* overrides the default implementation found elsewhere which simply picks the
* end of RAM, wherever that may be. The location of the stack, the relocation
* address, and how far U-Boot is moved by relocation are set in the global
* data structure.
*/
ulong board_get_usable_ram_top(ulong total_size)
{
struct sfi_table_simple *sb;
struct sfi_mem_entry *mentry;
ulong dest_addr = 0;
u32 i;
sb = sfi_search_mmap();
if (!sb)
panic("No available memory found for relocation");
sfi_for_each_mentry(i, sb, mentry) {
unsigned long long start, end;
if (mentry->type != SFI_MEM_CONV)
continue;
start = mentry->phys_start;
end = start + (mentry->pages << 12);
/* Filter memory over 2GB. */
if (end > 0x7fffffffULL)
end = 0x80000000ULL;
/* Skip this region if it's too small. */
if (end - start < total_size)
continue;
/* Use this address if it's the largest so far. */
if (end > dest_addr)
dest_addr = end;
}
return dest_addr;
}
int dram_init_banksize(void)
{
sfi_get_bank_size();

View File

@ -16,7 +16,7 @@
/ {
model = "Intel Edison";
compatible = "intel,edison";
compatible = "intel,edison", "intel,tangier";
aliases {
serial0 = &serial0;
@ -105,6 +105,18 @@
reg = <0xff009000 0x1000>;
};
usb: usb@f9100000 {
compatible = "intel,tangier-dwc3";
#address-cells = <1>;
#size-cells = <1>;
dwc3: dwc3 {
reg = <0xf9100000 0x100000>;
maximum-speed = "high-speed";
dr_mode = "peripheral";
};
};
watchdog: wdt@0 {
compatible = "intel,tangier-wdt";
};

View File

@ -60,8 +60,8 @@
* BZIMAGE_LOAD_ADDR or ZIMAGE_LOAD_ADDR
* @base_ptr: Pointer to the boot parameters, typically at address
* DEFAULT_SETUP_BASE
* @cmdline: Address of 'override' command line, or 0 to use the one in the
* setup block
* @cmdline: Environment variable containing the 'override' command line, or
* NULL to use the one in the setup block
*/
struct zboot_state {
ulong bzimage_addr;
@ -70,7 +70,7 @@ struct zboot_state {
ulong initrd_size;
ulong load_address;
struct boot_params *base_ptr;
ulong cmdline;
char *cmdline;
} state;
enum {
@ -406,7 +406,7 @@ static int do_zboot_start(struct cmd_tbl *cmdtp, int flag, int argc,
state.bzimage_addr = 0;
}
if (argc >= 7)
state.cmdline = simple_strtoul(argv[6], NULL, 16);
state.cmdline = env_get(argv[6]);
return 0;
}
@ -452,7 +452,7 @@ static int do_zboot_setup(struct cmd_tbl *cmdtp, int flag, int argc,
}
ret = setup_zimage(base_ptr, (char *)base_ptr + COMMAND_LINE_OFFSET,
0, state.initrd_addr, state.initrd_size,
state.cmdline);
(ulong)state.cmdline);
if (ret) {
puts("Setting up boot parameters failed ...\n");
return CMD_RET_FAILURE;
@ -743,8 +743,9 @@ U_BOOT_CMDREP_COMPLETE(
" initrd size - The size of the initrd image to use, if any.\n"
" setup - The address of the kernel setup region, if this\n"
" is not at addr\n"
" cmdline - The address of the kernel command line, to\n"
" override U-Boot's normal cmdline generation\n"
" cmdline - Environment variable containing the kernel\n"
" command line, to override U-Boot's normal\n"
" cmdline generation\n"
"\n"
"Sub-commands to do part of the zboot sequence:\n"
"\tstart [addr [arg ...]] - specify arguments\n"

View File

@ -31,5 +31,6 @@ config BOARD_SPECIFIC_OPTIONS # dummy
select INTEL_TANGIER
select BOARD_LATE_INIT
select MD5
imply BINMAN
endif

View File

@ -3,15 +3,10 @@
* Copyright (c) 2017 Intel Corporation
*/
#include <common.h>
#include <dwc3-uboot.h>
#include <env.h>
#include <init.h>
#include <mmc.h>
#include <u-boot/md5.h>
#include <usb.h>
#include <watchdog.h>
#include <linux/usb/gadget.h>
#include <asm/cache.h>
#include <asm/pmu.h>
@ -27,36 +22,6 @@ int board_early_init_r(void)
return 0;
}
static struct dwc3_device dwc3_device_data = {
.maximum_speed = USB_SPEED_HIGH,
.base = CONFIG_SYS_USB_OTG_BASE,
.dr_mode = USB_DR_MODE_PERIPHERAL,
.index = 0,
};
int usb_gadget_handle_interrupts(int controller_index)
{
dwc3_uboot_handle_interrupt(controller_index);
WATCHDOG_RESET();
return 0;
}
int board_usb_init(int index, enum usb_init_type init)
{
if (index == 0 && init == USB_INIT_DEVICE)
return dwc3_uboot_init(&dwc3_device_data);
return -EINVAL;
}
int board_usb_cleanup(int index, enum usb_init_type init)
{
if (index == 0 && init == USB_INIT_DEVICE) {
dwc3_uboot_exit(index);
return 0;
}
return -EINVAL;
}
static void assign_serial(void)
{
struct mmc *mmc = find_mmc_device(0);

View File

@ -37,7 +37,7 @@ CONFIG_DFU_TIMEOUT=y
CONFIG_DFU_MMC=y
CONFIG_DFU_RAM=y
CONFIG_SUPPORT_EMMC_BOOT=y
CONFIG_DM_PCI_COMPAT=y
CONFIG_DM_USB_GADGET=y
CONFIG_USB_GADGET=y
CONFIG_USB_GADGET_MANUFACTURER="Intel"
CONFIG_USB_GADGET_VENDOR_NUM=0x8087

View File

@ -449,6 +449,7 @@ static const struct udevice_id dwc3_glue_ids[] = {
{ .compatible = "rockchip,rk3328-dwc3" },
{ .compatible = "rockchip,rk3399-dwc3" },
{ .compatible = "qcom,dwc3" },
{ .compatible = "intel,tangier-dwc3" },
{ }
};

View File

@ -15,10 +15,13 @@
"read mmc 2:2 100000 0 80; setexpr loader *001004f0; " \
"setexpr size *00100518; setexpr blocks $size / 200; " \
"read mmc 2:2 100000 80 $blocks; setexpr setup $loader - 1000; " \
"setexpr cmdline $loader - 2000; " \
"part uuid mmc 2:2 uuid; setenv bootargs_U $uuid; " \
"zboot start 100000 0 0 0 $setup $cmdline; " \
"zboot load; zboot setup; zboot dump; zboot go"
"setexpr cmdline_ptr $loader - 2000; " \
"setexpr.s cmdline *$cmdline_ptr; " \
"setexpr cmdline gsub %U \\\\${uuid}; " \
"if part uuid mmc 2:2 uuid; then " \
"zboot start 100000 0 0 0 $setup cmdline; " \
"zboot load; zboot setup; zboot dump; zboot go;" \
"fi"
#include <configs/x86-common.h>
#include <configs/x86-chromebook.h>