aboutsummaryrefslogtreecommitdiffstats
path: root/package
diff options
context:
space:
mode:
authorRoger Pueyo Centelles <roger.pueyo@guifi.net>2019-10-24 15:29:14 +0200
committerAdrian Schmutzler <freifunk@adrianschmutzler.de>2019-11-03 00:29:40 +0100
commit20ace70db65c3f1cb6a842d3092ac2eb7be81b5a (patch)
tree0b21e510c6b489dd5e64c28ad8259ecb89e9b29c /package
parent194612997bd3f6430f76722a75f754b751561bc2 (diff)
downloadupstream-20ace70db65c3f1cb6a842d3092ac2eb7be81b5a.tar.gz
upstream-20ace70db65c3f1cb6a842d3092ac2eb7be81b5a.tar.bz2
upstream-20ace70db65c3f1cb6a842d3092ac2eb7be81b5a.zip
ath79: remove wmac mtd-mac-address for UniFi AC family
The MAC address for the wmac 2.4 GHz radio of the Ubiquiti UniFi AC family of devices is actually embedded in the mtd-cal-data, so there is no need for mtd-mac-address (which was incorrectly forcing wmac to have the same MAC as eth0). This makes it coherent with the stock firmware and the ar71xx target: · XX:XX:XX:X0:XX:XX eth0 · XX:XX:XX:X1:XX:XX ath0/wlan1 (2.4 GHz) · XX:XX:XX:X2:XX:XX ath1/wlan0 (5 GHz) Checked on a UniFi AC Mesh, a UniFi AC LR and a UniFi Lite. Signed-off-by: Roger Pueyo Centelles <roger.pueyo@guifi.net>
Diffstat (limited to 'package')
0 files changed, 0 insertions, 0 deletions
6' href='#n126'>126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187
/*
 * HVM ROMBIOS support.
 *
 * Leendert van Doorn, leendert@watson.ibm.com
 * Copyright (c) 2005, International Business Machines Corporation.
 * Copyright (c) 2006, Keir Fraser, XenSource Inc.
 * Copyright (c) 2011, Citrix Inc.
 *
 * This program is free software; you can redistribute it and/or modify it
 * under the terms and conditions of the GNU General Public License,
 * version 2, as published by the Free Software Foundation.
 *
 * This program is distributed in the hope it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
 * more details.
 *
 * You should have received a copy of the GNU General Public License along with
 * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
 * Place - Suite 330, Boston, MA 02111-1307 USA.
 */

#include "config.h"

#include "../rombios/config.h"

#include "smbios_types.h"
#include "acpi/acpi2_0.h"
#include "pci_regs.h"
#include "util.h"
#include "hypercall.h"

#include <xen/hvm/params.h>

#define ROM_INCLUDE_ROMBIOS
#include "roms.inc"

#define ROMBIOS_BEGIN          0x000F0000
#define ROMBIOS_SIZE           0x00010000
#define ROMBIOS_MAXOFFSET      0x0000FFFF
#define ROMBIOS_END            (ROMBIOS_BEGIN + ROMBIOS_SIZE)

extern unsigned char dsdt_anycpu[], dsdt_15cpu[];
extern int dsdt_anycpu_len, dsdt_15cpu_len;

static void rombios_setup_e820(void)
{
    /*
     * 0x9E000-0x09F000: Stack.
     * 0x9FC00-0x0A0000: Extended BIOS Data Area (EBDA).
     * ...
     * 0xE0000-0x0F0000: PC-specific area. We place various tables here.
     * 0xF0000-0x100000: System BIOS.
     */
    *E820_NR = build_e820_table(E820, 0x9E000, 0xE0000);
    dump_e820_table(E820, *E820_NR);
}

static void rombios_setup_bios_info(void)
{
    struct rombios_info *info;

    info = (struct rombios_info *)BIOS_INFO_PHYSICAL_ADDRESS;
    memset(info, 0, sizeof(*info));
}

static void rombios_load(const struct bios_config *config)
{
    uint32_t bioshigh;
    struct rombios_info *info;

    memcpy((void *)config->bios_address, config->image,
           config->image_size);

    bioshigh = rombios_highbios_setup();

    info = (struct rombios_info *)BIOS_INFO_PHYSICAL_ADDRESS;
    info->bios32_entry = bioshigh;
}

/*
 * find_mp_table_start - searchs through BIOS memory for '___HVMMP' signature
 *
 * The '___HVMMP' signature is created by the ROMBIOS and designates a chunk
 * of space inside the ROMBIOS that is safe for us to write our MP table info
 */
static void *get_mp_table_start(void)
{
    char *bios_mem;

    for ( bios_mem = (char *)ROMBIOS_BEGIN;
          bios_mem != (char *)ROMBIOS_END;
          bios_mem++ )
    {
        if ( strncmp(bios_mem, "___HVMMP", 8) == 0 )
            return bios_mem;
    }

    return NULL;
}

/* recalculate the new ROMBIOS checksum after adding MP tables */
static void reset_bios_checksum(void)
{
    uint32_t i;
    uint8_t checksum;

    checksum = 0;
    for ( i = 0; i < ROMBIOS_MAXOFFSET; i++ )
        checksum += ((uint8_t *)(ROMBIOS_BEGIN))[i];

    *((uint8_t *)(ROMBIOS_BEGIN + ROMBIOS_MAXOFFSET)) = -checksum;
}

static void rombios_acpi_build_tables(void)
{
    struct acpi_config config = {
        .dsdt_anycpu = dsdt_anycpu,
        .dsdt_anycpu_len = dsdt_anycpu_len,
        .dsdt_15cpu = dsdt_15cpu,
        .dsdt_15cpu_len = dsdt_15cpu_len,
    };

    acpi_build_tables(&config, ACPI_PHYSICAL_ADDRESS);
}

static void rombios_create_mp_tables(void)
{
    /* Find the 'safe' place in ROMBIOS for the MP tables. */
    void *table = get_mp_table_start();

    if ( table == NULL )
    {
        printf("Couldn't find start point for MP tables\n");
        return;
    }

    create_mp_tables(table);

    reset_bios_checksum();
}

static void rombios_create_smbios_tables(void)
{
    hvm_write_smbios_tables(
        SMBIOS_PHYSICAL_ADDRESS,
        SMBIOS_PHYSICAL_ADDRESS + sizeof(struct smbios_entry_point),
        SMBIOS_PHYSICAL_END);
}

//BUILD_BUG_ON(sizeof(rombios) > (0x00100000U - ROMBIOS_PHYSICAL_ADDRESS));

struct bios_config rombios_config =  {
    .name = "ROMBIOS",

    .image = rombios,
    .image_size = sizeof(rombios),

    .bios_address = ROMBIOS_PHYSICAL_ADDRESS,

    .load_roms = 1,

    .optionrom_start = OPTIONROM_PHYSICAL_ADDRESS,
    .optionrom_end = OPTIONROM_PHYSICAL_END,

    .bios_load = rombios_load,

    .bios_info_setup = rombios_setup_bios_info,
    .bios_info_finish = NULL,

    .e820_setup = rombios_setup_e820,

    .acpi_build_tables = rombios_acpi_build_tables,
    .create_mp_tables = rombios_create_mp_tables,
    .create_smbios_tables = rombios_create_smbios_tables,
    .create_pir_tables = NULL, /* embedded in ROMBIOS */
};

/*
 * Local variables:
 * mode: C
 * c-set-style: "BSD"
 * c-basic-offset: 4
 * tab-width: 4
 * indent-tabs-mode: nil
 * End:
 */