From 121cc7da3bb0214d64ad30a0464b923a15fe33d7 Mon Sep 17 00:00:00 2001 From: wadelnn Date: Mon, 7 Aug 2017 17:34:00 +0800 Subject: [PATCH] Add ONIE support on a new Ingrasys S9130-32X platform Adding a new Ingrasys S9130-32X platform. The machine has 32x40GbE/100GbE QSFP28 ports on MediaTek/Nephos NP8367 switch ASIC. CPU module is Intel Xeon D-1518. Signed-off-by: Wade He Signed-off-by: Curt Brune --- machine/ingrasys/ingrasys_s9130_32x/INSTALL | 99 +++++++++++++++++++ .../ingrasys_s9130_32x/busybox/conf/config | 10 ++ .../ingrasys_s9130_32x/demo/platform.conf | 1 + .../ingrasys_s9130_32x/installer.conf | 34 +++++++ .../ingrasys/ingrasys_s9130_32x/kernel/config | 11 +++ .../ingrasys/ingrasys_s9130_32x/kernel/series | 0 .../ingrasys/ingrasys_s9130_32x/machine.make | 47 +++++++++ .../sysroot-lib-onie/sysinfo-platform | 12 +++ 8 files changed, 214 insertions(+) create mode 100644 machine/ingrasys/ingrasys_s9130_32x/INSTALL create mode 100644 machine/ingrasys/ingrasys_s9130_32x/busybox/conf/config create mode 100644 machine/ingrasys/ingrasys_s9130_32x/demo/platform.conf create mode 100644 machine/ingrasys/ingrasys_s9130_32x/installer.conf create mode 100644 machine/ingrasys/ingrasys_s9130_32x/kernel/config create mode 100644 machine/ingrasys/ingrasys_s9130_32x/kernel/series create mode 100644 machine/ingrasys/ingrasys_s9130_32x/machine.make create mode 100644 machine/ingrasys/ingrasys_s9130_32x/rootconf/sysroot-lib-onie/sysinfo-platform diff --git a/machine/ingrasys/ingrasys_s9130_32x/INSTALL b/machine/ingrasys/ingrasys_s9130_32x/INSTALL new file mode 100644 index 000000000..1af5c0c1b --- /dev/null +++ b/machine/ingrasys/ingrasys_s9130_32x/INSTALL @@ -0,0 +1,99 @@ +================================================================================ +Installing ONIE on Ingrasys S9130 Series w/ Intel Xeon Broadwell-DE CPU Module +================================================================================ + +Cross-Compiling ONIE +==================== + +To compile ONIE first change directories to ``build-config`` and then +type ``"make MACHINEROOT=../machine/ingrasys MACHINE=ingrasys_s9130_32x all"``. For example:: + + $ cd build-config + $ make MACHINEROOT=../machine/ingrasys MACHINE=ingrasys_s9130_32x all + +When complete, the ONIE binaries are located in +``build/images``:: + +-rw-r--r-- 1 feng feng 6132992 Mar 21 16:21 ingrasys_s9130_32x-r0.initrd +-rw-r--r-- 1 feng feng 3545776 Mar 21 16:21 ingrasys_s9130_32x-r0.vmlinuz +-rw-r--r-- 1 feng feng 22020096 Mar 21 16:21 onie-recovery-x86_64-ingrasys_s9130_32x-r0.iso +-rw-r--r-- 1 feng feng 9729911 Mar 21 16:21 onie-updater-x86_64-ingrasys_s9130_32x-r0 + +ingrasys_s9130_32x-r0.vmlinuz -- This is the ONIE kernel image + +ingrasys_s9130_32x-r0.initrd -- This is the ONIE initramfs (filesystem) + +onie-updater-x86_64-ingrasys_s9130_32x-r0 -- This is the ONIE self-update image. + This image is a self-extracting archive used for installing ONIE. + +onie-recovery-x86_64-ingrasys_s9130_32x-r0.iso -- This is iso image containing ONIE kernel + ONIE initramfs with ONIE self-update image already included inside. + This might be very useful as it can be easily placed on USB/CD and one can boot from this to install/reinstall/repair ONIE + + +Installing ONIE on a Blank Machine +================================== + +To install ONIE on a new machine use one of the onie-recovery images. + +Overview +-------- + +An "ONIE recovery image" is used for: + +1. installing ONIE on a blank machine, i.e. what manufacturing would + use. + +2. recovering a destroyed ONIE system. + +The recovery image is: + +. .iso -- a hybrid ISO image. + +ISO Recovery Image +------------------ + +The .iso image is used to create the usb recovery disk. + +You can use the .iso image to create a bootable USB memory stick. +Use ``dd`` to copy the .iso image to a USB stick and boot from that:: + + dd if=.iso of=/dev/sdX bs=10M + +For can find the correct ``/dev/sdX`` by inspecing the ``dmesg`` +output after inserting the USB stick into your work station. + +To enable booting from USB in BIOS: + +1. Insert the USB stick + +2. Power on the Ingrasys Switch + +3. Press ECS to get into the BIOS and set USB as boot device + +4. Wait for scanning USB disk grub.cfg + + GNU GRUB version 2.02~beta2-4b8b913+ + + +----------------------------------------------------------------------------+ + |*ONIE: Rescue | + | ONIE: Embed ONIE | + | | + | | + | | + | | + | | + | | + | | + | | + | | + +----------------------------------------------------------------------------+ + + Use the ^ and v keys to select which entry is highlighted. + Press enter to boot the selected OS, `e' to edit the commands + before booting or `c' for a command-line. ESC to return + previous menu. + +5. Choose ``ONIE: Embed ONIE``, then ONIE will be ready after reboot. + +6. ``ONIE: Rescue`` for ONIE rescue mode on USB disk shall also provide + an debugging environment. diff --git a/machine/ingrasys/ingrasys_s9130_32x/busybox/conf/config b/machine/ingrasys/ingrasys_s9130_32x/busybox/conf/config new file mode 100644 index 000000000..0c7da1911 --- /dev/null +++ b/machine/ingrasys/ingrasys_s9130_32x/busybox/conf/config @@ -0,0 +1,10 @@ +CONFIG_SYS_EEPROM=y +CONFIG_SYS_EEPROM_DEVICE_I2C=y +CONFIG_SYS_EEPROM_I2C_DEVICE="/dev/i2c-0" +CONFIG_SYS_EEPROM_I2C_ADDR=0x55 +CONFIG_SYS_EEPROM_I2C_MEM_ADDR_BITS=16 +CONFIG_SYS_EEPROM_I2C_WRITE_2B_DELAY=4000 +CONFIG_SYS_EEPROM_I2C_WRITE_3B_DELAY=4000 +CONFIG_SYS_EEPROM_OFFSET=0 +CONFIG_SYS_EEPROM_SIZE=512 +CONFIG_SYS_EEPROM_MAX_SIZE=512 diff --git a/machine/ingrasys/ingrasys_s9130_32x/demo/platform.conf b/machine/ingrasys/ingrasys_s9130_32x/demo/platform.conf new file mode 100644 index 000000000..07bceec65 --- /dev/null +++ b/machine/ingrasys/ingrasys_s9130_32x/demo/platform.conf @@ -0,0 +1 @@ +# s9130-32x specific info diff --git a/machine/ingrasys/ingrasys_s9130_32x/installer.conf b/machine/ingrasys/ingrasys_s9130_32x/installer.conf new file mode 100644 index 000000000..afe44a808 --- /dev/null +++ b/machine/ingrasys/ingrasys_s9130_32x/installer.conf @@ -0,0 +1,34 @@ +# Ingrasys S9130 Series +# CPU Module: Intel Xeon Broadwell-DE + + +description="Ingrasys S9130-32X" + +# Default ONIE block device +install_device_platform() +{ + # find ata device on the systme, return the 1st one. + + ## + # find the sata dom + ## + + for _device in /sys/block/*/device; do + + # work for kernel 4.1.17 + if echo $(readlink -f $_device)|egrep -q "pci0000:00\/0000:00:1f.2"; then + _disk=`echo $_device | cut -f4 -d/` + echo /dev/$_disk + return 0 + fi + done + + # nothing found, just return /dev/sda + echo /dev/sda + return 1 +} + +# Local Variables: +# mode: shell-script +# eval: (sh-set-shell "/bin/sh" t nil) +# End: diff --git a/machine/ingrasys/ingrasys_s9130_32x/kernel/config b/machine/ingrasys/ingrasys_s9130_32x/kernel/config new file mode 100644 index 000000000..1d8b7645b --- /dev/null +++ b/machine/ingrasys/ingrasys_s9130_32x/kernel/config @@ -0,0 +1,11 @@ +CONFIG_IGB=y +CONFIG_I2C_I801=y +CONFIG_I2C_ISMT=y +CONFIG_USB_XHCI_HCD=y +CONFIG_USB_XHCI_PCI=y +# CONFIG_USB_XHCI_HCD_DEBUGGING is not set +# CONFIG_USB_EHCI_HCD is not set +# CONFIG_USB_EHCI_ROOT_HUB_TT is not set +# CONFIG_USB_EHCI_TT_NEWSCHED is not set +# CONFIG_USB_EHCI_PCI is not set +# CONFIG_USB_EHCI_HCD_PLATFORM is not set diff --git a/machine/ingrasys/ingrasys_s9130_32x/kernel/series b/machine/ingrasys/ingrasys_s9130_32x/kernel/series new file mode 100644 index 000000000..e69de29bb diff --git a/machine/ingrasys/ingrasys_s9130_32x/machine.make b/machine/ingrasys/ingrasys_s9130_32x/machine.make new file mode 100644 index 000000000..b62aed9ed --- /dev/null +++ b/machine/ingrasys/ingrasys_s9130_32x/machine.make @@ -0,0 +1,47 @@ +# Ingrasys S9130 Series +# CPU Module: Intel Xeon Broadwell-DE + +ONIE_ARCH ?= x86_64 +SWITCH_ASIC_VENDOR = nephos + +VENDOR_REV ?= 0 + +# Translate hardware revision to ONIE hardware revision +ifeq ($(VENDOR_REV),0) + MACHINE_REV = 0 +else + $(warning Unknown VENDOR_REV '$(VENDOR_REV)' for MACHINE '$(MACHINE)') + $(error Unknown VENDOR_REV) +endif + +# The VENDOR_VERSION string is appended to the overal ONIE version +# string. HW vendors can use this to appended their own versioning +# information to the base ONIE version string. + +# Vendor ID -- IANA Private Enterprise Number: +# http://www.iana.org/assignments/enterprise-numbers +# Open Compute Project IANA number +VENDOR_ID = 2468 + +# Enable the i2ctools +I2CTOOLS_ENABLE = yes + +# +# Console parameters can be defined here (default values are in +# build-config/arch/x86_64.make). +# +CONSOLE_SPEED = 115200 +CONSOLE_DEV = 0 + +# Set Linux kernel version +LINUX_VERSION = 4.1 +LINUX_MINOR_VERSION = 38 + +# Older GCC required for older 3.2 kernel +GCC_VERSION = 4.9.2 + +#------------------------------------------------------------------------------- +# +# Local Variables: +# mode: makefile-gmake +# End: diff --git a/machine/ingrasys/ingrasys_s9130_32x/rootconf/sysroot-lib-onie/sysinfo-platform b/machine/ingrasys/ingrasys_s9130_32x/rootconf/sysroot-lib-onie/sysinfo-platform new file mode 100644 index 000000000..70dbfa777 --- /dev/null +++ b/machine/ingrasys/ingrasys_s9130_32x/rootconf/sysroot-lib-onie/sysinfo-platform @@ -0,0 +1,12 @@ + +# Use the contents of /sys/class/net/eth0/address + +get_ethaddr() +{ + [ -r /sys/class/net/eth0/address ] && cat /sys/class/net/eth0/address +} + +# Local Variables: +# mode: shell-script +# eval: (sh-set-shell "/bin/sh" t nil) +# End: