Merge branch 'master' of github.com:opencomputeproject/OpenNetworkLinux into roth_uefi

This commit is contained in:
Carl D. Roth
2017-08-14 15:04:15 -07:00
14 changed files with 101509 additions and 50 deletions

View File

@@ -85,10 +85,42 @@ shift
[ ! "${testonly}" ] || set -x
# set up some tempfs for our download
swi_kmin=1048576
workdir=$(mktemp -d -t boot-tmpfs-XXXXXX)
export TMPDIR=$workdir
# export this tempfs as temporary space for swiprep below
echo "creating ${swi_kmin}k of tmpfs in $workdir"
mount -v -t tmpfs -o size=${swi_kmin}k tmpfs $workdir
workmnt=$workdir
do_cleanup() {
cd /tmp
if [ "$workmnt" ]; then
if grep -q "$workmnt" /proc/mounts; then
umount -v "$workmnt" || :
fi
fi
rm -fr "$workdir"
}
trap "do_cleanup" 0 1
unset swipath host bhost port dir file dev user password scope
case "${SWI}" in
nfs://*/|dir:*)
echo "Mounting ${SWI}"
# do not use the ephemeral temporary directory for
# locally-mounted directories
if test "$workmnt"; then
umount "$workmnt" || :
fi
unset TMPDIR
swipath=$(swimount $SWI)
if [ "$rootfs" ]; then
[ -d "${swipath}/${rootfs}" ] || { echo "${SWI}${rootfs} must be an unpacked rootfs"; exit 1; }
@@ -131,6 +163,10 @@ fi
if [ "$testonly" ]; then
echo "swipath=$swipath rootfs=$rootfs"
echo "Stop here"
trap "" 0 1
# leave temporary directory and mounts
exit 0
fi
@@ -140,6 +176,45 @@ if [ -d "${swipath}" ]; then
umount -l /newroot 2>/dev/null || :
mount --bind "${swipath}/${rootfs}" /newroot
else
##############################
#
# swiprep will (1) unpack the squashfs image to a file,
# and (2) extract the filesystem to /newroot.
#
# We need to make sure there is enough disk space for this...
#
##############################
set dummy $(df -k -P "$workmnt" | tail -1)
tmpavail=$5
# estimate the squashfs size based on the largest one here
# (there may be more than one arch in the SWI file)
squashsz=0
ifs=$IFS; IFS=$CR
for line in $(unzip -ql "$swipath"); do
IFS=$ifs
set dummy $line
case "$5" in
*.sqsh)
if [ "$2" -gt $squashsz ]; then
squashsz=$2
fi
;;
esac
done
IFS=$ifs
# pad by a little to account for inodes and such
squashsz=$(( $squashsz * 105 / 100 ))
if [ $squashsz -gt $tmpavail ]; then
tmpsz=$(( $swi_kmin + $squashsz - $tmpavail ))
echo "Resizing tmpfs to ${tmpsz}k"
mount -o remount,size=${tmpsz}k $workmnt
fi
swiprep --overlay "${swipath}${rootfs}" --unmount --swiref "$swistamp" /newroot
swiprep --record "${swipath}${rootfs}" --swiref "$swistamp" /newroot
fi
@@ -152,6 +227,10 @@ if [ -f /lib/boot-custom ]; then
. /lib/boot-custom
fi
# done with the temporary dirs and mounts
trap "" 0 1
do_cleanup || :
echo "Switching rootfs" # limit 16 chars since serial buffer is not flushed
kill -QUIT 1 # exec /bin/switchroot as PID 1
sleep 30
@@ -162,4 +241,5 @@ exit 1
# Local variables:
# mode: sh
# sh-basic-offset: 4
# sh-indentation: 4
# End:

View File

@@ -141,15 +141,20 @@ case $(uname -m) in
ARCH_LIST="armel"
;;
aarch64)
ARCH_LIST="arm64"
;;
ARCH_LIST="arm64"
;;
*)
q;;
;;
esac
if test "${mode_install}${mode_overlay}"; then
for arch in $ARCH_LIST; do
unzip -q "$swipath" "rootfs-${arch}.sqsh" -d "$workdir"
if unzip -q "$swipath" "rootfs-${arch}.sqsh" -d "$workdir"; then
:
else
echo "*** unzip of root squashfs failed" 1>&2
rm -f "$workdir/rootfs-${arch}.sqsh"
fi
if test -s "$workdir/rootfs-${arch}.sqsh"; then
mv "$workdir/rootfs-${arch}.sqsh" "$workdir/rootfs.sqsh"
break;

View File

@@ -2302,8 +2302,13 @@ CONFIG_DMA_OF=y
# CONFIG_DMATEST is not set
# CONFIG_AUXDISPLAY is not set
# CONFIG_UIO is not set
# CONFIG_VFIO is not set
# CONFIG_VIRT_DRIVERS is not set
CONFIG_VFIO_IOMMU_TYPE1=y
CONFIG_VFIO=y
CONFIG_VFIO_PCI=y
CONFIG_VFIO_FSL_MC=y
CONFIG_VIRTIO=y
#

File diff suppressed because it is too large Load Diff

View File

@@ -1,20 +1,17 @@
diff -uNr a/drivers/soc/fsl/Kconfig.arm b/drivers/soc/fsl/Kconfig.arm
--- a/drivers/soc/fsl/Kconfig.arm 2017-04-14 17:32:33.398146919 +0530
+++ b/drivers/soc/fsl/Kconfig.arm 2017-04-17 12:35:12.618118118 +0530
@@ -20,6 +20,10 @@
The Soc Drivers provides the device driver that is a specific block
or feature on Layerscape platform.
+if LS_SOC_DRIVERS
+ source "drivers/soc/fsl/ls2-console/Kconfig"
+endif
+
--- a/drivers/soc/fsl/Kconfig.arm 2017-06-05 17:37:14.530348991 +0530
+++ b/drivers/soc/fsl/Kconfig.arm 2017-06-05 17:32:18.630348990 +0530
@@ -23,3 +23,7 @@
if LS1_SOC_DRIVERS
source "drivers/soc/fsl/ls1/Kconfig"
endif
+
+if LS_SOC_DRIVERS
+ source "drivers/soc/fsl/ls2-console/Kconfig"
+endif
diff -uNr a/drivers/soc/fsl/ls2-console/Kconfig b/drivers/soc/fsl/ls2-console/Kconfig
--- a/drivers/soc/fsl/ls2-console/Kconfig 1970-01-01 05:30:00.000000000 +0530
+++ b/drivers/soc/fsl/ls2-console/Kconfig 2017-04-17 12:28:35.718118166 +0530
+++ b/drivers/soc/fsl/ls2-console/Kconfig 2017-06-05 17:32:52.582348990 +0530
@@ -0,0 +1,4 @@
+config FSL_LS2_CONSOLE
+ tristate "Layerscape MC and AIOP console support"
@@ -22,9 +19,9 @@ diff -uNr a/drivers/soc/fsl/ls2-console/Kconfig b/drivers/soc/fsl/ls2-console/Kc
+ default y
diff -uNr a/drivers/soc/fsl/ls2-console/ls2-console.c b/drivers/soc/fsl/ls2-console/ls2-console.c
--- a/drivers/soc/fsl/ls2-console/ls2-console.c 1970-01-01 05:30:00.000000000 +0530
+++ b/drivers/soc/fsl/ls2-console/ls2-console.c 2017-04-17 12:28:35.682118166 +0530
@@ -0,0 +1,272 @@
+/* Copyright 2015 Freescale Semiconductor Inc.
+++ b/drivers/soc/fsl/ls2-console/ls2-console.c 2017-06-05 17:50:42.494348990 +0530
@@ -0,0 +1,291 @@
+/* Copyright 2015-2016 Freescale Semiconductor Inc.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
@@ -64,9 +61,17 @@ diff -uNr a/drivers/soc/fsl/ls2-console/ls2-console.c b/drivers/soc/fsl/ls2-cons
+#include <linux/slab.h>
+#include <linux/io.h>
+
+/* MC and IOP character device to read from RAM */
+/* SoC address for the MC firmware base low/high registers */
+#define SOC_CCSR_MC_FW_BASE_ADDR_REGS 0x8340020
+#define SOC_CCSR_MC_FW_BASE_ADDR_REGS_SIZE 2
+/* MC firmware base low/high registers indexes */
+#define MCFBALR_OFFSET 0
+#define MCFBAHR_OFFSET 1
+
+#define MC_BASE_ADDR 0x83c0000000
+/* Bit mask used to obtain the most significant part of the MC base address */
+#define MC_FW_HIGH_ADDR_MASK 0x1FFFF
+/* Bit mask used to obtain the least significant part of the MC base address */
+#define MC_FW_LOW_ADDR_MASK 0xE0000000
+
+#define MC_BUFFER_OFFSET 0x01000000
+#define MC_BUFFER_SIZE (1024*1024*16)
@@ -117,6 +122,17 @@ diff -uNr a/drivers/soc/fsl/ls2-console/ls2-console.c b/drivers/soc/fsl/ls2-cons
+ __adjust_end(cd);
+}
+
+static inline uint64_t get_mc_fw_base_address(void) {
+ uint32_t* mcfbaregs = (uint32_t*) ioremap(SOC_CCSR_MC_FW_BASE_ADDR_REGS,
+ SOC_CCSR_MC_FW_BASE_ADDR_REGS_SIZE);
+ uint64_t mcfwbase = 0ULL;
+ mcfwbase = readl(mcfbaregs + MCFBAHR_OFFSET) & MC_FW_HIGH_ADDR_MASK;
+ mcfwbase <<= 32;
+ mcfwbase |= readl(mcfbaregs + MCFBALR_OFFSET) & MC_FW_LOW_ADDR_MASK;
+ iounmap(mcfbaregs);
+ pr_info("fsl-ls2-console: MC base address at 0x%016llx\n", mcfwbase);
+ return mcfwbase;
+}
+
+static int fsl_ls2_generic_console_open(struct inode *node, struct file *fp,
+ u64 offset, u64 size,
@@ -131,7 +147,7 @@ diff -uNr a/drivers/soc/fsl/ls2-console/ls2-console.c b/drivers/soc/fsl/ls2-cons
+ if (cd == NULL)
+ return -ENOMEM;
+ fp->private_data = cd;
+ cd->map_addr = ioremap(MC_BASE_ADDR + offset, size);
+ cd->map_addr = ioremap(get_mc_fw_base_address() + offset, size);
+
+ cd->hdr = (struct log_header *) cd->map_addr;
+ invalidate(cd->hdr);
@@ -298,12 +314,12 @@ diff -uNr a/drivers/soc/fsl/ls2-console/ls2-console.c b/drivers/soc/fsl/ls2-cons
+MODULE_DESCRIPTION("Freescale LS2 console driver");
diff -uNr a/drivers/soc/fsl/ls2-console/Makefile b/drivers/soc/fsl/ls2-console/Makefile
--- a/drivers/soc/fsl/ls2-console/Makefile 1970-01-01 05:30:00.000000000 +0530
+++ b/drivers/soc/fsl/ls2-console/Makefile 2017-04-17 12:28:35.706118166 +0530
+++ b/drivers/soc/fsl/ls2-console/Makefile 2017-06-05 17:32:52.582348990 +0530
@@ -0,0 +1 @@
+obj-$(CONFIG_FSL_LS2_CONSOLE) += ls2-console.o
diff -uNr a/drivers/soc/fsl/Makefile b/drivers/soc/fsl/Makefile
--- a/drivers/soc/fsl/Makefile 2017-04-14 17:32:33.398146919 +0530
+++ b/drivers/soc/fsl/Makefile 2017-04-17 12:30:18.578118153 +0530
--- a/drivers/soc/fsl/Makefile 2017-06-05 17:37:14.530348991 +0530
+++ b/drivers/soc/fsl/Makefile 2017-06-05 17:33:54.022348991 +0530
@@ -4,3 +4,4 @@
obj-$(CONFIG_LS1_SOC_DRIVERS) += ls1/

View File

@@ -1,7 +1,2 @@
aufs.patch
driver-support-intel-igb-bcm54616-phy.patch
add-kernel-patches-for-nxp-arm64-ls2080ardb-based-on.patch
add-nxp-arm64-ls2088ardb-device-tree.patch
add-fsl-dpaa2-and-fsl-mc-support-based-on-3.18.25.patch
backport-some-kernel-patches-based-on-3.18.25.patch
0001-Patch-set-for-booting-ls2088rdb-with-vfio.patch
ls2_mc_console.patch

View File

@@ -9,7 +9,7 @@ class OnlPlatform_x86_64_accton_as7312_54x_r0(OnlPlatformAccton,
SYS_OBJECT_ID=".7312.54"
def baseconfig(self):
self.insmod('cpr_4011_4mxx')
self.insmod('ym2651y')
for m in [ 'cpld', 'fan', 'psu', 'leds', 'sfp' ]:
self.insmod("x86-64-accton-as7312-54x-%s.ko" % m)

View File

@@ -49,7 +49,7 @@ sys_fan_info_get__(onlp_fan_info_t* info, int id)
}
rv = onlp_file_read_int(&info->rpm,
"%s/fan%d_input", controller, id);
"%s*fan%d_input", controller, id);
if(rv == ONLP_STATUS_E_INTERNAL) {
return rv;
@@ -90,7 +90,7 @@ psu_fan_info_get__(onlp_fan_info_t* info, int id)
return ONLP_STATUS_E_INTERNAL;
}
return onlp_file_read_int(&info->rpm, "%s/fan1_input", dir);
return onlp_file_read_int(&info->rpm, "%s*fan1_input", dir);
}

View File

@@ -223,10 +223,10 @@ extern aim_map_si_t thermal_oid_desc_map[];
* PSU1 and PSU2 sys paths
*/
#define SYS_PSU1_PREFIX \
"/sys/bus/i2c/devices/7-0058/hwmon/hwmon1"
"/sys/bus/i2c/devices/7-0058"
#define SYS_PSU2_PREFIX \
"/sys/bus/i2c/devices/8-0059/hwmon/hwmon2"
"/sys/bus/i2c/devices/8-0059"
#include "system.h"

View File

@@ -62,7 +62,7 @@ onlp_psui_info_get(onlp_oid_t id, onlp_psu_info_t* info)
* For this first version we'll approximate the status using
* the input voltage sensor.
*/
rv = onlp_file_read_int(&info->mvin, "%s/in1_input", dir);
rv = onlp_file_read_int(&info->mvin, "%s*in1_input", dir);
if(rv == ONLP_STATUS_E_MISSING || info->mvin == 0) {
info->status &= ~1;
return 0;
@@ -79,27 +79,26 @@ onlp_psui_info_get(onlp_oid_t id, onlp_psu_info_t* info)
strcpy(info->model, "PSU-LB9");
info->caps |= ONLP_PSU_CAPS_AC;
if(onlp_file_read_int(&info->miin, "%s/curr1_input", dir) == 0) {
if(onlp_file_read_int(&info->miin, "%s*curr1_input", dir) == 0) {
info->caps |= ONLP_PSU_CAPS_IIN;
}
if(onlp_file_read_int(&info->miout, "%s/curr2_input", dir) == 0) {
if(onlp_file_read_int(&info->miout, "%s*curr2_input", dir) == 0) {
info->caps |= ONLP_PSU_CAPS_IOUT;
}
if(onlp_file_read_int(&info->mvout, "%s/in2_input", dir) == 0) {
if(onlp_file_read_int(&info->mvout, "%s*in2_input", dir) == 0) {
info->caps |= ONLP_PSU_CAPS_VOUT;
/* Empirical */
info->mvout /= 500;
}
if(onlp_file_read_int(&info->mpin, "%s/power1_input", dir) == 0) {
if(onlp_file_read_int(&info->mpin, "%s*power1_input", dir) == 0) {
info->caps |= ONLP_PSU_CAPS_PIN;
/* The pmbus driver reports power in micro-units */
info->mpin /= 1000;
}
if(onlp_file_read_int(&info->mpout, "%s/power2_input", dir) == 0) {
if(onlp_file_read_int(&info->mpout, "%s*power2_input", dir) == 0) {
info->caps |= ONLP_PSU_CAPS_POUT;
/* the pmbus driver reports power in micro-units */
info->mpout /= 1000;
}
return ONLP_STATUS_OK;
}

View File

@@ -21,12 +21,12 @@ powerpc_quanta_lb9_system_airflow_get(void)
for(i = 1; i < 5; i++) {
int rpm = 0;
onlp_file_read_int(&rpm, SYS_CONTROLLER_PREFIX_F2B "/fan%d_input", i);
onlp_file_read_int(&rpm, SYS_CONTROLLER_PREFIX_F2B "*fan%d_input", i);
f2b += rpm;
}
for(i = 1; i < 5; i++) {
int rpm = 0;
onlp_file_read_int(&rpm, SYS_CONTROLLER_PREFIX_B2F "/fan%d_input", i);
onlp_file_read_int(&rpm, SYS_CONTROLLER_PREFIX_B2F "*fan%d_input", i);
b2f += rpm;
}

View File

@@ -42,7 +42,7 @@ sys_thermal_info_get__(onlp_thermal_info_t* info, int id)
const char* controller = SYS_CONTROLLER_PREFIX_TEMPERATURE;
rv = onlp_file_read_int(&info->mcelsius,
"%s//temp%d_input", controller, id);
"%s*temp%d_input", controller, id);
if(rv == ONLP_STATUS_E_INTERNAL) {
return rv;
@@ -63,7 +63,7 @@ psu_thermal_info_get__(onlp_thermal_info_t* info, int pid, int id)
/* THERMAL7 -> PSU2 */
char* dir = powerpc_quanta_lb8_r9_system_psu_dir(pid);
info->status |= 1;
return onlp_file_read_int(&info->mcelsius, "%s/temp%d_input", dir, id);
return onlp_file_read_int(&info->mcelsius, "%s*temp%d_input", dir, id);
}
int
@@ -124,4 +124,3 @@ onlp_thermali_info_get(onlp_oid_t id, onlp_thermal_info_t* rv)
return ONLP_STATUS_E_INVALID;
}