Merge git://git.denx.de/u-boot-x86

This commit is contained in:
Tom Rini 2018-03-30 18:17:23 -04:00
commit 80a66a55fa
5 changed files with 49 additions and 8 deletions

View file

@ -10,8 +10,11 @@
#include <asm/video/edid.h>
/* setup data types */
#define SETUP_NONE 0
#define SETUP_E820_EXT 1
enum {
SETUP_NONE = 0,
SETUP_E820_EXT,
SETUP_DTB,
};
/* extensible setup data list node */
struct setup_data {

View file

@ -14,6 +14,7 @@
*/
#include <common.h>
#include <malloc.h>
#include <asm/acpi_table.h>
#include <asm/io.h>
#include <asm/ptrace.h>
@ -25,6 +26,7 @@
#include <asm/arch/timestamp.h>
#endif
#include <linux/compiler.h>
#include <linux/libfdt.h>
DECLARE_GLOBAL_DATA_PTR;
@ -95,6 +97,38 @@ static int get_boot_protocol(struct setup_header *hdr)
}
}
static int setup_device_tree(struct setup_header *hdr, const void *fdt_blob)
{
int bootproto = get_boot_protocol(hdr);
struct setup_data *sd;
int size;
if (bootproto < 0x0209)
return -ENOTSUPP;
if (!fdt_blob)
return 0;
size = fdt_totalsize(fdt_blob);
if (size < 0)
return -EINVAL;
size += sizeof(struct setup_data);
sd = (struct setup_data *)malloc(size);
if (!sd) {
printf("Not enough memory for DTB setup data\n");
return -ENOMEM;
}
sd->next = hdr->setup_data;
sd->type = SETUP_DTB;
sd->len = fdt_totalsize(fdt_blob);
memcpy(sd->data, fdt_blob, sd->len);
hdr->setup_data = (unsigned long)sd;
return 0;
}
struct boot_params *load_zimage(char *image, unsigned long kernel_size,
ulong *load_addressp)
{
@ -261,6 +295,7 @@ int setup_zimage(struct boot_params *setup_base, char *cmd_line, int auto_boot,
hdr->acpi_rsdp_addr = acpi_get_rsdp_addr();
#endif
setup_device_tree(hdr, (const void *)env_get_hex("fdtaddr", 0));
setup_video(&setup_base->screen_info);
return 0;

View file

@ -29,11 +29,10 @@ static int pci_mmc_probe(struct udevice *dev)
struct pci_mmc_plat *plat = dev_get_platdata(dev);
struct pci_mmc_priv *priv = dev_get_priv(dev);
struct sdhci_host *host = &priv->host;
u32 ioaddr;
int ret;
dm_pci_read_config32(dev, PCI_BASE_ADDRESS_0, &ioaddr);
host->ioaddr = map_sysmem(ioaddr, 0);
host->ioaddr = (void *)dm_pci_map_bar(dev, PCI_BASE_ADDRESS_0,
PCI_REGION_MEM);
host->name = dev->name;
ret = sdhci_setup_cfg(&plat->cfg, host, 0, 0);
if (ret)

View file

@ -876,6 +876,9 @@ static int decode_regions(struct pci_controller *hose, ofnode parent_node,
#ifdef CONFIG_NR_DRAM_BANKS
bd_t *bd = gd->bd;
if (!bd)
return 0;
for (i = 0; i < CONFIG_NR_DRAM_BANKS; ++i) {
if (bd->bi_dram[i].size) {
pci_set_region(hose->regions + hose->region_count++,
@ -894,8 +897,9 @@ static int decode_regions(struct pci_controller *hose, ofnode parent_node,
#endif
if (gd->pci_ram_top && gd->pci_ram_top < base + size)
size = gd->pci_ram_top - base;
pci_set_region(hose->regions + hose->region_count++, base, base,
size, PCI_REGION_MEM | PCI_REGION_SYS_MEMORY);
if (size)
pci_set_region(hose->regions + hose->region_count++, base,
base, size, PCI_REGION_MEM | PCI_REGION_SYS_MEMORY);
#endif
return 0;

View file

@ -182,7 +182,7 @@ static int get_codeseg32(void)
<< 16;
base <<= 12; /* 4KB granularity */
limit <<= 12;
if ((desc & GDT_PRESENT) && (desc && GDT_NOTSYS) &&
if ((desc & GDT_PRESENT) && (desc & GDT_NOTSYS) &&
!(desc & GDT_LONG) && (desc & GDT_4KB) &&
(desc & GDT_32BIT) && (desc & GDT_CODE) &&
CONFIG_SYS_TEXT_BASE > base &&