Skip to content

Commit

Permalink
Merge git://git.denx.de/u-boot-x86
Browse files Browse the repository at this point in the history
  • Loading branch information
trini committed Mar 30, 2018
2 parents 0ca0a54 + 5d73292 commit 80a66a5
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 8 deletions.
7 changes: 5 additions & 2 deletions arch/x86/include/asm/bootparam.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
35 changes: 35 additions & 0 deletions arch/x86/lib/zimage.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
*/

#include <common.h>
#include <malloc.h>
#include <asm/acpi_table.h>
#include <asm/io.h>
#include <asm/ptrace.h>
Expand All @@ -25,6 +26,7 @@
#include <asm/arch/timestamp.h>
#endif
#include <linux/compiler.h>
#include <linux/libfdt.h>

DECLARE_GLOBAL_DATA_PTR;

Expand Down Expand Up @@ -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)
{
Expand Down Expand Up @@ -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;
Expand Down
5 changes: 2 additions & 3 deletions drivers/mmc/pci_mmc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
8 changes: 6 additions & 2 deletions drivers/pci/pci-uclass.c
Original file line number Diff line number Diff line change
Expand Up @@ -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++,
Expand All @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion lib/efi/efi_stub.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 &&
Expand Down

0 comments on commit 80a66a5

Please sign in to comment.