Commit c89e6f60 authored by Dave Gerlach's avatar Dave Gerlach Committed by Nishanth Menon
Browse files

[AM437x] Add support for AM437X SoC



Add support for AM437X in omapconf. CPU should be automatically detected.
Basic default operation should the be supported now through omapconf core.

Also add cpu_max_speed detection at the same time for core cpuinfo
support We compare specific bits against the DEV_ATTRIBUTE register
found in the control module for am437x to determine the maximum
frequency supported by the SoC.

Signed-off-by: default avatarDave Gerlach <d-gerlach@ti.com>
Signed-off-by: default avatarNishanth Menon <nm@ti.com>
parent bf0151e2
......@@ -71,6 +71,7 @@ DEF_INC_PATH = -I. -Icommon -Ipmic -Iaudioic -Ilinux -Ii2c-tools\
-Iarch/arm/mach-omap/am335x\
-Iarch/arm/mach-omap/am335x/prcm\
-Iarch/arm/mach-omap/am335x/dpll\
-Iarch/arm/mach-omap/am437x
STATIC_BUILD ?= -static
......@@ -288,6 +289,15 @@ AM335XOBJECTS= $(AM335XSOURCES:.c=.o)
AM437XSOURCES=\
arch/arm/mach-omap/am437x/cpuinfo_am437x.c\
arch/arm/mach-omap/am437x/main_am437x.c\
arch/arm/mach-omap/am437x/help_am437x.c
AM437XOBJECTS= $(AM437XSOURCES:.c=.o)
SOURCES=\
omapconf.c\
common/lib.c\
......@@ -345,12 +355,12 @@ I2COBJECTS= $(I2CSOURCES:.c=.o)
ALLSOURCES= $(SOURCES) $(OMAPSOURCES) $(OMAP4SOURCES) $(OMAP5SOURCES)\
$(DRA7SOURCES) $(AM335XSOURCES)\
$(DRA7SOURCES) $(AM335XSOURCES) $(AM437XSOURCES)\
$(LINUXSOURCES) $(PMICSOURCES) $(AUDIOICSOURCES) $(I2CSOURCES)
ALLOBJECTS= $(OBJECTS) $(OMAPOBJECTS) $(OMAP4OBJECTS) $(OMAP5OBJECTS)\
$(DRA7OBJECTS) $(AM335XOBJECTS)\
$(DRA7OBJECTS) $(AM335XOBJECTS) $(AM437XOBJECTS)\
$(LINUXOBJECTS) $(PMICOBJECTS) $(AUDIOICOBJECTS) $(I2COBJECTS)
......@@ -364,8 +374,8 @@ QUIET_CC = $(Q:@=@echo ' CC '$@;)
QUIET_GEN = $(Q:@=@echo ' GEN '$@;)
QUIET_LINK = $(Q:@=@echo ' LINK '$@;)
EXECUTABLE= omapconf
EXECUTABLE= omapconf
.PHONY: tags cscope
......
......@@ -27,7 +27,7 @@ TI OMAP memory space (registers, ...).
SUPPORT:
--------
OMAPCONF CURRENTLY SUPPORTS TI OMAP44XX AND OMAP54XX DEVICES.
OMAPCONF CURRENTLY SUPPORTS TI AM335x, AM437x, OMAP44XX AND OMAP54XX DEVICES.
LEGACY TI OMAP PLATFORMS (OMAP[1-2-3]) ARE NOT SUPPORTED.
THIS SOFTWARE IS PROVIDED AS IS, WITH NO SUPPORT OR MAINTENANCE COMMITMENT FROM
......
/*
* @Component OMAPCONF
* @Filename cpuinfo_am437x.c
* @Description AM437x CPU Info Functions
* @Author Dave Gerlach (d-gerlach@ti.com)
* @Date 2015
* @Copyright Texas Instruments Incorporated
*
*
* Copyright (C) 2015 Texas Instruments Incorporated - http://www.ti.com/
*
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the
* distribution.
*
* Neither the name of Texas Instruments Incorporated nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
#include <cpuinfo_am437x.h>
#include <cpuinfo.h>
#include <cpufreq.h>
#include <lib.h>
#include <mem.h>
#include <stdio.h>
#include <stdlib.h>
#ifdef CPUID_AM437X_DEBUG
#define dprintf(format, ...) printf(format, ## __VA_ARGS__)
#else
#define dprintf(format, ...)
#endif
#define OPP_50_300MHZ_BIT (0x1 << 0)
#define OPP_100_600MHZ_BIT (0x1 << 2)
#define OPP_120_720MHZ_BIT (0x1 << 3)
#define OPP_TURBO_800MHZ_BIT (0x1 << 4)
#define OPP_NITRO_1GHZ_BIT (0x1 << 5)
/* ------------------------------------------------------------------------*//**
* @FUNCTION cpu_am437x_silicon_max_speed_get
* @BRIEF return silicon max speed (depending on cpu type and
* silicon type)
* @RETURNS Silicon max speed (in MHz)
* 0 in case of error
* @DESCRIPTION return silicon max speed (depending on cpu type and
* silicon type)
*//*------------------------------------------------------------------------ */
unsigned int cpu_am437x_silicon_max_speed_get(void)
{
unsigned int max_speed;
unsigned int dev_attr;
int ret;
if (!cpu_is_am437x()) {
fprintf(stderr, "%s(): unknown chip!\n", __func__);
max_speed = 0;
}
/*
* Bits 5-0 of DEV_ATTRIBUTE register are OPP disable bits
* 1 represents OPP disabled, and 0 represents OPP enabled
*/
ret = mem_read(DEV_ATTRIBUTE_REG, &dev_attr);
if (ret)
return 0;
dev_attr = ~dev_attr;
if (dev_attr & OPP_NITRO_1GHZ_BIT)
max_speed = 1000;
else if (dev_attr & OPP_TURBO_800MHZ_BIT)
max_speed = 800;
else if (dev_attr & OPP_120_720MHZ_BIT)
max_speed = 720;
else if (dev_attr & OPP_100_600MHZ_BIT)
max_speed = 600;
else if (dev_attr & OPP_50_300MHZ_BIT)
max_speed = 300;
else {
fprintf(stderr, "%s(): unknown efuse value!\n", __func__);
max_speed = 300; /* Lowest supported cpu speed */
}
dprintf("%s(): max speed = %dMHz\n", __func__, max_speed);
return max_speed;
}
/* ------------------------------------------------------------------------*//**
* @FUNCTION cpu_am437x_cores_count_get
* @BRIEF return the number of CPU cores available
* @RETURNS >0 number of CPU cores available
* 0 in case of error (unknown architecture)
* @DESCRIPTION return the number of CPU cores available
*//*------------------------------------------------------------------------ */
unsigned int cpu_am437x_cores_count_get(void)
{
if (cpu_is_am437x()) {
return 1;
} else {
fprintf(stderr, "%s(): unknown architecture!\n", __func__);
return 0;
}
}
/*
* @Component OMAPCONF
* @Filename cpuinfo_am437x.h
* @Description AM437x CPU Info Functions
* @Author Dave Gerlach (d-gerlach@ti.com)
* @Date 2015
* @Copyright Texas Instruments Incorporated
*
*
* Copyright (C) 2015 Texas Instruments Incorporated - http://www.ti.com/
*
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the
* distribution.
*
* Neither the name of Texas Instruments Incorporated nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
#ifndef __CPUID_AM437X_H__
#define __CPUID_AM437X_H__
#define DEV_ATTRIBUTE_REG 0x44E10610
unsigned int cpu_am437x_silicon_max_speed_get(void);
unsigned int cpu_am437x_cores_count_get(void);
#endif
/*
*
* @Component OMAPCONF
* @Filename help_am437x.c
* @Description Help for AM437X specific functions
* @Author Dave Gerlach <d-gerlach@ti.com>
* @Date 2015
* @Copyright Texas Instruments Incorporated
*
*
* Copyright (C) 2015 Texas Instruments Incorporated - http://www.ti.com/
*
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the
* distribution.
*
* Neither the name of Texas Instruments Incorporated nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
#include <cpuinfo.h>
#include <help_am437x.h>
#include <stdio.h>
/* ------------------------------------------------------------------------*//**
* @FUNCTION help_am437x
* @BRIEF display help for AM437X-specific functions
* @param[in] cat: help category to display
* @DESCRIPTION display help for AM437X-specific functions
*//*------------------------------------------------------------------------ */
void help_am437x(help_category cat, char *context)
{
if (cat >= HELP_CATEGORY_MAX) {
fprintf(stderr, "%s(): incorrect category!!! (%u)\n",
__func__, cat);
return;
}
if (context == NULL) {
fprintf(stderr, "%s(): context == NULL!!!\n", __func__);
return;
}
}
/*
*
* @Component OMAPCONF
* @Filename help_am437x.h
* @Description Help for AM437X specific functions
* @Author Dave Gerlach <d-gerlach@ti.com>
* @Date 2015
* @Copyright Texas Instruments Incorporated
*
*
* Copyright (C) 2015 Texas Instruments Incorporated - http://www.ti.com/
*
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the
* distribution.
*
* Neither the name of Texas Instruments Incorporated nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
#ifndef __HELP_AM437X_H__
#define __HELP_AM437X_H__
#include <help.h>
void help_am437x(help_category cat, char *context);
#endif
/*
*
* @Component OMAPCONF
* @Filename main_am437x.c
* @Description OMAPCONF AM437X Main file
* @Author Dave Gerlach <d-gerlach@ti.com>
* @Date 2015
* @Copyright Texas Instruments Incorporated
*
*
* Copyright (C) 2015 Texas Instruments Incorporated - http://www.ti.com/
*
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the
* distribution.
*
* Neither the name of Texas Instruments Incorporated nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
#include <cpuinfo.h>
#include <help.h>
#include <lib.h>
#include <main_am437x.h>
#include <opp.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <temperature.h>
#include <unistd.h>
#ifdef MAIN_AM437X_DEBUG
#define dprintf(format, ...) printf(format, ## __VA_ARGS__)
#else
#define dprintf(format, ...)
#endif
/* ------------------------------------------------------------------------*//**
* @FUNCTION main_am437x_legacy
* @BRIEF AM437X functions main entry point (legacy)
* @RETURNS 0 in case of success
* OMAPCONF_ERR_ARG
* OMAPCONF_ERR_CPU
* OMAPCONF_ERR_REG_ACCESS
* OMAPCONF_ERR_INTERNAL
* @param[in] argc: shell input argument number
* @param[in] argv: shell input argument(s)
* @DESCRIPTION AM437X functions main entry point (legacy)
*//*------------------------------------------------------------------------ */
static int main_am437x_legacy(int argc, char*argv[])
{
int ret;
if (argc < 1) {
ret = err_unknown_argument_msg_show(argv[0]);
}
fprintf(stderr, "\n\n### WARNING ###: deprecated command/options. "
"See 'omapconf --help'.\n\n");
return ret;
}
/* ------------------------------------------------------------------------*//**
* @FUNCTION main_am437x
* @BRIEF AM437X functions main entry point
* @RETURNS 0 in case of success
* OMAPCONF_ERR_ARG
* OMAPCONF_ERR_CPU
* OMAPCONF_ERR_REG_ACCESS
* OMAPCONF_ERR_INTERNAL
* @param[in] argc: shell input argument number
* @param[in] argv: shell input argument(s)
* @DESCRIPTION AM437X functions main entry point.
*//*------------------------------------------------------------------------ */
int main_am437x(int argc, char *argv[])
{
int ret = 0;
/* Check CPU */
if (!cpu_is_am437x()) {
ret = OMAPCONF_ERR_CPU;
goto main_am437x_end;
}
if (argc < 1)
goto main_am437x_err_arg;
ret = main_am437x_legacy(argc, argv);
goto main_am437x_end;
main_am437x_err_arg:
help(HELP_ALL);
ret = OMAPCONF_ERR_ARG;
main_am437x_end:
return ret;
}
/*
*
* @Component OMAPCONF
* @Filename main_am437x.h
* @Description OMAPCONF AM437X Main file
* @Author Dave Gerlach <d-gerlach@ti.com>
* @Date 2015
* @Copyright Texas Instruments Incorporated
*
*
* Copyright (C) 2015 Texas Instruments Incorporated - http://www.ti.com/
*
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the
* distribution.
*
* Neither the name of Texas Instruments Incorporated nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
#ifndef __MAIN_AM437X_H__
#define __MAIN_AM437X_H__
int main_am437x(int argc, char *argv[]);
#endif
......@@ -46,6 +46,7 @@
#include <cpuinfo44xx.h>
#include <cpuinfo54xx.h>
#include <cpuinfo_am335x.h>
#include <cpuinfo_am437x.h>
#include <cpuinfo_dra7xx.h>
#include <lib.h>
#include <mem.h>
......@@ -88,6 +89,10 @@
#define AM335X_SI_REV_2_0 0x1B94402E
#define AM335X_SI_REV_2_1 0x2B94402E
/* Identification Registers for AM437x */
#define AM437X_DEVICE_ID 0x44E10600
#define AM437X_DEV_FEAT_REG 0x44E10604
#define AM335X_STATUS 0x44E10040
#define OMAP44XX_STATUS 0x4A0022C4
#define OMAP54XX_STATUS 0x4A002134
......@@ -121,6 +126,9 @@
#define OMAP4430_ES_2_0_ID_CODE 0x1B85202F
#define OMAP4430_ES_1_0_ID_CODE 0x0B85202F
#define AM437X_SI_REV_1_0 0x0B98C02F
#define AM437X_SI_REV_1_1 0x1B98C02F
#define AM437X_SI_REV_1_2 0x2B98C02F
static unsigned short cpu_forced;
......@@ -141,6 +149,7 @@ static const char cpu_name[OMAP_MAX + 1][CPU_NAME_MAX_LENGTH] = {
[AM_3358] = "AM3358",
[AM_3359] = "AM3359",
[AM_335X] = "AM335X",
[AM_437X] = "AM437X",
[OMAP_MAX] = "UNKNOWN"};
static char cpu_full_name[CPU_FULL_NAME_MAX_LENGTH];
......@@ -296,7 +305,7 @@ unsigned int cpu_is_omap(void)
/* Truncate line at whitespace */
machine_name = strtok(line, " \n\t\v\f\r");
if (!strcasecmp(machine_name, "AM335X"))
if (!strcasecmp(machine_name, "AM335X") || !strcasecmp(machine_name, "AM437X"))
ret = 0;
fclose(fp);
......@@ -319,6 +328,19 @@ unsigned int cpu_is_am335x(void)
(cpu == AM_335X));
}
/* ------------------------------------------------------------------------*//**
* @FUNCTION cpu_is_am437x
* @BRIEF check if cpu is AM437x
* @RETURNS 1 if cpu is AM437x
* 0 if cpu is NOT AM437x
* @param[in] none
* @DESCRIPTION check if cpu is AM437x
*//*------------------------------------------------------------------------ */
unsigned int cpu_is_am437x(void)
{
return cpu == AM_437X;
}
/* ------------------------------------------------------------------------*//**
* @FUNCTION cpu_is_dra7xx
......@@ -750,6 +772,8 @@ unsigned int cpu_silicon_max_speed_get(void)
max_speed = cpu_dra7xx_silicon_max_speed_get();
} else if(cpu_is_am335x()) {
max_speed = cpu_am335x_silicon_max_speed_get();
} else if(cpu_is_am437x()) {
max_speed = cpu_am437x_silicon_max_speed_get();
} else {
dprintf("%s(): unknown architecture!\n", __func__);
max_speed = 0;
......@@ -840,7 +864,7 @@ char *cpu_die_id_get(unsigned int *die_id_3, unsigned int *die_id_2,
* The DIE ID for the AM335X is TI proprietary information
* NULL is returned since it cannot be shown
*/
if (cpu_is_am335x())
if (cpu_is_am335x() || cpu_is_am437x())
return NULL;
if (cpu_get() == DRA_75X || cpu_get() == DRA_72X) {
......@@ -1133,6 +1157,18 @@ static int identify_sitara(void)
ret = identify_am335x_features();
cpu_revision_set(REV_ES2_1);
break;
case AM437X_SI_REV_1_0:
cpu_set(AM_437X);
cpu_revision_set(REV_ES1_0);
break;
case AM437X_SI_REV_1_1:
cpu_set(AM_437X);
cpu_revision_set(REV_ES1_1);