Path: blob/main/sys/arm/freescale/imx/imx_machdep.h
39536 views
/*-1* SPDX-License-Identifier: BSD-2-Clause2*3* Copyright (c) 2013 Ian Lepore <[email protected]>4* 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#ifndef IMX_MACHDEP_H29#define IMX_MACHDEP_H3031#include <sys/types.h>32#include <sys/sysctl.h>3334SYSCTL_DECL(_hw_imx);3536/* Common functions, implemented in imx_machdep.c. */3738void imx_wdog_cpu_reset(vm_offset_t _wdcr_phys) __attribute__((__noreturn__));39void imx_wdog_init_last_reset(vm_offset_t _wdsr_phys);4041/* From here down, routines are implemented in imxNN_machdep.c. */4243/*44* SoC identity.45* According to the documentation, there is such a thing as an i.MX6 Dual46* (non-lite flavor). However, Freescale doesn't seem to have assigned it a47* number in their code for determining the SoC type in u-boot.48*49* To-do: put silicon revision numbers into the low-order bits somewhere.50*/51#define IMXSOC_51 0x5100000052#define IMXSOC_53 0x5300000053#define IMXSOC_6SL 0x6000000054#define IMXSOC_6DL 0x6100000055#define IMXSOC_6S 0x6200000056#define IMXSOC_6Q 0x6300000057#define IMXSOC_6UL 0x6400000058#define IMXSOC_FAMSHIFT 285960u_int imx_soc_type(void);6162static inline u_int63imx_soc_family(void)64{65return (imx_soc_type() >> IMXSOC_FAMSHIFT);66}6768#endif697071