Skip to content
Snippets Groups Projects
Select Git revision
  • 76d1d02fd280ef7ad63a97c3a80bd765bf5596fa
  • master default protected
  • early-display
  • variant-emmc-nvme-boot
  • 2023-01-25
  • v3
  • variant-emmc-nvme-boot
  • 2020-06-01
8 results

quark.c

Blame
  • Forked from Reform / reform-boundary-uboot
    Source project has a limited visibility.
    • Simon Glass's avatar
      76d1d02f
      board_f: x86: Use checkcpu() for CPU init · 76d1d02f
      Simon Glass authored
      
      At present we misuse print_cpuinfo() do so CPU init on x86. This is done
      because it is the next available call after the console is enabled. But
      several arches use checkcpu() instead. Despite the horrible name (which
      we can fix), it seems a better choice.
      
      Adjust the various x86 CPU implementations to move their init code into
      checkcpu() and use print_cpuinfo() only for printing CPU info.
      
      Signed-off-by: default avatarSimon Glass <sjg@chromium.org>
      Reviewed-by: default avatarStefan Roese <sr@denx.de>
      76d1d02f
      History
      board_f: x86: Use checkcpu() for CPU init
      Simon Glass authored
      
      At present we misuse print_cpuinfo() do so CPU init on x86. This is done
      because it is the next available call after the console is enabled. But
      several arches use checkcpu() instead. Despite the horrible name (which
      we can fix), it seems a better choice.
      
      Adjust the various x86 CPU implementations to move their init code into
      checkcpu() and use print_cpuinfo() only for printing CPU info.
      
      Signed-off-by: default avatarSimon Glass <sjg@chromium.org>
      Reviewed-by: default avatarStefan Roese <sr@denx.de>
    quark.c 10.14 KiB
    /*
     * Copyright (C) 2015, Bin Meng <bmeng.cn@gmail.com>
     *
     * SPDX-License-Identifier:	GPL-2.0+
     */
    
    #include <common.h>
    #include <mmc.h>
    #include <asm/io.h>
    #include <asm/ioapic.h>
    #include <asm/mrccache.h>
    #include <asm/mtrr.h>
    #include <asm/pci.h>
    #include <asm/post.h>
    #include <asm/arch/device.h>
    #include <asm/arch/msg_port.h>
    #include <asm/arch/quark.h>
    
    static struct pci_device_id mmc_supported[] = {
    	{ PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_QRK_SDIO },
    	{},
    };
    
    static void quark_setup_mtrr(void)
    {
    	u32 base, mask;
    	int i;
    
    	disable_caches();
    
    	/* mark the VGA RAM area as uncacheable */
    	msg_port_write(MSG_PORT_HOST_BRIDGE, MTRR_FIX_16K_A0000,
    		       MTRR_FIX_TYPE(MTRR_TYPE_UNCACHEABLE));
    	msg_port_write(MSG_PORT_HOST_BRIDGE, MTRR_FIX_16K_B0000,
    		       MTRR_FIX_TYPE(MTRR_TYPE_UNCACHEABLE));
    
    	/* mark other fixed range areas as cacheable */
    	msg_port_write(MSG_PORT_HOST_BRIDGE, MTRR_FIX_64K_00000,
    		       MTRR_FIX_TYPE(MTRR_TYPE_WRBACK));
    	msg_port_write(MSG_PORT_HOST_BRIDGE, MTRR_FIX_64K_40000,
    		       MTRR_FIX_TYPE(MTRR_TYPE_WRBACK));
    	msg_port_write(MSG_PORT_HOST_BRIDGE, MTRR_FIX_16K_80000,
    		       MTRR_FIX_TYPE(MTRR_TYPE_WRBACK));
    	msg_port_write(MSG_PORT_HOST_BRIDGE, MTRR_FIX_16K_90000,
    		       MTRR_FIX_TYPE(MTRR_TYPE_WRBACK));
    	for (i = MTRR_FIX_4K_C0000; i <= MTRR_FIX_4K_FC000; i++)
    		msg_port_write(MSG_PORT_HOST_BRIDGE, i,
    			       MTRR_FIX_TYPE(MTRR_TYPE_WRBACK));
    
    	/* variable range MTRR#0: ROM area */
    	mask = ~(CONFIG_SYS_MONITOR_LEN - 1);
    	base = CONFIG_SYS_TEXT_BASE & mask;
    	msg_port_write(MSG_PORT_HOST_BRIDGE, MTRR_VAR_PHYBASE(MTRR_VAR_ROM),
    		       base | MTRR_TYPE_WRBACK);
    	msg_port_write(MSG_PORT_HOST_BRIDGE, MTRR_VAR_PHYMASK(MTRR_VAR_ROM),
    		       mask | MTRR_PHYS_MASK_VALID);
    
    	/* variable range MTRR#1: eSRAM area */
    	mask = ~(ESRAM_SIZE - 1);
    	base = CONFIG_ESRAM_BASE & mask;
    	msg_port_write(MSG_PORT_HOST_BRIDGE, MTRR_VAR_PHYBASE(MTRR_VAR_ESRAM),
    		       base | MTRR_TYPE_WRBACK);
    	msg_port_write(MSG_PORT_HOST_BRIDGE, MTRR_VAR_PHYMASK(MTRR_VAR_ESRAM),
    		       mask | MTRR_PHYS_MASK_VALID);
    
    	/* enable both variable and fixed range MTRRs */
    	msg_port_write(MSG_PORT_HOST_BRIDGE, MTRR_DEF_TYPE,
    		       MTRR_DEF_TYPE_EN | MTRR_DEF_TYPE_FIX_EN);
    
    	enable_caches();