/*-1* SPDX-License-Identifier: BSD-2-Clause2*3* Copyright (c) 2013 Thomas Skibo4* All rights reserved.5*6* Redistribution and use in source and binary forms, with or without7* modification, are permitted provided that the following conditions8* are met:9* 1. Redistributions of source code must retain the above copyright10* notice, this list of conditions and the following disclaimer.11* 2. Redistributions in binary form must reproduce the above copyright12* notice, this list of conditions and the following disclaimer in the13* documentation and/or other materials provided with the distribution.14*15* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND16* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE17* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE18* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE19* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL20* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS21* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)22* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT23* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY24* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF25* SUCH DAMAGE.26*/2728/*29* Machine dependent code for Xilinx Zynq-7000 Soc.30*31* Reference: Zynq-7000 All Programmable SoC Technical Reference Manual.32* (v1.4) November 16, 2012. Xilinx doc UG585.33*/3435#include "opt_platform.h"3637#include <sys/param.h>38#include <sys/systm.h>39#include <sys/bus.h>40#include <sys/devmap.h>4142#include <vm/vm.h>43#include <vm/pmap.h>4445#include <machine/bus.h>46#include <machine/machdep.h>47#include <machine/platform.h>48#include <machine/platformvar.h>4950#include <arm/xilinx/zy7_machdep.h>51#include <arm/xilinx/zy7_reg.h>5253#include "platform_if.h"54#include "platform_pl310_if.h"5556void (*zynq7_cpu_reset)(void);5758/*59* Set up static device mappings. Not strictly necessary -- simplebus will60* dynamically establish mappings as needed -- but doing it this way gets us61* nice efficient 1MB section mappings.62*/63static int64zynq7_devmap_init(platform_t plat)65{6667devmap_add_entry(ZYNQ7_PSIO_HWBASE, ZYNQ7_PSIO_SIZE);68devmap_add_entry(ZYNQ7_PSCTL_HWBASE, ZYNQ7_PSCTL_SIZE);6970return (0);71}7273static void74zynq7_do_cpu_reset(platform_t plat)75{76if (zynq7_cpu_reset != NULL)77(*zynq7_cpu_reset)();7879printf("cpu_reset: no platform cpu_reset. hanging.\n");80for (;;)81;82}8384static platform_method_t zynq7_methods[] = {85PLATFORMMETHOD(platform_devmap_init, zynq7_devmap_init),86PLATFORMMETHOD(platform_cpu_reset, zynq7_do_cpu_reset),8788#ifdef SMP89PLATFORMMETHOD(platform_mp_setmaxid, zynq7_mp_setmaxid),90PLATFORMMETHOD(platform_mp_start_ap, zynq7_mp_start_ap),91#endif9293PLATFORMMETHOD(platform_pl310_init, zynq7_pl310_init),9495PLATFORMMETHOD_END,96};9798FDT_PLATFORM_DEF(zynq7, "zynq7", 0, "xlnx,zynq-7000", 200);99100101