aboutsummaryrefslogtreecommitdiffstats
path: root/package/boot/uboot-tegra
Commit message (Collapse)AuthorAgeFilesLines
* treewide: replace AUTORELEASE with real PKG_RELEASETianling Shen2023-05-181-1/+1
| | | | | | | | | | | | | | | | | | Based on Paul Fertser <fercerpav@gmail.com>'s guidance: Change AUTORELEASE in rules.mk to: ``` AUTORELEASE = $(if $(DUMP),0,$(shell sed -i "s/\$$(AUTORELEASE)/$(call commitcount,1)/" $(CURDIR)/Makefile)) ``` then update all affected packages by: ``` for i in $(git grep -l PKG_RELEASE:=.*AUTORELEASE | sed 's^.*/\([^/]*\)/Makefile^\1^';); do make package/$i/clean done ``` Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
* uboot-tegra: build with tegra generic subtargetKuan-Yi Li2022-12-251-0/+1
| | | | | | | | | | Fix image build fail by using the generic subtarget. Fixes: c028e1b1 ("tegra: add generic subtarget") Ref: 40e3f660 ("uboot-fritz4040: build with ipq40xx generic subtarget") Signed-off-by: Kuan-Yi Li <kyli@abysm.org> [ add commit description ] Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
* treewide: use AUTORELEASE on all uboot-* packagesAdrian Schmutzler2021-10-021-1/+1
| | | | | | | | Nobody ever updates PKG_RELEASE when changing devices or setup in the various uboot-* packages. Use $(AUTORELEASE) so we still have proper versioning there. Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
* uboot-tegra: bump to 2020.04Tomasz Maciej Nowak2020-12-221-2/+2
| | | | | | | | | This fixes error when host GCC >= 10. /usr/bin/ld: scripts/dtc/dtc-parser.tab.o:(.bss+0x10): multiple definition of `yylloc'; scripts/dtc/dtc-lexer.lex.o:(.bss+0x0): first defined here collect2: error: ld returned 1 exit status Signed-off-by: Tomasz Maciej Nowak <tmn505@gmail.com>
* treewide: update email address of Tomasz Maciej NowakTomasz Maciej Nowak2020-11-241-2/+2
| | | | | | | | | | Replace my o2.pl email address. I'm still available at the old address. Signed-off-by: Tomasz Maciej Nowak <tomek_n@o2.pl> [rephrase commit title/message] Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
* tegra: add vendor string to device nameTomasz Maciej Nowak2019-05-151-1/+1
| | | | | | | for better identification. Also create SUPPORTED_DEVICES string from it which corresponds to dts compatible string. Signed-off-by: Tomasz Maciej Nowak <tomek_n@o2.pl>
* uboot-tegra: bump to 2019.04Tomasz Maciej Nowak2019-05-051-2/+2
| | | | | | | This version has important change for tegra boards which is reserving 32MB memory for Linux kernel instead of current 16MB. Signed-off-by: Tomasz Maciej Nowak <tomek_n@o2.pl>
* uboot-tegra: add U-Boot for tegra boardsTomasz Maciej Nowak2019-04-061-0/+64
Add U-Boot for NVIDIA Tegra based boards, with the first being CompuLab TrimSlice. This is part of initial support for this board. Signed-off-by: Tomasz Maciej Nowak <tomek_n@o2.pl>
r */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
/*
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation;
 * version 2.1 of the License.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 */

#include <stdlib.h>
#include <inttypes.h>
#include <asm/kregs.h>

#include <xen/xen.h>
#include <xen/foreign/ia64.h>
#include <xen/io/protocols.h>

#include "xg_private.h"
#include "xc_dom.h"

#include "ia64/xc_dom_ia64_util.h"

static const char fw_magic[16] = {'X', 'e', 'n', '-',
                                  'i', 'a', '6', '4',
                                  '-', 'f', 'w', 0,
                                  0, 0, 0, 0};
#define FW_LOAD 0xff800000UL
#define FW_SIZE (8 * 1024 * 1024)

static int xc_dom_probe_fw_kernel(struct xc_dom_image *dom)
{
    if (dom->kernel_size != FW_SIZE)
        return -EINVAL;
    if (memcmp (dom->kernel_blob, fw_magic, sizeof (fw_magic)))
        return -EINVAL;
    return 0;
}

static int xc_dom_parse_fw_kernel(struct xc_dom_image *dom)
{
    dom->kernel_seg.vstart = FW_LOAD;
    dom->kernel_seg.vend = FW_LOAD + FW_SIZE;
    dom->parms.virt_base = FW_MEM_BASE;
    dom->parms.virt_entry = FW_LOAD + sizeof (fw_magic);
    dom->ramdisk_blob = NULL; /* No ramdisk yet.  */
    dom->guest_type = "hvm-3.0-ia64-sioemu";
    return 0;
}

static int xc_dom_load_fw_kernel(struct xc_dom_image *dom)
{
    char *dest;
    unsigned long i;

    dest = xc_dom_vaddr_to_ptr(dom, dom->kernel_seg.vstart);
    memcpy(dest, dom->kernel_blob, FW_SIZE);

    /* Synchronize cache.  */
    for (i = 0; i < FW_SIZE; i += 32)
        asm volatile ("fc.i %0" :: "r"(dest + i) : "memory");

    return 0;
}

/* ------------------------------------------------------------------------ */

static int alloc_magic_pages(struct xc_dom_image *dom)
{
    /* allocate special pages */
    /* Note: do not use 0 for console or xenstore otherwise clear_page won't
       clear the page.  */
    dom->start_info_pfn = 0;
    dom->console_pfn = 1;
    dom->xenstore_pfn = 2;
    return 0;
}

extern unsigned long xc_ia64_fpsr_default(void);

static int vcpu_ia64(struct xc_dom_image *dom, void *ptr)
{
    vcpu_guest_context_ia64_t *ctxt = ptr;

    DOMPRINTF_CALLED(dom->xch);

    /* clear everything */
    memset(ctxt, 0, sizeof(*ctxt));

    ctxt->flags = 0;
    ctxt->regs.ip = dom->parms.virt_entry;
#ifdef __ia64__			/* FIXME */
    ctxt->regs.ar.fpsr = xc_ia64_fpsr_default();
#endif
    ctxt->regs.cr.isr = 1UL << 63;
    ctxt->regs.psr = IA64_PSR_AC | IA64_PSR_BN;
    ctxt->regs.cr.dcr = 0;
    ctxt->regs.cr.pta = 15 << 2;

    return 0;
}

static struct xc_dom_arch xc_dom_arch_ia64_fw = {
    .guest_type = "hvm-3.0-ia64-sioemu",
    .native_protocol = XEN_IO_PROTO_ABI_IA64,
    .page_shift = PAGE_SHIFT_IA64,
    .alloc_magic_pages = alloc_magic_pages,
    .start_info = start_info_ia64,
    .shared_info = shared_info_ia64,
    .vcpu = vcpu_ia64,
};

/* ------------------------------------------------------------------------ */

static struct xc_dom_loader fw_loader = {
    .name = "xen-ia64-fw",
    .probe = xc_dom_probe_fw_kernel,
    .parser = xc_dom_parse_fw_kernel,
    .loader = xc_dom_load_fw_kernel,
};

static void __init register_fwloader(void)
{
    xc_dom_register_arch_hooks(&xc_dom_arch_ia64_fw);
    xc_dom_register_loader(&fw_loader);
}

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