/*-1* SPDX-License-Identifier: BSD-4-Clause2*3* Copyright (c) 1994-1998 Mark Brinicombe.4* Copyright (c) 1994 Brini.5* All rights reserved.6*7* This code is derived from software written for Brini by Mark Brinicombe8*9* Redistribution and use in source and binary forms, with or without10* modification, are permitted provided that the following conditions11* are met:12* 1. Redistributions of source code must retain the above copyright13* notice, this list of conditions and the following disclaimer.14* 2. Redistributions in binary form must reproduce the above copyright15* notice, this list of conditions and the following disclaimer in the16* documentation and/or other materials provided with the distribution.17* 3. All advertising materials mentioning features or use of this software18* must display the following acknowledgement:19* This product includes software developed by Brini.20* 4. The name of the company nor the name of the author may be used to21* endorse or promote products derived from this software without specific22* prior written permission.23*24* THIS SOFTWARE IS PROVIDED BY BRINI ``AS IS'' AND ANY EXPRESS OR IMPLIED25* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF26* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.27* IN NO EVENT SHALL BRINI OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,28* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES29* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR30* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)31* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT32* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY33* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF34* SUCH DAMAGE.35*36* from: FreeBSD: //depot/projects/arm/src/sys/arm/at91/kb920x_machdep.c, rev 4537*/3839#include "opt_platform.h"4041#include <sys/param.h>42#include <sys/systm.h>43#include <sys/bus.h>44#include <sys/devmap.h>4546#include <vm/vm.h>47#include <vm/pmap.h>4849#include <machine/bus.h>50#include <machine/machdep.h>51#include <machine/platformvar.h>5253#include <arm/ti/ti_cpuid.h>5455#include "platform_if.h"5657#if defined(SOC_TI_AM335X)58static platform_attach_t ti_am335x_attach;59static platform_devmap_init_t ti_am335x_devmap_init;60#endif61static platform_cpu_reset_t ti_plat_cpu_reset;6263void (*ti_cpu_reset)(void) = NULL;6465int _ti_chip = -1;6667#if defined(SOC_TI_AM335X)68static int69ti_am335x_attach(platform_t plat)70{71_ti_chip = CHIP_AM335X;72return (0);73}74#endif7576/*77* Construct static devmap entries to map out the most frequently used78* peripherals using 1mb section mappings.79*/80#if defined(SOC_TI_AM335X)81static int82ti_am335x_devmap_init(platform_t plat)83{8485devmap_add_entry(0x44C00000, 0x00400000); /* 4mb L4_WKUP devices*/86devmap_add_entry(0x47400000, 0x00100000); /* 1mb USB */87devmap_add_entry(0x47800000, 0x00100000); /* 1mb mmchs2 */88devmap_add_entry(0x48000000, 0x01000000); /*16mb L4_PER devices */89devmap_add_entry(0x49000000, 0x00100000); /* 1mb edma3 */90devmap_add_entry(0x49800000, 0x00300000); /* 3mb edma3 */91devmap_add_entry(0x4A000000, 0x01000000); /*16mb L4_FAST devices*/92return (0);93}94#endif9596static void97ti_plat_cpu_reset(platform_t plat)98{99if (ti_cpu_reset)100(*ti_cpu_reset)();101else102printf("no cpu_reset implementation\n");103}104105#if defined(SOC_TI_AM335X)106static platform_method_t am335x_methods[] = {107PLATFORMMETHOD(platform_attach, ti_am335x_attach),108PLATFORMMETHOD(platform_devmap_init, ti_am335x_devmap_init),109PLATFORMMETHOD(platform_cpu_reset, ti_plat_cpu_reset),110111PLATFORMMETHOD_END,112};113114FDT_PLATFORM_DEF(am335x, "am335x", 0, "ti,am33xx", 200);115#endif116117118