Commit 91dfc503 authored by Evan Lojewski's avatar Evan Lojewski Committed by Raptor Engineering Development Team
Browse files

build: Transition to cmake/clang code from the bootrom

parent 02747e4a
// ---------------------------------------------------------------------
// This file is provided by Gimpel Software (www.gimpel.com) for use with
// its products PC-lint and FlexeLint.
//
// Redistribution and use of this file, with or without modification, is
// permitted provided that any such redistribution retains this notice.
// ---------------------------------------------------------------------
#ifndef CO_GCC_H_
#define CO_GCC_H_
/*lint -save -w1 */
#ifdef _lint /* Make sure no compiler comes this way */
#ifdef __cplusplus
extern "C" {
#endif
/* Standard library headers typically define the assert macro so that it
expands to a complicated conditional expression that uses special
funtions that Lint does not know about by default. For linting
purposes, we can simplify things a bit by forcing assert() to expand to
a call to a special function that has the appropriate 'assert'
semantics.
*/
//lint -function( __assert, __lint_assert )
void __lint_assert( int );
//lint ++d"assert(e)=__lint_assert(!!(e))"
//(++d makes this definition permanently immutable for the Lint run.)
//Now that we've made our own 'assert', we need to keep people from being
//punished when the marco in 'assert.h' appears not to be used:
//lint -efile(766,*assert.h)
typedef char *__builtin_va_list;
/*lint -e{171} */
__builtin_va_list __lint_init_va(...);
void __builtin_va_end( __builtin_va_list );
/*lint
++d"__builtin_va_start(ap,parmN)=((ap)=__lint_init_va(parmN))"
++d"__builtin_va_arg(a,b)=(*( ((b) *) ( (((a) += sizeof(b)) - sizeof(b) )))"
*/
/*
The headers included below must be generated; For C++, generate
with:
g++ [usual build options] -E -dM t.cpp >lint_cppmac.h
For C, generate with:
gcc [usual build options] -E -dM t.c >lint_cmac.h
...where "t.cpp" and "t.c" are empty source files.
It's important to use the same compiler options used when compiling
project code because they can affect the existence and precise
definitions of certain predefined macros. See gcc-readme.txt for
details and a tutorial.
*/
@DEFINES@
#define __has_feature(__x__) false
#define __has_include_next(__x__) false
/* If the macro set given by the generated macro files must be adjusted in
order for Lint to cope, then you can make those adjustments here.
*/
#define LINT_CO_GCC_H_GCC_VERSION ( __GNUC__ * 10000 + \
__GNUC_MINOR__ * 100 + \
__GNUC_PATCHLEVEL__ )
/* The following is a workaround for versions of GCC with bug 25717, in
which the preprocessor does not dump a #define directive for __STDC__
when -dM is given:
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25717
We know the unconditional definition of __STDC__ was introduced no
later than version 3.0; the preprocessor bug was fixed no later than
version 4.1.0.
*/
#if ( LINT_CO_GCC_H_GCC_VERSION >= 30000 && \
LINT_CO_GCC_H_GCC_VERSION < 40100 )
# define __STDC__ 1
#endif
#if !__cplusplus && !__STRICT_ANSI__ && __STDC_VERSION__ < 199901L
/* apparently, the code is compiled with -std=gnu89 (as opposed to -std=c89),
so: */
/*lint -rw_asgn(inline,__inline) */
#endif
#if LINT_CO_GCC_H_GCC_VERSION >= 40300
# define __COUNTER__ __lint__COUNTER__
//lint +rw( *type_traits ) // Enable type traits support
#endif
#ifdef __cplusplus
} /* extern "C" */
#endif
#if _lint >= 909 // For 9.00i and later:
//// __attribute__ is GCC's __attribute__:
//
//lint -rw_asgn(__attribute__,__gcc_attribute__)
//lint -rw_asgn(__attribute, __gcc_attribute__)
//
//// Prevent "__attribute__" from being defined as a macro:
//
//lint --u"__attribute__"
//lint --u"__attribute"
//
//// Because an attribute-specifier is a form of
//// declaration-modifier, and because it can appear at the
//// beginning of a decl-specifier-seq, we must enable "Early
//// Modifiers":
//
//lint +fem
#else // for 9.00h and earlier:
//lint -d__attribute__()=
//lint -d__attribute()=
#endif
#endif /* _lint */
/*lint -restore */
#endif /* CO_GCC_H_ */
/* Date Stamp */ -d"_lint_co_gcc_lnt=co-gcc.lnt modified 12-Jun-2014"
/* To document usage use: -message( "Using " _lint_co_gcc_lnt ) */
// ---------------------------------------------------------------------
// This file is provided by Gimpel Software (www.gimpel.com) for use with
// its products PC-lint and FlexeLint.
//
// Redistribution and use of this file, with or without modification, is
// permitted provided that any such redistribution retains this notice.
// ---------------------------------------------------------------------
/* co-gcc.lnt: This is the seed file for configuring Lint for use with
GCC versions 2.95.3 and later.
Like all compiler options files this file is intended to be used
as follows:
lint co-gcc.lnt source-files-to-be-linted
Some of the information that co-gcc.lnt requires needs to be furnished
with the help of the gcc system itself. The easiest way to generate
this information is to use the makefile co-gcc.mak (supplied with the
Lint distribution) in an invocation of GNU Make; for details, see the
commentary at the top of co-gcc.mak.
*/
-cgnu // Notifies FlexeLint that gcc is being used.
// ===========================
// Preprocessor Configuration:
+fdi // GCC starts its #include search in the directory of the including
// file.
++fln // Allow:
// # digit-sequence " [s-char-sequence] " new-line
// as a synonym for:
// # line digit-sequence " [s-char-sequence] " new-line
// GCC additionally allows flag values to follow the
// s-char-sequence, but currently Lint ignores them.
@INCLUDES@
// Assertion directives (a feature of GCC's preprocessor) have been
// considered obsolete in GCC's documentation since version 3.0, so we do
// not use them here. If support for #assert is needed in the form of a
// lint option, one may use '-a#' like so:
// -a#machine(i386) // #assert's machine(i386) (SVR4 facility).
// File extensions:
// From the GCC man page:
//
// file.cc
// file.cp
// file.cxx
// file.cpp
// file.CPP
// file.c++
// file.C
// C++ source code that must be preprocessed. Note that in .cxx, the
// last two letters must both be literally x. Likewise, .C refers to
// a literal capital C.
//
// We emulate this with:
+cpp(.cc)
+cpp(.cp)
+cpp(.cxx)
+cpp(.cpp)
+cpp(.c++)
// Note the exceptions:
// +cpp(.CPP)
// +cpp(.C)
// These are commented out for the default config because they seem to
// cause trouble more often than not. For starters, it is problematic
// with filesystems that are case-insensitive (which has become common
// even on some POSIX systems).
// =============
// Size Options:
// +fwc // wchar_t might be builtin; if so, uncomment this option. (NOTE:
// // this option needs to be set before a size option is given for
// // wchar_t; see the documentation for -sw# in the Lint manual.)
// size-options.lnt // This .lnt file should be generated (preferrably
// by a program created by invoking GCC with the compile options that
// are used in the compilation of the project to be linted). This
// happens automatically when 'make -f co-gcc.mak' is invoked.
// ===========================================
// +rw and -d options to cope with GNU syntax:
+ppw(ident) // Tolerate #ident
+ppw(warning)
// GCC provides alternative spellings of certain keywords:
+rw(__inline)
-rw_asgn(__inline__,__inline)
-rw_asgn(__header_always_inline,__inline)
-rw_asgn(__header_inline,__inline)
-rw_asgn(__signed__,signed)
-rw_asgn(__signed,signed)
-rw_asgn( __volatile__, volatile )
-rw_asgn( __volatile, volatile )
+rw(restrict)
-rw_asgn(__restrict,restrict)
-rw_asgn(__restrict__,restrict)
++d"__const=const" // gconv.h uses __const rather than const
++d"const=const" // ensure const expands to const.
-rw_asgn( asm, _up_to_brackets )
-rw_asgn( __asm, _up_to_brackets )
-rw_asgn( __asm__, _up_to_brackets )
// This re-definition of the various spellings of the asm keyword enables
// Lint to pass gracefully over expression-statements like:
// __asm __volatile ("fsqrt" : "=t" (__result) : "0" (__x));
// But it may be necessary to suppress certain error messages that are
// triggered by tokens that are part of an assembly declaration or
// statement. For example:
-d"__asm__(p...)=/*lint -e{19}*/ __asm__(p)"
// ...causes Lint to be quiet about the semicolon that follows an
// __asm__() declaration. Note, the -e{N} form of suppression takes
// effect only for the forward-declaration, definition or
// [possibly-compound] statement that immediately follows. Because a
// semicolon is seen as a declaration-terminator, Error 19 will be
// re-enabled immediately after the semicolon in '__asm__(...);'.
// (The elipsis after the macro parameter p allows zero or more commas to
// appear in the operand.)
//
// If you encounter other diagnostics that appear to need suppression in
// or near assembly regions, please let us know!
//
-esym(123,__asm__)
++d"_Static_assert(...)=/*lint -e{19}*/"
-rw_asgn(__alignof__,__alignof)
// "__extension__" is GCC's way of allowing the use of non-standard
// constructs in a strict Standard-conforming mode. We don't currently
// have explicit support for it, but we can use local suppressions. For
// example, we can use -e(160) so that we will not see any Errors about
// GNU statement-expressions wrapped in __extension__().
++d"__extension__=/*lint -e(160) */"
++d"__null=0"
+rw(_to_semi) // needed for the two macros above.
+rw(__typeof__) // activate __typeof__ keyword
-d"__typeof=__typeof__" // an alternative to using __typeof__
-rw(__except) // This MS reserved word is used as an identifier
+rw( __complex__, __real__, __imag__ ) // reserved words that can be ignored.
++d"__builtin_strchr=(char*)" // permits the inline definition ...
++d"__builtin_strpbrk=(char*)" // of these functions to be linted ...
++d"__builtin_strrchr=(char*)" // without drawing a complaint
++d"__builtin_strstr=(char*)" // about the use of a non-standard name
++d"__PRETTY_FUNCTION__=___function___" // lint defines ___function___ internally
++d"__FUNCTION__=___function___" // lint defines ___function___ internally
++d"__func__=___function___" // Some C++ modes suport the implicit __func__
// identifier.
-ident($)
// =========================================================
// Other options supporting GNU C/C++ syntax:
+fld // enables the processing of _L_abel _D_esignators E.g.:
// union { double d; int i; } u = { d: 3.141 };
// =========================================================
// Generally useful suppressions:
-wlib(1) // sets the warning level within library headers to 1
// (no warnings, just syntax errors). Comment out if you
// are actually linting library headers.
-elib(123) // 123 is really a warning, but it's in the "Error" range.
-elib(93) // allow newlines within quoted string arguments to macros
-elib(46) // allow bit fields to have integral types other than
// '_Bool' and 'int'.
-elibsym(628) // Suppress 628 for __builtin symbols.
-esym(528,__huge_val,__nan,__qnan,__qnanf,__snan,__snanf)
// We don't care if we don't reference some GNU functions
-esym(528,__gnu_malloc,__gnu_calloc)
// The following functions exhibit variable return modes.
// That is, they may equally-usefully be called for a value
// as called just for their effects. Accordingly we inhibit
// Warning 534 for these functions.
// Feel free to add to or subtract from this list.
-esym(534,close,creat,fclose,fprintf,fputc)
-esym(534,fputs,fscanf,fseek,fwrite,lseek,memcpy,memmove,memset)
-esym(534,printf,puts,scanf,sprintf,sscanf,strcat,strcpy)
-esym(534,strncat,strncpy,unlink,write)
// For non-ANSI compilers we suppress messages 515 and 516
// for functions known to have variable argument lists.
// For ANSI compilers, header files should take care of this.
-esym(515,fprintf,printf,sprintf,fscanf,scanf,sscanf)
-esym(516,fprintf,printf,sprintf,fscanf,scanf,sscanf)
-esym(1702,*operator<<,*operator>>)
-esym(534,*operator<<,*operator>>)
-esym(1055,*__builtin*)
-esym(718,*__builtin*) // The compiler does not need these ...
-esym(746,*__builtin*) // declared and it knows their prototypes.
-rw_asgn(__attribute__,__gcc_attribute__)
-rw_asgn(__attribute,__gcc_attribute__)
--u"__attribute__"
--u"__attribute"
+linebuf
+linebuf
//-esym(507, MII_readRegister)
-e507
-sp4
-e755
-e756
-e768
-e526
-e793
build/
*.o
*.d
*.a
*.bin
*.elf
[submodule "bootrom"]
path = bootrom
url = ..//bootrom.git
################################################################################
###
### @file CMakeLists.txt
###
### @project
###
### @brief Top level CMake file
###
################################################################################
###
################################################################################
###
### @copyright Copyright (c) 2018-2020, Evan Lojewski
### @cond
###
### All rights reserved.
###
### Redistribution and use in source and binary forms, with or without
### modification, are permitted provided that the following conditions are met:
### 1. Redistributions of source code must retain the above copyright notice,
### this list of conditions and the following disclaimer.
### 2. 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.
### 3. Neither the name of the copyright holder 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 HOLDER 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.
### @endcond
################################################################################
enable_testing()
include(GoogleTest)
SET(FPGA_BUILD_DIR "${CMAKE_CURRENT_SOURCE_DIR}/bootrom/fpga/release"
CACHE PATH
"Path to the FPGA build folder from the litex-boards repo: <litex-boards-repo>/litex_boards/targets/build/versa_ecp5")
FIND_PROGRAM(CMAKE_C_COMPILER
NAMES flint_clang clang
REQUIRED)
FIND_PROGRAM(CMAKE_CXX_COMPILER
NAMES flint_clang++ clang++
REQUIRED)
FIND_PROGRAM(CMAKE_ASM_COMPILER
NAMES clang
REQUIRED)
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-rtti -fno-exceptions")
include(cmake/version.cmake)
cmake_minimum_required(VERSION 3.5.1)
project(firmware VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH})
include(bootrom/cmake/clang-format.cmake)
include(bootrom/cmake/clang-analyzer.cmake)
include(bootrom/cmake/config.cmake)
add_subdirectory(bootrom/utils)
# add_subdirectory(bootrom/tests)
# # Default include for all subprojects
include_directories(${FPGA_BUILD_DIR}/software/include)
include_directories(bootrom/include)
add_definitions("-D__microwatt__")
add_subdirectory(bootrom/libbase)
ppc64le_add_executable(${PROJECT_NAME}
utility.c
isr.c
main.c
fsi.c
opencores_i2c.c
)
ppc64le_linker_script(${PROJECT_NAME} "${CMAKE_CURRENT_SOURCE_DIR}/linker.ld")
target_link_libraries(${PROJECT_NAME} PRIVATE libbase-nofloat)
target_compile_definitions(${PROJECT_NAME} PRIVATE "-DNO_FLINT") # Disable linting
This diff is collapsed.
BUILD_DIR=/home/meklort/litex-repos/litex-boards/litex_boards/targets/build/versa_ecp5/
include $(BUILD_DIR)/software/include/generated/variables.mak
include $(SOC_DIRECTORY)/software/common.mak
OBJECTS=crt0.o ivt.o crt1.o utility.o isr.o main.o fsi.o opencores_i2c.o
all: firmware.bin
# pull in dependency info for *existing* .o files
-include $(OBJECTS:.o=.d)
%.bin: %.elf
$(OBJCOPY) -O binary $< $@
chmod -x $@
firmware.elf: $(OBJECTS)
${LD} $(LDFLAGS) \
-T linker.ld \
-o $@ \
$(OBJECTS) \
-L$(BUILD_DIR)/software/libbase \
-L$(BUILD_DIR)/software/libcompiler_rt \
-lbase-nofloat -lcompiler_rt
chmod -x $@
main.o: main.c
$(compile)
%.o: %.c
$(compile)
%.o: %.S
$(assemble)
clean:
$(RM) $(OBJECTS) $(OBJECTS:.o=.d) firmware.elf firmware.bin .*~ *~
.PHONY: all main.o clean load
bootrom @ 2fd92987
Subproject commit 2fd929879877e4b35a5eec0622c3948fffad783a
#!/bin/sh
################################################################################
###
### @file build.sh
###
### @project bootrom
###
### @brief Top level build script.
###
################################################################################
###
################################################################################
###
### @copyright Copyright (c) 2020, Evan Lojewski
### @cond
###
### All rights reserved.
###
### Redistribution and use in source and binary forms, with or without
### modification, are permitted provided that the following conditions are met:
### 1. Redistributions of source code must retain the above copyright notice,
### this list of conditions and the following disclaimer.
### 2. 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.
### 3. Neither the name of the copyright holder 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 HOLDER 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.
### @endcond
################################################################################
GENERATOR=
BUILD_DIR=build
ARGS="$@"
if [ ! -x "$CMAKE" ]
then
CMAKE=`which cmake3`
if [ ! -x "$CMAKE" ]
then
CMAKE=`which cmake`
if [ ! -x "$CMAKE" ]
then
echo "ERROR: Unable to locate cmake."
exit -1
fi
fi
fi
if [ ! -x "$CPACK" ]
then
CPACK=`which cpack3`
if [ ! -x "$CPACK" ]
then
CPACK=`which cpack`
if [ ! -x "$CPACK" ]
then
echo "ERROR: Unable to locate cpack."
exit -1
fi
fi
fi
NINJA=`which ninja-build`
if [ -x "$NINJA" ]
then
GENERATOR=-GNinja
else
NINJA=`which ninja`
if [ -x "$NINJA" ]
then
GENERATOR=-GNinja
else
echo "WARNING: Unable to locate ninja."
fi
fi
echo "Using cmake: $CMAKE $GENERATOR"
set -e
# Clean out the build folder.
"$CMAKE" -E remove_directory "$BUILD_DIR"
"$CMAKE" -E make_directory "$BUILD_DIR"
cd "$BUILD_DIR"
# Generate the build system
"$CMAKE" .. $GENERATOR "$@"
# Ensure formatting is correct and perform the build
"$CMAKE" --build . --target check-format --target all
# Run the tests
"$CMAKE" --build . --target test
# Generate release packages.
"$CMAKE" --build . --target package
# Work around an issue with --target package_source that fails due to ('s in the path
"$CPACK" --config ./CPackSourceConfig.cmake
################################################################################
###
### @file source_install.cmake.in
###
### @project
###
### @brief Release Package configurations
###
################################################################################
###
################################################################################
###
### @copyright Copyright (c) 2020, Evan Lojewski
### @cond
###
### All rights reserved.
###
### Redistribution and use in source and binary forms, with or without
### modification, are permitted provided that the following conditions are met:
### 1. Redistributions of source code must retain the above copyright notice,
### this list of conditions and the following disclaimer.
### 2. 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.
### 3. Neither the name of the copyright holder 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 HOLDER 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.
### @endcond
################################################################################
if(CPACK_SOURCE_INSTALLED_DIRECTORIES)
file(INSTALL
DESTINATION
"${CMAKE_INSTALL_PREFIX}/"
TYPE FILE
FILES
"@CMAKE_BINARY_DIR@/changelog"
"@CMAKE_BINARY_DIR@/version"
)
endif()
################################################################################
###
### @file version.cmake
###
### @project bootrom
###
### @brief Version configuration
###
################################################################################
###
################################################################################
###
### @copyright Copyright (c) 2021, Evan Lojewski
### @cond
###
### All rights reserved.
###
### Redistribution and use in source and binary forms, with or without
### modification, are permitted provided that the following conditions are met:
### 1. Redistributions of source code must retain the above copyright notice,
### this list of conditions and the following disclaimer.
### 2. 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.
### 3. Neither the name of the copyright holder 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 HOLDER 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.
### @endcond
################################################################################
SET(VERSION_MAJOR 0)
SET(VERSION_MINOR 1)
SET(VERSION_PATCH )
SET(SEMVER_REGEX "v?(0|[1-9]*)\\.(0|[0-9]*)\\.(0|[0-9]*)")
SET(VERSION_FILE ${CMAKE_SOURCE_DIR}/version)
SET(CHANGELOG_FILE ${CMAKE_SOURCE_DIR}/changelog)
IF(EXISTS ${VERSION_FILE})
# Release package including a version file.
FILE(STRINGS ${VERSION_FILE} lines)
LIST(GET lines 0 FULL_VERSION)
LIST(GET lines 1 VERSION_DATE)
LIST(GET lines 2 VERSION_TIMESTAMP)
STRING(REPLACE "." ";" FULL_VERSION ${FULL_VERSION})
LIST(GET FULL_VERSION 0 VERSION_MAJOR)
LIST(GET FULL_VERSION 1 VERSION_MINOR)
LIST(GET FULL_VERSION 2 VERSION_PATCH)
# Read in changelog
FILE(READ ${CHANGELOG_FILE} CHANGELOG)
ELSE()
# Within a git repository
# Find the previous tag. This should be in the format of "vMajor.Minor.Patch"
# HEAD~1 is used here to ensure release tags build properly.
EXECUTE_PROCESS(COMMAND git describe --abbrev=0 --tags HEAD~1
OUTPUT_VARIABLE PREVIOUS_TAG
OUTPUT_STRIP_TRAILING_WHITESPACE)
STRING(REGEX MATCHALL "${SEMVER_REGEX}" DID_MATCH "${PREVIOUS_TAG}")
SET(PREVIOUS_MAJOR ${CMAKE_MATCH_1})
SET(PREVIOUS_MINOR ${CMAKE_MATCH_2})
SET(PREVIOUS_PATCH ${CMAKE_MATCH_3})
EXECUTE_PROCESS(COMMAND git rev-list --count ${PREVIOUS_TAG}..HEAD
OUTPUT_VARIABLE VERSION_PATCH
OUTPUT_STRIP_TRAILING_WHITESPACE)
EXECUTE_PROCESS(COMMAND git log --pretty=format:%s ${PREVIOUS_TAG}..HEAD
OUTPUT_VARIABLE CHANGELOG
OUTPUT_STRIP_TRAILING_WHITESPACE)
# If we are on the same Major/Minor version, continue increasing the patch version.
IF("${PREVIOUS_MAJOR}.${PREVIOUS_MINOR}" VERSION_EQUAL "${VERSIN_MAJOR}.${VERSION_MINOR}")
MATH(EXPR VERSION_PATCH "${PREVIOUS_PATCH} + ${VERSION_PATCH}")
ELSEIF("${PREVIOUS_MAJOR}.${PREVIOUS_MINOR}" VERSION_GREATER "${VERSIN_MAJOR}.${VERSION_MINOR}")
# We somehow regressed in versioning.
MESSAGE(FATAL_ERROR "Last release ${PREVIOUS_TAG} is newer than current ${VERSION_MAJOR}.${VERSION_MINOR}.x")
ELSE()
# No released versions for this major.minor pair.
ENDIF()
EXECUTE_PROCESS(COMMAND git log -1 --date=short --format=%cd
OUTPUT_VARIABLE VERSION_DATE
OUTPUT_STRIP_TRAILING_WHITESPACE)
EXECUTE_PROCESS(COMMAND git log -1 --date=short --format=%cD
OUTPUT_VARIABLE VERSION_TIMESTAMP
OUTPUT_STRIP_TRAILING_WHITESPACE)
ENDIF()
SET(VERSION_STRING "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}")
add_compile_options(
-DVERSION_MAJOR=${VERSION_MAJOR}
-DVERSION_MINOR=${VERSION_MINOR}
-DVERSION_PATCH=${VERSION_PATCH}
)
FILE(WRITE ${CMAKE_BINARY_DIR}/version "${VERSION_STRING}\n${VERSION_DATE}\n${VERSION_TIMESTAMP}")
FILE(WRITE ${CMAKE_BINARY_DIR}/changelog ${CHANGELOG})
INSTALL(FILES ${CMAKE_BINARY_DIR}/version DESTINATION .)
INSTALL(FILES ${CMAKE_BINARY_DIR}/changelog DESTINATION .)
/* Copyright 2013-2014 IBM Corp.
* Copyright 2020 Raptor Engineering, LLC
* Copyright 2021 Evan Lojewski
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
* implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#define PHYSICAL_ADDRESS_WIDTH 32
#define FIXUP_ENDIAN \
tdi 0,0,0x48; /* Reverse endian of b . + 8 */ \
b 191f; /* Skip trampoline if endian is good */ \
.long 0xa600607d; /* mfmsr r11 */ \
.long 0x01006b69; /* xori r11,r11,1 */ \
.long 0x05009f42; /* bcl 20,31,$+4 */ \
.long 0xa602487d; /* mflr r10 */ \
.long 0x14004a39; /* addi r10,r10,20 */ \
.long 0xa64b5a7d; /* mthsrr0 r10 */ \
.long 0xa64b7b7d; /* mthsrr1 r11 */ \
.long 0x2402004c; /* hrfid */ \
191:
/* Load an immediate 32-bit value into a register */
#define LOAD_IMM32(r, e) \
lis r,(e)@h; \
ori r,r, (e)@l
/* Load an immediate 64-bit value into a register */
#define LOAD_IMM64(r, e) \
lis r,(e)@highest; \
ori r,r,(e)@higher; \
rldicr r,r, 32, 31; \
oris r,r, (e)@h; \
ori r,r, (e)@l;
.section .text.crt0
.global _start
.type _start, @function
_start:
FIXUP_ENDIAN
/* Get our TOC */
#if PHYSICAL_ADDRESS_WIDTH <= 32
LOAD_IMM32(%r2, .TOC.)
#else
LOAD_IMM64(%r2, .TOC.)
#endif
/* setup stack */
ld %r1, _fstack@got(%r2)
subi %r1, %r1, 0x100
/* Jump to compiled code */
b crt1
.size _start, . - _start
////////////////////////////////////////////////////////////////////////////////
///
/// @file crt1.c
///
/// @project
///
/// @brief Support routines to bring up the system before calling main.
///
////////////////////////////////////////////////////////////////////////////////
///
////////////////////////////////////////////////////////////////////////////////
///
/// @copyright Copyright (c) 2021, Evan Lojewski
/// @cond
///
/// All rights reserved.
///
/// Redistribution and use in source and binary forms, with or without
/// modification, are permitted provided that the following conditions are met:
/// 1. Redistributions of source code must retain the above copyright notice,
/// this list of conditions and the following disclaimer.
/// 2. 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.
/// 3. Neither the name of the copyright holder 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 HOLDER 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.
/// @endcond
////////////////////////////////////////////////////////////////////////////////
#include <irq.h>
#include <string.h>
extern char _fbss[];
extern char _ebss[];
#pragma weak _fdata_rom
extern char _fdata_rom[];
extern char _fdata[];
extern char _edata[];
int main(int i, char **c);
// Default exception handler
extern void _exception_entry(void);
extern char _exception_entry_size[];
extern char _ivt_base[];
#define KESTREL_SPR_KAISB (850) /**< Kestrel architecture-specific Interrupt Vector Base register. */
#define EXCEPTION_MASK (0xFFF) /**< Maximum valid exception address */
#define EXCEPTION_RESET (0x100) /**< The causes of system reset exceptions are implementation-dependent. */
#define EXCEPTION_DSI (0x300) /**< A DSI exception occurs when a data memory access cannot be performed. */
#define EXCEPTION_DSegI (0x380) /**< A DSegI exception occurs when a data memory access cannot be performed due to a segment fault. */
#define EXCEPTION_ISI (0x400) /**< An ISI exception occurs when an instruction fetch cannot be performed. */
#define EXCEPTION_ISegI (0x480) /**< An ISegI exception occurs when an instruction fetch cannot be performed due to a segment fault. */
#define EXCEPTION_EXTERNAL_IRQ (0x500) /**< An external interrupt is generated only when an external exception is pending and the interrupt is enabled (MSR[EE] = 1). */
#define EXCEPTION_PROGRAM (0x700) /**< A program exception is caused by conditions which correspond to bit settings in SRR1 and arise during execution of an instruction. */
#define EXCEPTION_DECREMENTER (0x900) /**< The exception is created when the most significant bit changes from 0 to 1. */
#define EXCEPTION_SYSTEM_CALL (0xC00) /**< A system call exception occurs when a System Call (sc) instruction is executed. **/
/**
* Update the interupt vector table base address.
*
* @param ivt_base The 16K aligned interrupt vector table base address.
*/
static inline void irq_set_base(void *ivt_base)
{
__asm__ volatile("mtspr %0, %1" : : "i" (KESTREL_SPR_KAISB), "r" (ivt_base) : "memory");
}
/**
* Read the interupt vector table base address.
*
* @returns The 16K aligned interrupt vector table base address.
*/
static inline void *irq_get_base(void)
{
void* ivt_base;
__asm__ volatile("mfspr %0, %1" : "=r"(ivt_base) : "i" (KESTREL_SPR_KAISB) : "memory");
return ivt_base;
}
//lint -esym(714, crt1) // Referenced by crt0.s
void crt1(void)
{
// This is the main c entry point. Note that no functions that depend
// on initialized data should be called until after the data and bss
// sections are initialized.
// Initialize Data if required
if (_fdata_rom) //lint !e506 !e774
{
memcpy(_fdata, _fdata_rom, (size_t)(_edata - _fdata));
}
// Initialize BSS
memset(_fbss, 0, (size_t)(_ebss - _fbss));
// Initialize the IVT
// clang-format off
static const uint16_t vectors[] = {
EXCEPTION_DSI,
EXCEPTION_DSegI,
EXCEPTION_ISI,
EXCEPTION_ISegI,
EXCEPTION_EXTERNAL_IRQ,
EXCEPTION_PROGRAM,
EXCEPTION_DECREMENTER,
EXCEPTION_SYSTEM_CALL,
};
// clang-format on
irq_set_base(_ivt_base);
for (size_t i = 0; i < sizeof(vectors) / sizeof(vectors[0]); i++)
{
memcpy(_ivt_base + vectors[i], _exception_entry, (size_t)_exception_entry_size);
}
// Jump to the main routine
(void)main(0, NULL);
for (;;)
{
// Spin.
}
}
/* Copyright 2013-2014 IBM Corp.
* Copyright 2020 Raptor Engineering, LLC
* Copyright 2021 Evan Lojewski
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
* implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#define PHYSICAL_ADDRESS_WIDTH 32
/* Load an immediate 64-bit value into a register */
#define LOAD_IMM64(r, e) \
lis r,(e)@highest; \
ori r,r,(e)@higher; \
rldicr r,r, 32, 31; \
oris r,r, (e)@h; \
ori r,r, (e)@l;
/* Load an immediate 32-bit value into a register */
#define LOAD_IMM32(r, e) \
lis r,(e)@h; \
ori r,r, (e)@l
#define REDZONE_SIZE (512)
#define REG_SAVE_SIZE ((32 + 5)*8)
#define STACK_FRAME_C_MINIMAL 64
#define SAVE_NIA (32*8)
#define SAVE_LR (33*8)
#define SAVE_CTR (34*8)
#define SAVE_CR (35*8)
#define SAVE_SRR1 (36*8)
.text
.global _exception_entry;
_exception_entry:
// Save r0 and r2
stdu %r1, -(REG_SAVE_SIZE+REDZONE_SIZE)(%r1)
std %r0, 1*8(%r1)
mflr %r0
std %r0, SAVE_LR(%r1)
std %r2, 2*8(%r1)
// Determine the exception id and jump to __isr
bcl 20,31,$+4
1:
mflr %r0
// Update LR with the __isr address.
#if PHYSICAL_ADDRESS_WIDTH == 32
LOAD_IMM32(%r2, __isr)
#else
LOAD_IMM64(%r2, __isr)
#endif
mtlr %r2
li %r2, (1b - _exception_entry)
sub %r0, %r0, %r2
// Branch to LR -> __isr
blr
nop
.global _exception_entry_size
_exception_entry_size = . - _exception_entry
.size _exception_entry, _exception_entry_size
// Exception handler
.section .text
.type __isr, @function
__isr:
/*
* Assume where we are coming from has a stack and can save there.
* We save the full register set. Since we are calling out to C, we
* could just save the ABI volatile registers
*/
/*
* The first three lines below are executed in the exception handler, so that r0
* can be used to store the origin exception vector
*/
// stdu %r1, -(REG_SAVE_SIZE+REDZONE_SIZE)(%r1)
// std %r0, 1*8(%r1)
// std %r1, 1*8(%r1)
// std %r2, 2*8(%r1)
std %r3, 3*8(%r1)
std %r4, 4*8(%r1)
std %r5, 5*8(%r1)
std %r6, 6*8(%r1)
std %r7, 7*8(%r1)
std %r8, 8*8(%r1)
std %r9, 9*8(%r1)
std %r10, 10*8(%r1)
std %r11, 11*8(%r1)
std %r12, 12*8(%r1)
std %r13, 13*8(%r1)
std %r14, 14*8(%r1)
std %r15, 15*8(%r1)
std %r16, 16*8(%r1)
std %r17, 17*8(%r1)
std %r18, 18*8(%r1)
std %r19, 19*8(%r1)
std %r20, 20*8(%r1)
std %r21, 21*8(%r1)
std %r22, 22*8(%r1)
std %r23, 23*8(%r1)
std %r24, 24*8(%r1)
std %r25, 25*8(%r1)
std %r26, 26*8(%r1)
std %r27, 27*8(%r1)
std %r28, 28*8(%r1)
std %r29, 29*8(%r1)
std %r30, 30*8(%r1)
std %r31, 31*8(%r1)
mr %r10, %r0
mfsrr0 %r0
std %r0, SAVE_NIA(%r1)
// mflr %r0
// std %r0, SAVE_LR(%r1)
mfctr %r0
std %r0, SAVE_CTR(%r1)
mfcr %r0
std %r0, SAVE_CR(%r1)
mfsrr1 %r0
std %r0, SAVE_SRR1(%r1)
stdu %r1, -STACK_FRAME_C_MINIMAL(%r1)
/* When linking with clang, the global entry stub is mistakenly not used here. Ensure r12 is always valid */
/* When using GCC to link, the function prolog is rewritten to use lis r2 instead of addis r2,r12, so this is unneeded. */
#if PHYSICAL_ADDRESS_WIDTH == 32
LOAD_IMM32(%r12, isr)
#else
LOAD_IMM64(%r12, isr)
#endif
mtctr %r12
mr %r3, %r10
bctrl
nop
ld %r1, 0(%r1)
ld %r0, 1*8(%r1)
// ld %r1, 1*8(%r1) // do this at rfid
ld %r2, 2*8(%r1)
// ld %r3, 3*8(%r1) // do this at rfid
ld %r4, 4*8(%r1)
ld %r5, 5*8(%r1)
ld %r6, 6*8(%r1)
ld %r7, 7*8(%r1)
ld %r8, 8*8(%r1)
ld %r9, 9*8(%r1)
ld %r10, 10*8(%r1)
ld %r11, 11*8(%r1)
ld %r12, 12*8(%r1)
ld %r13, 13*8(%r1)
ld %r14, 14*8(%r1)
ld %r15, 15*8(%r1)
ld %r16, 16*8(%r1)
ld %r17, 17*8(%r1)
ld %r18, 18*8(%r1)
ld %r19, 19*8(%r1)
ld %r20, 20*8(%r1)
ld %r21, 21*8(%r1)
ld %r22, 22*8(%r1)
ld %r23, 23*8(%r1)
ld %r24, 24*8(%r1)
ld %r25, 25*8(%r1)
ld %r26, 26*8(%r1)
ld %r27, 27*8(%r1)
ld %r28, 28*8(%r1)
ld %r29, 29*8(%r1)
ld %r30, 30*8(%r1)
ld %r31, 31*8(%r1)
ld %r3, SAVE_LR(%r1)
mtlr %r3
ld %r3, SAVE_CTR(%r1)
mtctr %r3
ld %r3, SAVE_CR(%r1)
mtcr %r3
ld %r3, SAVE_SRR1(%r1)
mtsrr1 %r3
ld %r3, SAVE_NIA(%r1)
mtsrr0 %r3
/* restore %r3 */
ld %r3, 3*8(%r1)
/* do final fixup r1 */
ld %r1, 0*8(%r1)
rfid
.size __isr, . - __isr
......@@ -5,44 +5,45 @@ INCLUDE generated/regions.ld
SECTIONS
{
.text :
{
_ftext = .;
.text :
{
_ftext = .;
*(.text.crt0) /* _start */
*(.text .stub .text.* .gnu.linkonce.t.*)
_etext = .;
} > main_ram
/* Remaing text */
*(.text .stub .text.* .gnu.linkonce.t.*)
_etext = .;
} > main_ram
.rodata :
{
. = ALIGN(8);
_frodata = .;
*(.rodata .rodata.* .gnu.linkonce.r.*)
*(.rodata1)
*(.got .got.*)
*(.toc .toc.*)
.rodata ALIGN(8):
{
_frodata = .;
*(.rodata .rodata.* .gnu.linkonce.r.*)
*(.rodata1)
*(.got .got.*)
*(.toc .toc.*)
/* Make sure the file is aligned on disk as well
as in memory; CRC calculation requires that. */
FILL(0);
. = ALIGN(8);
_erodata = .;
} > main_ram
/* Make sure the file is aligned on disk as well
as in memory; CRC calculation requires that. */
FILL(0);
. = ALIGN(8);
_erodata = .;
} > main_ram
.data :
{
. = ALIGN(8);
_fdata = .;
*(.data .data.* .gnu.linkonce.d.*)
*(.data1)
*(.sdata .sdata.* .gnu.linkonce.s.*)
.data ALIGN(8):
{
_fdata = .;
*(.branch_lt)
*(.data .data.* .gnu.linkonce.d.*)
*(.data1)
*(.sdata .sdata.* .gnu.linkonce.s.*)
/* Make sure the file is aligned on disk as well
as in memory; CRC calculation requires that. */
FILL(0);
. = ALIGN(8);
_edata = .;
} > main_ram
/* Make sure the file is aligned on disk as well
as in memory; CRC calculation requires that. */
FILL(0);
. = ALIGN(8);
_edata = .;
} > main_ram
.ivt ALIGN(16K) (NOLOAD):
{
......@@ -50,29 +51,28 @@ SECTIONS
. += 4K;
} > main_ram
.bss ALIGN(8):
{
_fbss = .;
*(.dynsbss)
*(.sbss .sbss.* .gnu.linkonce.sb.*)
*(.scommon)
*(.dynbss)
*(.bss .bss.* .gnu.linkonce.b.*)
*(COMMON)
. = ALIGN(8);
_ebss = .;
_end = .;
} > sram
.bss :
{
. = ALIGN(8);
__rom_isr_address = .;
. = . + 8;
_fbss = .;
*(.dynsbss)
*(.sbss .sbss.* .gnu.linkonce.sb.*)
*(.scommon)
*(.dynbss)
*(.bss .bss.* .gnu.linkonce.b.*)
*(COMMON)
. = ALIGN(8);
_ebss = .;
_end = .;
} > sram
/DISCARD/ :
{
*(.eh_frame)
*(.comment)
}
/DISCARD/ :
{
*(.eh_frame)
*(.comment)
}
}
PROVIDE(_fstack = ORIGIN(sram) + LENGTH(sram) - 8);
/* Ensure needed symbols are at the expected locations */
ASSERT(_exception_entry_size <= 0x80, "_exception_entry must not be larger than 0x80 bytes)")
......@@ -1228,7 +1228,7 @@ static int enable_avsbus_pmbus(int cpu_count) {
if (i2c_write_register_byte((uint8_t*)I2CMASTER2_BASE, 0x70, 0x01, 0xb0)) {
return -1;
}
printf("\tVCS 1: Placing device in AVSBus voltage command mode\n");
if (i2c_write_register_byte((uint8_t*)I2CMASTER2_BASE, 0x70, 0x00, 0x01)) {
return -1;
......@@ -1236,7 +1236,7 @@ static int enable_avsbus_pmbus(int cpu_count) {
if (i2c_write_register_byte((uint8_t*)I2CMASTER2_BASE, 0x70, 0x01, 0xb0)) {
return -1;
}
printf("\tVDN 1: Placing device in AVSBus voltage command mode\n");
if (i2c_write_register_byte((uint8_t*)I2CMASTER2_BASE, 0x73, 0x00, 0x00)) {
return -1;
......@@ -1285,7 +1285,7 @@ static int disable_avsbus_pmbus(int cpu_count) {
if (i2c_write_register_byte((uint8_t*)I2CMASTER2_BASE, 0x70, 0x01, 0xb0)) {
return -1;
}
printf("\tVCS 1: Placing device in immediate off mode\n");
if (i2c_write_register_byte((uint8_t*)I2CMASTER2_BASE, 0x70, 0x00, 0x01)) {
return -1;
......@@ -1293,7 +1293,7 @@ static int disable_avsbus_pmbus(int cpu_count) {
if (i2c_write_register_byte((uint8_t*)I2CMASTER2_BASE, 0x70, 0x01, 0xb0)) {
return -1;
}
printf("\tVDN 1: Placing device in immediate off mode\n");
if (i2c_write_register_byte((uint8_t*)I2CMASTER2_BASE, 0x73, 0x00, 0x00)) {
return -1;
......@@ -2016,9 +2016,6 @@ int main(void)
uint32_t dword;
#ifdef CONFIG_CPU_HAS_INTERRUPT
// Redirect exception handler to the ISR provided by this application
__rom_isr_address = &isr;
// Mask external interrupts / enable global interrupts
irq_setmask(0);
irq_setie(1);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment