summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEvan Lojewski <github@meklort.com>2021-06-19 09:29:21 -0600
committerGitHub <noreply@github.com>2021-06-19 09:29:21 -0600
commit7d01dd87e833bc5372aaae6c0eb8bc982ac6a419 (patch)
tree4e0615838684ca95bbe4e4d276f12fb2cfb25f57
parent23590ad82730c9304cc58f5e1a649ab909e1cf28 (diff)
downloadbcm5719-ortega-7d01dd87e833bc5372aaae6c0eb8bc982ac6a419.tar.gz
bcm5719-ortega-7d01dd87e833bc5372aaae6c0eb8bc982ac6a419.zip
build: Update various support files with codacy recommendations. (#227)
-rw-r--r--.jenkins.groovy36
-rw-r--r--README.md52
-rw-r--r--ape/vectors.c2
-rwxr-xr-xbuild.sh12
-rwxr-xr-xipxact/regen.sh4
-rw-r--r--libs/NCSI/ncsi.c2
-rw-r--r--libs/Network/tx.c2
7 files changed, 55 insertions, 55 deletions
diff --git a/.jenkins.groovy b/.jenkins.groovy
index 968f900..8545e52 100644
--- a/.jenkins.groovy
+++ b/.jenkins.groovy
@@ -55,39 +55,39 @@ def notify(status, description)
targetUrl: BUILD_URL
}
-def build(nodeName, archive = false, archive_cab = false, analyze = true, test_archive = false)
+def build(nodeName, archive = false, archiveCab = false, analyze = true, testArchive = false)
{
node(nodeName)
{
cleanWs()
- def URL = ''
- def REFSPEC = '+refs/heads/*:refs/remotes/origin/*'
+ def url = ''
+ def refspec = '+refs/heads/*:refs/remotes/origin/*'
try {
- URL = GITHUB_REPO_GIT_URL
+ url = GITHUB_REPO_GIT_URL
}
catch (exc)
{
- URL = 'git://github.com/meklort/bcm5719-fw.git'
+ url = 'git://github.com/meklort/bcm5719-fw.git'
}
- def HASH = ''
+ def hash = ''
try {
- HASH = GITHUB_BRANCH_HEAD_SHA
+ hash = GITHUB_BRANCH_HEAD_SHA
}
catch (exc)
{
try {
- HASH = GITHUB_PR_HEAD_SHA
- REFSPEC = '+refs/pull/*:refs/remotes/origin/pr/*'
+ hash = GITHUB_PR_HEAD_SHA
+ refspec = '+refs/pull/*:refs/remotes/origin/pr/*'
}
catch (exc2)
{
- HASH = '**'
+ hash = '**'
}
}
stage('checkout')
{
checkout(
- [$class: 'GitSCM', branches: [[name: HASH]],
+ [$class: 'GitSCM', branches: [[name: hash]],
browser: [$class: 'GithubWeb',
repoUrl: 'https://github.com/meklort/bcm5719-fw/'],
doGenerateSubmoduleConfigurations: false,
@@ -100,16 +100,16 @@ def build(nodeName, archive = false, archive_cab = false, analyze = true, test_a
trackingSubmodules: false]],
submoduleCfg: [],
userRemoteConfigs: [[
- url: URL,
- refspec: REFSPEC
+ url: url,
+ refspec: refspec
]]
])
- def GIT_SUBJECT = sh (
+ def git_subject = sh (
script: 'git show -s --format=%s',
returnStdout: true,
).trim()
- currentBuild.description = GIT_SUBJECT
+ currentBuild.description = git_subject
}
stage('build')
@@ -132,7 +132,7 @@ def build(nodeName, archive = false, archive_cab = false, analyze = true, test_a
}
}
- if (archive_cab)
+ if (archiveCab)
{
dir('build/fwupd')
{
@@ -141,7 +141,7 @@ def build(nodeName, archive = false, archive_cab = false, analyze = true, test_a
}
}
- if (test_archive)
+ if (testArchive)
{
cleanWs()
@@ -179,7 +179,7 @@ try
"freebsd-12": { build('freebsd-12', true, false, false, false) },
)
}
-catch(e)
+catch (e)
{
currentBuild.result = 'FAILURE'
throw e
diff --git a/README.md b/README.md
index 8a1fbda..8cce073 100644
--- a/README.md
+++ b/README.md
@@ -7,23 +7,23 @@ The firmware has been tested on the [Talos II](https://wiki.raptorcs.com/wiki/Ta
# Status
The current version of the code is functional and is able to handle network traffic over NC-SI.
- - Libraries:
- - MII Library: Done
- - NVRAM Library: Done
- - Stage1/Stage2
- - Implementation: Functional
- - Testing: Minimal, WIP
- - VPD: Functional
- - WOL: Not started
- - APE
- - NC-SI Handler: Functional
- - Get Version ID: Not Implemented
- - OEM Command: Not Implemented
- - BMC <-> Network Communication: Working
- - Utilities
- - Firmware tool: Functional
- - Register tool: Functional
- - Tests: To be written
+- Libraries:
+ - MII Library: Done
+ - NVRAM Library: Done
+- Stage1/Stage2
+ - Implementation: Functional
+ - Testing: Minimal, WIP
+ - VPD: Functional
+ - WOL: Not started
+- APE
+ - NC-SI Handler: Functional
+ - Get Version ID: Not Implemented
+ - OEM Command: Not Implemented
+ - BMC <-> Network Communication: Working
+- Utilities
+ - Firmware tool: Functional
+ - Register tool: Functional
+- Tests: To be written
# Usage
Blackbird and Talos II users may install this firmware using [fwupd](https://fwupd.org/), either via the Linux Vendor Firmware Service, or manually using `fwupdtool` and a [release archive](https://github.com/meklort/bcm5719-fw/releases). Other BCM5719 devices may not be thoroughly tested, or tested at all; should you wish to proceed, it is encouraged to download or [build](#building) the firmware and refer to instructions in [Development](#development), especially the section on [testing APE firmware](#testing-ape-firmware).
@@ -53,8 +53,8 @@ sudo fwupdtool install ./fwupd/blackbird-bcm5719-<version>.cab --allow-branch-sw
## Restoring From Backup
Past firmware images can be restored from backup using the bcmflash tool.
-* If fwupd was used to flash firmware, past backups can be located at `/var/lib/fwupd/backup/`.
-* If `bcmflash` was used to [create a backup](#backup-firmware) the previously saved `firmware.fw` should be used.
+- If fwupd was used to flash firmware, past backups can be located at `/var/lib/fwupd/backup/`.
+- If `bcmflash` was used to [create a backup](#backup-firmware) the previously saved `firmware.fw` should be used.
To restore a backup, the following command can be run:
```bash
@@ -63,14 +63,14 @@ sudo ./bin/bcmflash -t eth -i enP4p1s0f0 -r firmware.fw
# Building
-### Requirements
+## Requirements
This repository depends on a number of external tools
- Customized LLVM/Clang compiler for MIPS firmware
- CMake 3.5.1+
- Linux (utilities)
- IPXact generator (optional)
-### Required Compiler
+## Required Compiler
Due to limitations in the MIPS CPU, this firmware requires a custom compiler to function properly.
The custom compiler can be built using the following steps:
```bash
@@ -83,7 +83,7 @@ ninja
ninja install
```
-### Compiling
+## Compiling
To compile the firmware, the following command sequence can be used:
```bash
git submodule init
@@ -112,13 +112,13 @@ Binding a function allows `bcmflash` to access the device via `-t eth`, with is
After unbinding the driver per the above, the APE firmware can be tested by loading it into RAM using the following sequence (note that this may fail if stage1 has not been loaded):
-#### Talos II (BMC traffic on port 0)
+For **Talos II** (BMC traffic on port 0):
```bash
cd build
sudo ./utils/bcmregtool/bcmregtool --apeboot=ape/ape-port0.bin
```
-#### Blackbird (BMC traffic on port 2)
+For **Blackbird** (BMC traffic on port 2):
```bash
cd build
sudo ./utils/bcmregtool/bcmregtool --apeboot=ape/ape-port2.bin
@@ -126,8 +126,8 @@ sudo ./utils/bcmregtool/bcmregtool --apeboot=ape/ape-port2.bin
### Firmware Log
The APE and Stage1 firmware are able to print status messages to a log. This can be accessed in one of two ways:
- * The ./utils/apeconsole/apeconsole utility can be used if no driver is loaded by the host.
- * The EM100Pro console can be used if wired to the SPI bus on the BCM5719. This allows for printouts even when the host is off.
+- The ```./utils/apeconsole/apeconsole``` utility can be used if no driver is loaded by the host.
+- The EM100Pro console can be used if wired to the SPI bus on the BCM5719. This allows for printouts even when the host is off.
## Backup Firmware
Before altering the BCM5719 flash, the original firmware should be backed up using `bcmflash` and the appropriate `-t` and `-i` options as described in [Development](#Development)
diff --git a/ape/vectors.c b/ape/vectors.c
index 895b439..e02f2d8 100644
--- a/ape/vectors.c
+++ b/ape/vectors.c
@@ -52,7 +52,7 @@ extern vector_t __start; // Defined by crt1.s
void __attribute__((interrupt)) IRQ_Default(void)
{
uint32_t vector = NVIC.InterruptControlState.bits.VECTACTIVE;
- printf("ISR: %d\n", vector);
+ printf("ISR: %u\n", vector);
}
// Alias all IRQ routines ot the default handler.
diff --git a/build.sh b/build.sh
index f1f5b54..f71b167 100755
--- a/build.sh
+++ b/build.sh
@@ -49,10 +49,10 @@ ARGS="$@"
if [ ! -x "$CMAKE" ]
then
- CMAKE=`which cmake3`
+ CMAKE=$(which cmake3)
if [ ! -x "$CMAKE" ]
then
- CMAKE=`which cmake`
+ CMAKE=$(which cmake)
if [ ! -x "$CMAKE" ]
then
echo "ERROR: Unable to locate cmake."
@@ -63,10 +63,10 @@ fi
if [ ! -x "$CPACK" ]
then
- CPACK=`which cpack3`
+ CPACK=$(which cpack3)
if [ ! -x "$CPACK" ]
then
- CPACK=`which cpack`
+ CPACK=$(which cpack)
if [ ! -x "$CPACK" ]
then
echo "ERROR: Unable to locate cpack."
@@ -75,12 +75,12 @@ then
fi
fi
-NINJA=`which ninja-build`
+NINJA=$(which ninja-build)
if [ -x "$NINJA" ]
then
GENERATOR=-GNinja
else
- NINJA=`which ninja`
+ NINJA=$(which ninja)
if [ -x "$NINJA" ]
then
GENERATOR=-GNinja
diff --git a/ipxact/regen.sh b/ipxact/regen.sh
index 28c0c20..cd9fcc0 100755
--- a/ipxact/regen.sh
+++ b/ipxact/regen.sh
@@ -28,11 +28,11 @@ rm bcm5719_BOOTCODE*.cpp
rm bcm5719_RXMBUF*.cpp
rm bcm5719_TXMBUF*.cpp
rm bcm5719_SDBCACHE*.cpp
-mv *.cpp ../simulator/
+mv ./*.cpp ../simulator/
# ${IPXACT} -p ${PROJECT} bcm5719_full.xml bcm5719.s
${IPXACT} -p ${PROJECT} bcm5719_full.xml -t asym bcm5719_sym.s
-mv *.s ../libs/bcm5719/
+mv ./*.s ../libs/bcm5719/
PROJECT=ape
diff --git a/libs/NCSI/ncsi.c b/libs/NCSI/ncsi.c
index 6aa4a44..fe708fb 100644
--- a/libs/NCSI/ncsi.c
+++ b/libs/NCSI/ncsi.c
@@ -724,7 +724,7 @@ void reloadChannel(unsigned int ch, reload_type_t reset_phy)
uint16_t high = (uint16_t)port->shm_channel->NcsiChannelMac0High.r32;
Network_SetMACAddr(port, high, low, /* TBD */ 0, true);
- printf("[ch %d] Reusing MAC: 0x%02X%04X\n", ch, high, low);
+ printf("[ch %u] Reusing MAC: 0x%02X%04X\n", ch, high, low);
Network_InitPort(gPackageState.port[ch], reset_phy);
}
diff --git a/libs/Network/tx.c b/libs/Network/tx.c
index 67ceaf0..d626d98 100644
--- a/libs/Network/tx.c
+++ b/libs/Network/tx.c
@@ -401,7 +401,7 @@ static uint32_t inline Network_TX_initAdditionalPassthroughBlock(RegTX_PORTOut_t
static void drainPassthroughBytes(uint32_t bytes)
{
- printf("Dropping %d bytes\n", bytes);
+ printf("Dropping %u bytes\n", bytes);
// Drain any passthrough bytes to ensure that the NCSI input buffers are not locked up.
int num_words = DIVIDE_RND_UP(bytes, sizeof(uint32_t)) + 1; // +1 for FCS word.
for (int i = 0; i < num_words; i++)
OpenPOWER on IntegriCloud