Browse Source

Import !BMC build data.

Previously was in buildroot

Many of the commits are squashed, partly because this branches history
is going away, and partly because they do not make sense as independant
commits anymore
tags/alpha-Talos-II
dullfire 2 years ago
committed by Jonathan Currier
parent
commit
420c17d82d
76 changed files with 8313 additions and 14 deletions
  1. +12
    -12
      Config.in
  2. +2211
    -0
      board/bangBMC/blackbird.dts
  3. +48
    -0
      board/bangBMC/blackbird.its
  4. +1187
    -0
      board/bangBMC/busybox.config
  5. +36
    -0
      board/bangBMC/fakeroot-fs.sh
  6. +280
    -0
      board/bangBMC/linux-mod.config
  7. +0
    -0
     
  8. +0
    -0
     
  9. +33
    -0
      board/bangBMC/overlay/etc/init.d/atx-gpio
  10. +6
    -0
      board/bangBMC/overlay/etc/init.d/dhcp.eth0
  11. +11
    -0
      board/bangBMC/overlay/etc/init.d/dropbear
  12. +72
    -0
      board/bangBMC/overlay/etc/init.d/ipl-mon
  13. +8
    -0
      board/bangBMC/overlay/etc/init.d/ipmi-bt-miniroute
  14. +7
    -0
      board/bangBMC/overlay/etc/init.d/klogd
  15. +9
    -0
      board/bangBMC/overlay/etc/init.d/mboxd
  16. +137
    -0
      board/bangBMC/overlay/etc/init.d/modules
  17. +361
    -0
      board/bangBMC/overlay/etc/init.d/network
  18. +12
    -0
      board/bangBMC/overlay/etc/init.d/obmc-console
  19. +9
    -0
      board/bangBMC/overlay/etc/init.d/op-fan-daemon
  20. +11
    -0
      board/bangBMC/overlay/etc/init.d/power-button-gpio
  21. +26
    -0
      board/bangBMC/overlay/etc/init.d/ssh-virtual
  22. +91
    -0
      board/bangBMC/overlay/etc/init.d/sshd
  23. +7
    -0
      board/bangBMC/overlay/etc/init.d/syslogd
  24. +97
    -0
      board/bangBMC/overlay/etc/init.d/udev
  25. +19
    -0
      board/bangBMC/overlay/etc/init.d/udev-settle
  26. +96
    -0
      board/bangBMC/overlay/etc/init.d/udev-trigger
  27. +23
    -0
      board/bangBMC/overlay/etc/inittab
  28. +4
    -0
      board/bangBMC/overlay/etc/obmc-console.conf
  29. +314
    -0
      board/bangBMC/overlay/etc/rc.conf
  30. +1
    -0
      board/bangBMC/overlay/etc/runlevels/default/atx-gpio
  31. +1
    -0
      board/bangBMC/overlay/etc/runlevels/default/dropbear
  32. +1
    -0
      board/bangBMC/overlay/etc/runlevels/default/ipl-mon
  33. +1
    -0
      board/bangBMC/overlay/etc/runlevels/default/ipmi-bt-miniroute
  34. +1
    -0
      board/bangBMC/overlay/etc/runlevels/default/mboxd
  35. +1
    -0
      board/bangBMC/overlay/etc/runlevels/default/op-fan-daemon
  36. +1
    -0
      board/bangBMC/overlay/etc/runlevels/default/power-button-gpio
  37. +1
    -0
      board/bangBMC/overlay/etc/runlevels/default/ssh-virtual
  38. +1
    -0
      board/bangBMC/overlay/etc/runlevels/sysinit/dhcp.eth0
  39. +1
    -0
      board/bangBMC/overlay/etc/runlevels/sysinit/klogd
  40. +1
    -0
      board/bangBMC/overlay/etc/runlevels/sysinit/obmc-console
  41. +1
    -0
      board/bangBMC/overlay/etc/runlevels/sysinit/syslogd
  42. +1
    -0
      board/bangBMC/overlay/etc/runlevels/sysinit/udev
  43. +1
    -0
      board/bangBMC/overlay/etc/runlevels/sysinit/udev-trigger
  44. +1
    -0
      board/bangBMC/overlay/etc/udev/rules.d/61-aspeed-vuart.rules
  45. +4
    -0
      board/bangBMC/overlay/init
  46. +0
    -0
     
  47. BIN
     
  48. +3
    -0
      board/bangBMC/overlay/new.run
  49. +34
    -0
      board/bangBMC/overlay/usr/alt-bin/avsbus-disable.sh
  50. +34
    -0
      board/bangBMC/overlay/usr/alt-bin/avsbus-enable.sh
  51. +23
    -0
      board/bangBMC/overlay/usr/alt-bin/avsbus-workaround.sh
  52. +135
    -0
      board/bangBMC/overlay/usr/alt-bin/create_usbhid.sh
  53. +11
    -0
      board/bangBMC/overlay/usr/alt-bin/fpga-setup.sh
  54. +5
    -0
      board/bangBMC/overlay/usr/alt-bin/ipmi-net-firewall.sh
  55. +66
    -0
      board/bangBMC/overlay/usr/alt-bin/lvds.sh
  56. +149
    -0
      board/bangBMC/overlay/usr/alt-bin/occ-active.sh
  57. +23
    -0
      board/bangBMC/overlay/usr/alt-bin/start_hwmon.sh
  58. +137
    -0
      board/bangBMC/overlay/usr/alt-bin/vrm-control.sh
  59. +22
    -0
      board/bangBMC/overlay/usr/alt-bin/vrm.sh
  60. +1
    -0
      board/bangBMC/overlay/usr/bin/dumpkeys
  61. +30
    -0
      board/bangBMC/overlay/usr/bin/host-ipl-complete
  62. +12
    -0
      board/bangBMC/overlay/usr/bin/host-off-script
  63. +75
    -0
      board/bangBMC/overlay/usr/bin/host-on-script
  64. +3
    -0
      board/bangBMC/overlay/usr/bin/host-soft-off-script
  65. +1
    -0
      board/bangBMC/overlay/usr/bin/kbd_mode
  66. +1
    -0
      board/bangBMC/overlay/usr/bin/loadkeys
  67. +1
    -0
      board/bangBMC/overlay/usr/bin/reboot
  68. +10
    -0
      board/bangBMC/overlay/usr/bin/scan-fsi
  69. +0
    -0
     
  70. +20
    -0
      board/bangBMC/post-fs.sh
  71. +12
    -0
      board/bangBMC/pre-fs.sh
  72. +30
    -0
      board/bangBMC/script-support.frag.sh
  73. +2268
    -0
      board/bangBMC/talos.dts
  74. +57
    -0
      configs/blackbird-bmc_defconfig
  75. +1
    -1
      external.desc
  76. +3
    -1
      external.mk

+ 12
- 12
Config.in View File

@@ -1,19 +1,19 @@

source "$BR2_EXTERNAL_raptor_blackbird_minimal_bmc_PATH/package/atx-gpio/Config.in"
source "$BR2_EXTERNAL_raptor_blackbird_minimal_bmc_PATH/package/fsi-host-sbe/Config.in"
source "$BR2_EXTERNAL_raptor_blackbird_minimal_bmc_PATH/package/ipl-mon/Config.in"
source "$BR2_EXTERNAL_raptor_blackbird_minimal_bmc_PATH/package/pwr-button-gpio/Config.in"
source "$BR2_EXTERNAL_raptor_blackbird_minimal_bmc_PATH/package/hiomapd/Config.in"
source "$BR2_EXTERNAL_raptor_blackbird_minimal_bmc_PATH/package/ipmi-bt-miniroute/Config.in"
source "$BR2_EXTERNAL_raptor_blackbird_minimal_bmc_PATH/package/op-fan-daemon/Config.in"
source "$BR2_EXTERNAL_bangBMC_PATH/package/atx-gpio/Config.in"
source "$BR2_EXTERNAL_bangBMC_PATH/package/fsi-host-sbe/Config.in"
source "$BR2_EXTERNAL_bangBMC_PATH/package/ipl-mon/Config.in"
source "$BR2_EXTERNAL_bangBMC_PATH/package/pwr-button-gpio/Config.in"
source "$BR2_EXTERNAL_bangBMC_PATH/package/hiomapd/Config.in"
source "$BR2_EXTERNAL_bangBMC_PATH/package/ipmi-bt-miniroute/Config.in"
source "$BR2_EXTERNAL_bangBMC_PATH/package/op-fan-daemon/Config.in"

if BR2_PACKAGE_IPMI_BT_MINIROUTE
source "$BR2_EXTERNAL_raptor_blackbird_minimal_bmc_PATH/package/ipmi-openpower-storage-time/Config.in"
source "$BR2_EXTERNAL_raptor_blackbird_minimal_bmc_PATH/package/ipmi-chassis-control/Config.in"
source "$BR2_EXTERNAL_raptor_blackbird_minimal_bmc_PATH/package/ipmi-grpext-dcmi/Config.in"
source "$BR2_EXTERNAL_raptor_blackbird_minimal_bmc_PATH/package/ipmi-hiomap-socket/Config.in"
source "$BR2_EXTERNAL_bangBMC_PATH/package/ipmi-openpower-storage-time/Config.in"
source "$BR2_EXTERNAL_bangBMC_PATH/package/ipmi-chassis-control/Config.in"
source "$BR2_EXTERNAL_bangBMC_PATH/package/ipmi-grpext-dcmi/Config.in"
source "$BR2_EXTERNAL_bangBMC_PATH/package/ipmi-hiomap-socket/Config.in"

endif

source "$BR2_EXTERNAL_raptor_blackbird_minimal_bmc_PATH/package/obmc-console/Config.in"
source "$BR2_EXTERNAL_bangBMC_PATH/package/obmc-console/Config.in"


+ 2211
- 0
board/bangBMC/blackbird.dts
File diff suppressed because it is too large
View File


+ 48
- 0
board/bangBMC/blackbird.its View File

@@ -0,0 +1,48 @@
/dts-v1/;

/ {
description = "Buildroot for Raptor/Blackbird/bmc";
images {
kernel@1 {
description = "kernel";
data = /incbin/("./zImage");
type = "kernel";
arch = "arm";
os = "linux";
compression = "none";
load = <0x80001000>;
entry = <0x80001000>;
hash@1 {
algo = "sha1";
};
};
fdt@1{
description = "blackbird.dtb";
data = /incbin/("./blackbird.dtb");
type = "flat_dt";
arch = "arm";
compression = "none";
hash@1 {
algo = "sha1";
};
};
ramdisk@1{
description = "Filesystem";
data = /incbin/("./rootfs.cpio.lzma");
type = "ramdisk";
arch = "arm";
compression = "lzma";
hash@1 {
algo = "sha1";
};
};
};
configurations {
default = "conf@1";
conf@1{
kernel = "kernel@1";
fdt = "fdt@1";
ramdisk = "ramdisk@1";
};
};
};

+ 1187
- 0
board/bangBMC/busybox.config
File diff suppressed because it is too large
View File


+ 36
- 0
board/bangBMC/fakeroot-fs.sh View File

@@ -0,0 +1,36 @@
#!/bin/sh

TARGET_DIR="$1"

TOPDIR=$(pwd)
IMAGES_DIR=${BASE_DIR}/images
BOARD_DIR=${BR2_EXTERNAL_bangBMC_PATH}/board/bangBMC
# the first argument is always a script specific buildroot dir
shift 1
. ${BOARD_DIR}/script-support.frag.sh


echo "disabling undesirable init scripts"

# TODO eventually we want to actually use the hwclock,
# so we should probably fix it instead of removing it.
blacklisted_init_scripts='netmount
hwclock
swap
keymaps
numlock
binfmt
termencoding
consolefont
save-keymaps
save-termencoding
net-online
staticroute
'

for drop in $(find ${TARGET_DIR}/etc/init.d ${TARGET_DIR}/etc/runlevels) ; do
bn=$(basename ${drop})
# if it's not in out list, ignore it
[ -z "$(echo ${blacklisted_init_scripts} | grep ${bn})" ] && continue
rm -v ${drop}
done

+ 280
- 0
board/bangBMC/linux-mod.config View File

@@ -0,0 +1,280 @@
CONFIG_LOCALVERSION="-551af99b5cadeeff8bb97b97b3afa82421b7eca0"
CONFIG_KERNEL_LZMA=y
# CONFIG_SWAP is not set
CONFIG_SYSVIPC=y
CONFIG_NO_HZ_IDLE=y
CONFIG_HIGH_RES_TIMERS=y
CONFIG_IKCONFIG=y
CONFIG_IKCONFIG_PROC=y
CONFIG_LOG_BUF_SHIFT=16
CONFIG_CGROUPS=y
CONFIG_NAMESPACES=y
CONFIG_USER_NS=y
CONFIG_BLK_DEV_INITRD=y
# CONFIG_RD_BZIP2 is not set
# CONFIG_RD_LZO is not set
# CONFIG_RD_LZ4 is not set
# CONFIG_UID16 is not set
# CONFIG_SYSFS_SYSCALL is not set
# CONFIG_AIO is not set
CONFIG_BPF_SYSCALL=y
CONFIG_EMBEDDED=y
CONFIG_PERF_EVENTS=y
# CONFIG_COMPAT_BRK is not set
CONFIG_SLAB=y
CONFIG_SLAB_FREELIST_RANDOM=y
CONFIG_ARCH_MULTI_V6=y
# CONFIG_ARCH_MULTI_V7 is not set
CONFIG_ARCH_ASPEED=y
CONFIG_MACH_ASPEED_G5=y
# CONFIG_CACHE_L2X0 is not set
CONFIG_VMSPLIT_2G=y
CONFIG_UACCESS_WITH_MEMCPY=y
CONFIG_SECCOMP=y
# CONFIG_ATAGS is not set
CONFIG_ZBOOT_ROM_TEXT=0x0
CONFIG_ZBOOT_ROM_BSS=0x0
CONFIG_KEXEC=y
# CONFIG_SUSPEND is not set
CONFIG_FIRMWARE_MEMMAP=y
CONFIG_JUMP_LABEL=y
CONFIG_STRICT_KERNEL_RWX=y
# CONFIG_LBDAF is not set
# CONFIG_BLK_DEV_BSG is not set
# CONFIG_BLK_DEBUG_FS is not set
# CONFIG_MQ_IOSCHED_DEADLINE is not set
# CONFIG_MQ_IOSCHED_KYBER is not set
# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
# CONFIG_COMPACTION is not set
CONFIG_NET=y
CONFIG_PACKET=y
CONFIG_PACKET_DIAG=y
CONFIG_UNIX=y
CONFIG_UNIX_DIAG=y
CONFIG_INET=y
CONFIG_IP_MULTICAST=y
CONFIG_IP_ADVANCED_ROUTER=y
CONFIG_IP_MULTIPLE_TABLES=y
CONFIG_IP_ROUTE_MULTIPATH=y
CONFIG_IP_ROUTE_VERBOSE=y
CONFIG_SYN_COOKIES=y
# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
# CONFIG_INET_XFRM_MODE_TUNNEL is not set
# CONFIG_INET_XFRM_MODE_BEET is not set
# CONFIG_INET_DIAG is not set
CONFIG_IPV6_ROUTER_PREF=y
CONFIG_IPV6_ROUTE_INFO=y
CONFIG_IPV6_OPTIMISTIC_DAD=y
# CONFIG_INET6_XFRM_MODE_TRANSPORT is not set
# CONFIG_INET6_XFRM_MODE_TUNNEL is not set
# CONFIG_INET6_XFRM_MODE_BEET is not set
CONFIG_IPV6_MULTIPLE_TABLES=y
CONFIG_NETFILTER=y
# CONFIG_NETFILTER_ADVANCED is not set
CONFIG_VLAN_8021Q=y
CONFIG_NET_NCSI=y
# CONFIG_WIRELESS is not set
CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
CONFIG_DEVTMPFS=y
CONFIG_DEVTMPFS_MOUNT=y
# CONFIG_PREVENT_FIRMWARE_BUILD is not set
CONFIG_MTD=y
CONFIG_MTD_BLOCK=y
CONFIG_MTD_PARTITIONED_MASTER=y
CONFIG_MTD_SPI_NOR=y
# CONFIG_MTD_SPI_NOR_USE_4K_SECTORS is not set
CONFIG_SPI_ASPEED_SMC=y
CONFIG_MTD_UBI=y
CONFIG_MTD_UBI_FASTMAP=y
CONFIG_MTD_UBI_BLOCK=y
CONFIG_BLK_DEV_LOOP=y
CONFIG_BLK_DEV_NBD=y
CONFIG_ASPEED_LPC_CTRL=y
CONFIG_ASPEED_LPC_SNOOP=y
CONFIG_ASPEED_LPC_MBOX=y
CONFIG_EEPROM_AT24=y
CONFIG_NETDEVICES=y
CONFIG_NETCONSOLE=y
CONFIG_VETH=y
# CONFIG_NET_VENDOR_ALACRITECH is not set
# CONFIG_NET_VENDOR_AMAZON is not set
# CONFIG_NET_VENDOR_AQUANTIA is not set
# CONFIG_NET_VENDOR_ARC is not set
# CONFIG_NET_VENDOR_BROADCOM is not set
# CONFIG_NET_VENDOR_CIRRUS is not set
# CONFIG_NET_VENDOR_CORTINA is not set
# CONFIG_NET_VENDOR_EZCHIP is not set
CONFIG_FTGMAC100=y
# CONFIG_NET_VENDOR_HISILICON is not set
# CONFIG_NET_VENDOR_HUAWEI is not set
# CONFIG_NET_VENDOR_INTEL is not set
# CONFIG_NET_VENDOR_MARVELL is not set
# CONFIG_NET_VENDOR_MELLANOX is not set
# CONFIG_NET_VENDOR_MICREL is not set
# CONFIG_NET_VENDOR_MICROSEMI is not set
# CONFIG_NET_VENDOR_NATSEMI is not set
# CONFIG_NET_VENDOR_NETRONOME is not set
# CONFIG_NET_VENDOR_NI is not set
# CONFIG_NET_VENDOR_QUALCOMM is not set
# CONFIG_NET_VENDOR_RENESAS is not set
# CONFIG_NET_VENDOR_ROCKER is not set
# CONFIG_NET_VENDOR_SAMSUNG is not set
# CONFIG_NET_VENDOR_SEEQ is not set
# CONFIG_NET_VENDOR_SOLARFLARE is not set
# CONFIG_NET_VENDOR_SMSC is not set
# CONFIG_NET_VENDOR_SOCIONEXT is not set
# CONFIG_NET_VENDOR_STMICRO is not set
# CONFIG_NET_VENDOR_SYNOPSYS is not set
# CONFIG_NET_VENDOR_VIA is not set
# CONFIG_NET_VENDOR_WIZNET is not set
CONFIG_BROADCOM_PHY=y
CONFIG_REALTEK_PHY=y
# CONFIG_USB_NET_DRIVERS is not set
# CONFIG_WLAN is not set
# CONFIG_INPUT_LEDS is not set
CONFIG_INPUT_EVDEV=y
# CONFIG_KEYBOARD_ATKBD is not set
CONFIG_KEYBOARD_GPIO=y
CONFIG_KEYBOARD_GPIO_POLLED=y
# CONFIG_INPUT_MOUSE is not set
# CONFIG_SERIO is not set
# CONFIG_VT is not set
# CONFIG_LEGACY_PTYS is not set
CONFIG_SERIAL_8250=y
# CONFIG_SERIAL_8250_DEPRECATED_OPTIONS is not set
CONFIG_SERIAL_8250_CONSOLE=y
CONFIG_SERIAL_8250_NR_UARTS=6
CONFIG_SERIAL_8250_RUNTIME_UARTS=6
CONFIG_SERIAL_8250_EXTENDED=y
CONFIG_SERIAL_8250_ASPEED_VUART=y
CONFIG_SERIAL_8250_SHARE_IRQ=y
CONFIG_SERIAL_OF_PLATFORM=y
CONFIG_ASPEED_KCS_IPMI_BMC=y
CONFIG_ASPEED_BT_IPMI_BMC=y
CONFIG_HW_RANDOM_TIMERIOMEM=y
# CONFIG_I2C_COMPAT is not set
CONFIG_I2C_CHARDEV=y
CONFIG_I2C_MUX_PCA9541=y
CONFIG_I2C_MUX_PCA954x=y
CONFIG_I2C_ASPEED=y
CONFIG_I2C_FSI=y
CONFIG_DEBUG_PINCTRL=y
CONFIG_GPIOLIB=y
CONFIG_GPIO_SYSFS=y
CONFIG_GPIO_ASPEED=y
CONFIG_W1=y
CONFIG_W1_MASTER_GPIO=y
CONFIG_W1_SLAVE_THERM=y
CONFIG_SENSORS_ASPEED=y
CONFIG_SENSORS_IIO_HWMON=y
CONFIG_SENSORS_LM75=y
CONFIG_SENSORS_NCT7904=y
CONFIG_SENSORS_OCC_P8_I2C=y
CONFIG_SENSORS_OCC_P9_SBE=y
CONFIG_PMBUS=y
CONFIG_SENSORS_ADM1275=y
CONFIG_SENSORS_IBM_CFFPS=y
CONFIG_SENSORS_IR35221=y
CONFIG_SENSORS_LM25066=y
CONFIG_SENSORS_MAX31785=y
CONFIG_SENSORS_UCD9000=y
CONFIG_SENSORS_UCD9200=y
CONFIG_SENSORS_TMP421=y
CONFIG_SENSORS_W83773G=y
CONFIG_WATCHDOG_SYSFS=y
CONFIG_MEDIA_SUPPORT=y
CONFIG_MEDIA_CAMERA_SUPPORT=y
CONFIG_V4L_PLATFORM_DRIVERS=y
CONFIG_VIDEO_ASPEED=y
CONFIG_DRM=y
CONFIG_DRM_ASPEED_GFX=y
CONFIG_USB=y
CONFIG_USB_ANNOUNCE_NEW_DEVICES=y
CONFIG_USB_DYNAMIC_MINORS=y
CONFIG_USB_EHCI_HCD=y
CONFIG_USB_EHCI_ROOT_HUB_TT=y
CONFIG_USB_EHCI_HCD_PLATFORM=y
CONFIG_USB_GADGET=y
CONFIG_USB_ASPEED_VHUB=y
CONFIG_USB_CONFIGFS=y
CONFIG_USB_CONFIGFS_MASS_STORAGE=y
CONFIG_USB_CONFIGFS_F_HID=y
CONFIG_USB_MASS_STORAGE=y
CONFIG_NEW_LEDS=y
CONFIG_LEDS_CLASS=y
CONFIG_LEDS_CLASS_FLASH=y
CONFIG_LEDS_GPIO=y
CONFIG_LEDS_PCA955X=y
CONFIG_LEDS_PCA955X_GPIO=y
CONFIG_LEDS_PWM=y
CONFIG_LEDS_TRIGGERS=y
CONFIG_LEDS_TRIGGER_TIMER=y
CONFIG_LEDS_TRIGGER_HEARTBEAT=y
CONFIG_LEDS_TRIGGER_DEFAULT_ON=y
CONFIG_RTC_CLASS=y
CONFIG_RTC_DRV_DS1307=y
CONFIG_RTC_DRV_PCF8523=y
CONFIG_RTC_DRV_RV8803=y
# CONFIG_VIRTIO_MENU is not set
# CONFIG_IOMMU_SUPPORT is not set
CONFIG_IIO=y
CONFIG_ASPEED_ADC=y
CONFIG_MAX1363=y
CONFIG_BMP280=y
CONFIG_DPS310=y
CONFIG_PWM=y
CONFIG_FSI=y
CONFIG_FSI_MASTER_GPIO=y
CONFIG_FSI_MASTER_HUB=y
CONFIG_FSI_MASTER_AST_CF=y
CONFIG_FSI_SCOM=y
CONFIG_FSI_SBEFIFO=y
CONFIG_FSI_OCC=y
CONFIG_FANOTIFY=y
CONFIG_FUSE_FS=y
CONFIG_CUSE=y
CONFIG_OVERLAY_FS=y
CONFIG_TMPFS=y
CONFIG_JFFS2_FS=y
# CONFIG_JFFS2_FS_WRITEBUFFER is not set
CONFIG_JFFS2_SUMMARY=y
CONFIG_JFFS2_FS_XATTR=y
CONFIG_UBIFS_FS=y
CONFIG_SQUASHFS=y
CONFIG_SQUASHFS_XZ=y
CONFIG_SQUASHFS_ZSTD=y
# CONFIG_NETWORK_FILESYSTEMS is not set
CONFIG_HARDENED_USERCOPY=y
CONFIG_FORTIFY_SOURCE=y
# CONFIG_CRYPTO_ECHAINIV is not set
CONFIG_CRYPTO_HMAC=y
CONFIG_CRYPTO_SHA256=y
CONFIG_CRYPTO_USER_API_HASH=y
# CONFIG_CRYPTO_HW is not set
# CONFIG_XZ_DEC_X86 is not set
# CONFIG_XZ_DEC_POWERPC is not set
# CONFIG_XZ_DEC_IA64 is not set
# CONFIG_XZ_DEC_SPARC is not set
CONFIG_PRINTK_TIME=y
CONFIG_DYNAMIC_DEBUG=y
CONFIG_DEBUG_INFO=y
CONFIG_DEBUG_INFO_REDUCED=y
CONFIG_DEBUG_INFO_DWARF4=y
CONFIG_GDB_SCRIPTS=y
CONFIG_STRIP_ASM_SYMS=y
CONFIG_SOFTLOCKUP_DETECTOR=y
# CONFIG_DETECT_HUNG_TASK is not set
CONFIG_WQ_WATCHDOG=y
CONFIG_PANIC_ON_OOPS=y
# CONFIG_SCHED_DEBUG is not set
CONFIG_SCHED_STACK_END_CHECK=y
CONFIG_FUNCTION_TRACER=y
CONFIG_FTRACE_SYSCALLS=y
# CONFIG_RUNTIME_TESTING_MENU is not set
CONFIG_DEBUG_WX=y
CONFIG_DEBUG_USER=y
CONFIG_DEBUG_LL=y
CONFIG_DEBUG_LL_UART_8250=y
CONFIG_DEBUG_UART_PHYS=0x1e784000
CONFIG_DEBUG_UART_VIRT=0xe8784000
CONFIG_EARLY_PRINTK=y

+ 0
- 0
View File


+ 0
- 0
View File


+ 33
- 0
board/bangBMC/overlay/etc/init.d/atx-gpio View File

@@ -0,0 +1,33 @@
#!/sbin/openrc-run
command=/usr/bin/atx-gpio
command_args=""
command_background=true
name="atx-gpio"
description="Toggles the gpio line to request ATX primary power on/off"
pidfile="/run/${RC_SVCNAME}.pid"

start_pre()
{
rm /var/run/atx-power-state &>/dev/null || true
}

start_post()
{
mkdir /var/run/atx-gpio
# This rbind will come undone if/when the process exits
# thus the /dev/ipl-state symlink will be invald, and there will
# no risk of it pointing to a process that may have taken it's pid
mount --rbind /proc/$(cat ${pidfile})/fd /var/run/atx-gpio
# scan through and find the memfd that's the ipl_status
for fd in $(ls /var/run/atx-gpio/ ) ; do
if [ "$(readlink /var/run/atx-gpio/${fd})" = "/memfd:atx-power-state (deleted)" ] ; then
ln -s /var/run/atx-gpio/${fd} /var/run/atx-power-state
break
fi
done
}

stop_post()
{
rm /var/run/atx-power-state &>/dev/null || true
}

+ 6
- 0
board/bangBMC/overlay/etc/init.d/dhcp.eth0 View File

@@ -0,0 +1,6 @@
#!/sbin/openrc-run
command=/sbin/udhcpc
name="udhcpc.eth0"
description="setup eth0 with an ip"
pidfile="/run/${RC_SVCNAME}.pid"
command_args=" -p \"${pidfile}\" -i eth0 -t 1 -b"

+ 11
- 0
board/bangBMC/overlay/etc/init.d/dropbear View File

@@ -0,0 +1,11 @@
#!/sbin/openrc-run
command=/usr/sbin/dropbear
command_args="-R"
name="dropbear"
description="dropbear ssh server"

depend() {
if [ -e ${command} ] ; then
provide ssh-virtual-server
fi
}

+ 72
- 0
board/bangBMC/overlay/etc/init.d/ipl-mon View File

@@ -0,0 +1,72 @@
#!/sbin/openrc-run
command=/usr/bin/ipl-mon
# we need the shell process to fork off
# without the '&' ipl-mon would block until the script
# was complete
command_args=" --fin-script 'host-ipl-complete &'"
command_background=true
name="ipl-mon"
description="Provides a cached IPL state indicator"
pidfile="/run/${RC_SVCNAME}.pid"


depend()
{
after atx-gpio
}

start_pre()
{
rm /dev/ipl-state &>/dev/null || true
}

start_post()
{
mkdir /var/run/ipl-mon
# This rbind will come undone if/when the process exits
# thus the /dev/ipl-state symlink will be invald, and there will
# no risk of it pointing to a process that may have taken it's pid
mount --rbind /proc/$(cat ${pidfile})/fd /var/run/ipl-mon
# scan through and find the memfd that's the ipl_status
for fd in $(ls /var/run/ipl-mon/ ) ; do
if [ "$(readlink /var/run/ipl-mon/${fd})" = "/memfd:ipl_status (deleted)" ] ; then
ln -s /var/run/ipl-mon/${fd} /dev/ipl-state
break
fi
done
# Pause for a moment, this gives the ipl-mon a chance to read any in
# progress updates from the host, and publish them.
usleep 250
# We just started up, if the system is marked as powered on,
# then we have some extra book keeping to do.
if [ "$(cat /var/run/atx-power-state)" = "1" ] ; then
einfo "Active ATX power detected at BMC boot time"
ipl_state=$(cat /dev/ipl-state)
# if the IPL state is init, that means that the host has not published
# an istep since we turned on, therefor it should already be finished,
# mark it as such.
if [ "${ipl_state}" = "00:00" ] ; then
einfo "Host appears booted, starting post-IPL services"
# Mark IPL as completed
echo "fe:fe" > /dev/ipl-state
# if the IPL finished before we started we ipl-mon never got the
# chance to kickoff the host-ipl-complete script, so do so now.
host-ipl-complete
# if we got an istep value already that means the host is IPL-ing
# right now.
# This is a tiny bit problematic because we probably own the fsi
# clock atm, so let's disable it (another script will re-enable)
# when ipl is finished.
# if ipl_state is not an empty string, then we know we have
# an istep.
elif [ $(echo ${ipl_state} | wc -c) -ge 5 ] ; then
echo -n 1 >/sys/devices/platform/gpio-fsi/external_mode
ewarn "IPL-ing host detected at BMC boot time. FSI shutdown for safty"
fi
fi
}

stop_post()
{
rm /dev/ipl-state &>/dev/null || true
}

+ 8
- 0
board/bangBMC/overlay/etc/init.d/ipmi-bt-miniroute View File

@@ -0,0 +1,8 @@
#!/sbin/openrc-run
command=/usr/bin/ipmi-bt-miniroute
command_args="/dev/ipmi-bt-host"
command_background=true
name="ipmi-bt-miniroute"
description="Provides trivial routing of ipmi packets (only to hiomapd atm)"
pidfile="/run/${RC_SVCNAME}.pid"


+ 7
- 0
board/bangBMC/overlay/etc/init.d/klogd View File

@@ -0,0 +1,7 @@
#!/sbin/openrc-run
command=/sbin/klogd
command_args=""
name="syslog"
description="provides kernel forwarding to syslog"
#pidfile="/run/${RC_SVCNAME}.pid"


+ 9
- 0
board/bangBMC/overlay/etc/init.d/mboxd View File

@@ -0,0 +1,9 @@
#!/sbin/openrc-run
command=/usr/sbin/mboxd
command_args="--flash 64M --window-size 1M"
command_background=true
# really should rename this binary
name="mboxd"
description="IBM's mboxd/hiomapd (Mod:!systemd !dbus)"

pidfile="/run/${RC_SVCNAME}.pid"

+ 137
- 0
board/bangBMC/overlay/etc/init.d/modules View File

@@ -0,0 +1,137 @@
#!/sbin/openrc-run
# Copyright (c) 2007-2015 The OpenRC Authors.
# See the Authors file at the top-level directory of this distribution and
# https://github.com/OpenRC/openrc/blob/master/AUTHORS
#
# This file is part of OpenRC. It is subject to the license terms in
# the LICENSE file found in the top-level directory of this
# distribution and at https://github.com/OpenRC/openrc/blob/master/LICENSE
# This file may not be copied, modified, propagated, or distributed
# except according to the terms contained in the LICENSE file.

description="Loads a user defined list of kernel modules."

depend()
{
use isapnp
provide modules-load
keyword -docker -lxc -openvz -prefix -systemd-nspawn -vserver
}

find_modfiles()
{
local dirs="/usr/lib/modules-load.d /run/modules-load.d /etc/modules-load.d"
local basenames files fn x y
for x in $dirs; do
[ ! -d $x ] && continue
for y in $x/*.conf; do
[ -f $y ] && basenames="${basenames}\n${y##*/}"
done
done
basenames=$(printf "$basenames" | sort -u)
for x in $basenames; do
for y in $dirs; do
[ -r $y/$x ] &&
fn=$y/$x
done
files="$files $fn"
done
echo $files
}

load_modules()
{
local file m modules rc x
file=$1
[ -z "$file" ] && return 0
while read m x; do
case $m in
\;*) continue ;;
\#*) continue ;;
*) modules="$modules $m"
;;
esac
done < $file
for x in $modules; do
ebegin "Loading module $x"
case "$RC_UNAME" in
FreeBSD) kldload "$x"; rc=$? ;;
Linux) modprobe "$x"; rc=$? ;;
*) ;;
esac
eend $rc "Failed to load $x"
done
return 0
}

modules_load_d()
{
local x
files=$(find_modfiles)
for x in $files; do
load_modules $x
done
return 0
}

FreeBSD_modules()
{
local cnt=0 x
for x in $modules; do
ebegin "Loading module $x"
kldload "$x"
eend $? "Failed to load $x" && : $(( cnt += 1 ))
done
einfo "Autoloaded $cnt module(s)"
}

Linux_modules()
{
# Should not fail if kernel does not have module
# support compiled in ...
[ ! -f /proc/modules ] && return 0

local KV x y kv_variant_list
KV=$(uname -r)
# full $KV
kv_variant_list="${KV}"
# remove any KV_EXTRA options to just get the full version
x=${KV%%-*}
# now slowly strip them
while [ -n "$x" ] && [ "$x" != "$y" ]; do
kv_variant_list="${kv_variant_list} $x"
y=$x
x=${x%.*}
done

local list= x= xx= y= args=
for x in $kv_variant_list ; do
eval list=\$modules_$(shell_var "$x")
[ -n "$list" ] && break
done
[ -z "$list" ] && list=$modules

[ -n "$list" ] && ebegin "Loading kernel modules"
for x in $list; do
xx=$(shell_var "$x")
for y in $kv_variant_list ; do
eval args=\$module_${xx}_args_$(shell_var "$y")
[ -n "${args}" ] && break
done
[ -z "$args" ] && eval args=\$module_${xx}_args
eval modprobe "$x" "$args"
done
[ -n "$list" ] && eend
}

start()
{
case "$RC_UNAME" in
FreeBSD|Linux)
modules_load_d
${RC_UNAME}_modules
;;
*) ;;
esac
return 0
}

+ 361
- 0
board/bangBMC/overlay/etc/init.d/network View File

@@ -0,0 +1,361 @@
#!/sbin/openrc-run
# Copyright (c) 2009-2015 The OpenRC Authors.
# See the Authors file at the top-level directory of this distribution and
# https://github.com/OpenRC/openrc/blob/master/AUTHORS
#
# This file is part of OpenRC. It is subject to the license terms in
# the LICENSE file found in the top-level directory of this
# distribution and at https://github.com/OpenRC/openrc/blob/master/LICENSE
# This file may not be copied, modified, propagated, or distributed
# except according to the terms contained in the LICENSE file.

# This script was inspired by the equivalent rc.d network from NetBSD.

description="Configures network interfaces."
__nl="
"

depend()
{
need localmount
after bootmisc clock
if [ -n "$(interfaces)" ]; then
provide net
fi
keyword -jail -prefix -vserver
}

uniqify()
{
local result= i=
for i; do
case " $result " in
*" $i "*);;
*) result="$result $i";;
esac
done
echo "${result# *}"
}

reverse()
{
local result= i=
for i; do
result="$i $result"
done
echo "${result# *}"
}

sys_interfaces()
{
case "$RC_UNAME" in
Linux)
local w= rest= i= cmd=$1
while read w rest; do
i=${w%%:*}
case "$i" in
"$w") continue ;;
lo|lo0) continue ;;
*) ;;
esac
if [ "$cmd" = u ]; then
ifconfig "$i" | grep -q "[ ]*UP" || continue
fi
printf "%s " "$i"
done </proc/net/dev
;;
*)
ifconfig -l$1
;;
esac
}

tentative()
{
local inet= address= rest=

case "$RC_UNAME" in
Linux)
[ -n "$(command -v ip)" ] || return 1
[ -n "$(ip -f inet6 addr show tentative)" ]
;;
*)
local inet= address= rest=
LC_ALL=C ifconfig -a | while read inet address rest; do
case "${inet}" in
inet6)
case "${rest}" in
*" "tentative*) return 2;;
esac
;;
esac
done
[ $? = 2 ]
;;
esac
}


auto_interfaces()
{
local ifs= c= f=

case "$RC_UNAME" in
NetBSD)
for c in $(ifconfig -C 2>/dev/null); do
for f in /etc/ifconfig.${c}[0-9]*; do
[ -f "$f" ] && printf "%s" "$f{##*.} "
done
done
;;
*)
for f in /etc/ifconfig.*; do
[ -f "$f" ] && printf "%s" "${f##*.} "
done
for f in /etc/ip.*; do
[ -f "$f" ] && printf "%s" "${f##*.} "
done
;;
esac
echo
}

interfaces()
{
uniqify $(ls /sys/class/net)
# $(sys_interfaces "$@") $interfaces $(auto_interfaces)
}

dumpargs()
{
local f="$1"

shift
case "$@" in
'') [ -f "$f" ] && cat "$f";;
*"$__nl"*) echo "$@";;
*)
(
set -o noglob
IFS=';'; set -- $@
IFS="$__nl"; echo "$*"
);;
esac
}

intup=false
runip()
{
local int="$1" err=
shift

# Ensure we have a valid broadcast address
case "$@" in
*" broadcast "*|*" brd "*) ;;
*:*) ;; # Ignore IPv6
*) set -- "$@" brd +;;
esac

err=$(LC_ALL=C ip address add "$@" dev "$int" 2>&1)
if [ -z "$err" ]; then
# ip does not bring up the interface when adding addresses
if ! $intup; then
ip link set "$int" up
intup=true
fi
return 0
fi
if [ "$err" = "RTNETLINK answers: File exists" ]; then
ip address del "$@" dev "$int" 2>/dev/null
fi
# Localise the error
ip address add "$@" dev "$int"
}

routeflush()
{
if [ "$RC_UNAME" = Linux ]; then
if [ -n "$(command -v ip)" ]; then
ip route flush scope global
ip route delete default 2>/dev/null
else
# Sadly we also delete some link routes, but
# this cannot be helped
local dest= gate= net= flags= rest=
route -n | while read dest gate net flags rest; do
[ -z "$net" ] && continue
case "$dest" in
[0-9]*) ;;
*) continue;;
esac
local xtra= netmask="netmask $net"
case "$flags" in
U) continue;;
*H*) flags=-host; netmask=;;
*!*) flags=-net; xtra=reject;;
*) flags=-net;;
esac
route del $flags $dest $netmask $xtra
done
# Erase any default dev eth0 routes
route del default 2>/dev/null
fi
else
route -qn flush
fi
}

runargs()
{
dumpargs "$@" | while read -r args; do
case "$args" in
''|"#"*) ;;
*)
(
eval vebegin "${args#*!}"
eval "${args#*!}"
veend $?
);;
esac
done
}

start()
{
local cr=0 r= int= intv= cmd= args= upcmd=

if [ -z "$domainname" -a -s /etc/defaultdomain ]; then
domainname=$(cat /etc/defaultdomain)
fi
if [ -n "$domainname" ]; then
ebegin "Setting NIS domainname: $domainname"
domainname "$domainname"
eend $?
fi

einfo "Starting network"
routeflush
eindent
for int in $(interfaces); do
local func= cf=
intv=$(shell_var "$int")
eval upcmd=\$ifup_$intv
for func in ip ifconfig; do
eval cmd=\$${func}_$intv
if [ -n "$cmd" -o -f /etc/"$func.$int" ]; then
cf=/etc/"$func.$int"
break
fi
done
[ -n "$cf" -o -n "$upcmd" -o \
-f /etc/ifup."$int" -o -f "$cf" ] || continue
veinfo "$int"
case "$func" in
ip) func=runip; intup=false;;
esac
eindent
runargs /etc/ifup."$int" "$upcmd"
r=0
dumpargs "$cf" "$cmd" | while read -r args; do
case "$args" in
''|"#"*) ;;
"!"*)
(
eval vebegin "${args#*!}"
eval "${args#*!}"
veend $?
);;
*)
(
set -o noglob
eval set -- "$args"
vebegin "$@"
$func "$int" "$@"
veend $?
);;
esac
done
eoutdent
done
eoutdent
eend $cr

# Wait for any inet6 tentative addresses
r=5
while [ $r -gt 0 ]; do
tentative || break
[ $r = 5 ] && vebegin "Waiting for tentative addresses"
sleep 1
: $(( r -= 1 ))
done
if [ $r != 5 ]; then
[ $r != 0 ]
veend $?
fi

if [ -n "$defaultroute" ]; then
ebegin "Setting default route $defaultroute"
route add default $defaultroute
eend $?
elif [ -n "$defaultiproute" ]; then
ebegin "Setting default route $defaultiproute"
ip route add default $defaultiproute
eend $?
fi

if [ -n "$defaultroute6" ]; then
ebegin "Setting default route $defaultroute6"
if [ "$RC_UNAME" = Linux ]; then
routecmd="route -A inet6 add"
else
routecmd="route -inet6 add"
fi
$routecmd default $defaultroute6
eend $?
elif [ -n "$defaultiproute6" ]; then
ebegin "Setting default route $defaultiproute6"
ip -f inet6 route add default $defaultiproute6
eend $?
fi

return 0
}

stop()
{
# Don't stop the network at shutdown.
# We don't use the noshutdown keyword so that we are started again
# correctly if we go back to multiuser.
yesno ${keep_network:-YES} && yesno $RC_GOINGDOWN && return 0

local int= intv= cmd= downcmd= r=
einfo "Stopping network"
routeflush
eindent
for int in $(reverse $(interfaces u)); do
case "$int" in
lo|lo0) continue ;;
*) ;;
esac
intv=$(shell_var "$int")
eval downcmd=\$ifdown_$intv
eval cmd=\$ip_$intv
[ -z "$cmd" ] && eval cmd=\$ifconfig_$intv
if [ -n "$cmd" -o -f /etc/ip."$int" -o \
-f /etc/ifconfig."$int" -o \
-n "$downcmd" -o -f /etc/ifdown."$int" ];
then
veinfo "$int"
runargs /etc/ifdown."$int" "$downcmd"
if [ -n "$(command -v ip)" ]; then
# We need to do this, otherwise we may
# fail to add things correctly on restart
ip address flush dev "$int" 2>/dev/null
fi
ifconfig "$int" down 2>/dev/null
ifconfig "$int" destroy 2>/dev/null
fi
done
eoutdent
eend 0
}

+ 12
- 0
board/bangBMC/overlay/etc/init.d/obmc-console View File

@@ -0,0 +1,12 @@
#!/sbin/openrc-run
command=/usr/sbin/obmc-console-server
command_args="--config /etc/obmc-console.conf ttyVUART0"
command_background=true
name="obmc-console-server"
description="Console forwaring from the P9 to the external serial"
pidfile="/run/${RC_SVCNAME}.pid"

depend() {
need udev
need udev-trigger
}

+ 9
- 0
board/bangBMC/overlay/etc/init.d/op-fan-daemon View File

@@ -0,0 +1,9 @@
#!/sbin/openrc-run
command=/usr/bin/op-fan-daemon
command_args=""
command_background=true
# really should rename this binary
name="op-fan-daemon"
description="Fan/pwm control daemon for Raptorcs Talos II/Blackbird OpenPower Boards"

pidfile="/run/${RC_SVCNAME}.pid"

+ 11
- 0
board/bangBMC/overlay/etc/init.d/power-button-gpio View File

@@ -0,0 +1,11 @@
#!/sbin/openrc-run
command=/usr/bin/power-button-gpio
command_args=" --on-cmd host-on-script \
--hard-off-cmd host-off-script \
--soft-off-cmd host-soft-off-script \
--state-file /var/run/atx-power-state"
command_background=true
name="power-button-gpio"
description="Monitors & dispatches power button events"
pidfile="/run/${RC_SVCNAME}.pid"


+ 26
- 0
board/bangBMC/overlay/etc/init.d/ssh-virtual View File

@@ -0,0 +1,26 @@
#!/sbin/openrc-run
# This service allow you to simply install
# dropbear OR openssh, and one of them will be started.
# This alivaties the need to much with config files if/when
# people switch
command=""
command_args=""
command_background=true
name="ssh-virtual"
description="ensures a ssh server is running"
pidfile="/run/${RC_SVCNAME}.pid"

depend()
{
need ssh-virtual-server
}

start()
{
return 0;
}

stop()
{
return 0
}

+ 91
- 0
board/bangBMC/overlay/etc/init.d/sshd View File

@@ -0,0 +1,91 @@
#!/sbin/openrc-run
# Copyright 1999-2019 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

extra_commands="checkconfig"
extra_started_commands="reload"

: ${SSHD_CONFDIR:=${RC_PREFIX%/}/etc/ssh}
: ${SSHD_CONFIG:=${SSHD_CONFDIR}/sshd_config}
: ${SSHD_PIDFILE:=${RC_PREFIX%/}/run/${SVCNAME}.pid}
: ${SSHD_BINARY:=${RC_PREFIX%/}/usr/sbin/sshd}
: ${SSHD_KEYGEN_BINARY:=${RC_PREFIX%/}/usr/bin/ssh-keygen}

command="${SSHD_BINARY}"
pidfile="${SSHD_PIDFILE}"
command_args="${SSHD_OPTS} -o PidFile=${pidfile} -f ${SSHD_CONFIG}"

# Wait one second (length chosen arbitrarily) to see if sshd actually
# creates a PID file, or if it crashes for some reason like not being
# able to bind to the address in ListenAddress (bug 617596).
#: ${SSHD_SSD_OPTS:=--wait 1000}
start_stop_daemon_args="${SSHD_SSD_OPTS}"

depend() {
if [ -e ${command} ] ; then
provide ssh-virtual-server
fi

# Entropy can be used by ssh-keygen, among other things, but
# is not strictly required (bug 470020).
use logger dns entropy
if [ "${rc_need+set}" = "set" ] ; then
: # Do nothing, the user has explicitly set rc_need
else
local x warn_addr
for x in $(awk '/^ListenAddress/{ print $2 }' "$SSHD_CONFIG" 2>/dev/null) ; do
case "${x}" in
0.0.0.0|0.0.0.0:*) ;;
::|\[::\]*) ;;
*) warn_addr="${warn_addr} ${x}" ;;
esac
done
if [ -n "${warn_addr}" ] ; then
need net
ewarn "You are binding an interface in ListenAddress statement in your sshd_config!"
ewarn "You must add rc_need=\"net.FOO\" to your ${RC_PREFIX%/}/etc/conf.d/sshd"
ewarn "where FOO is the interface(s) providing the following address(es):"
ewarn "${warn_addr}"
fi
fi
}

checkconfig() {
checkpath --mode 0755 --directory "${RC_PREFIX%/}/var/empty"

if [ ! -e "${SSHD_CONFIG}" ] ; then
eerror "You need an ${SSHD_CONFIG} file to run sshd"
eerror "There is a sample file in /usr/share/doc/openssh"
return 1
fi

${SSHD_KEYGEN_BINARY} -A || return 2

"${command}" -t ${command_args} || return 3
}

start_pre() {
# Make sure that the user's config isn't busted before we try
# to start the daemon (this will produce better error messages
# than if we just try to start it blindly).
#
# We always need to call checkconfig because this function will
# also generate any missing host key and you can start a
# non-running service with "restart" argument.
checkconfig || return $?
}

stop_pre() {
# If this is a restart, check to make sure the user's config
# isn't busted before we stop the running daemon.
if [ "${RC_CMD}" = "restart" ] ; then
checkconfig || return $?
fi
}

reload() {
checkconfig || return $?
ebegin "Reloading ${SVCNAME}"
start-stop-daemon --signal HUP --pidfile "${pidfile}"
eend $?
}

+ 7
- 0
board/bangBMC/overlay/etc/init.d/syslogd View File

@@ -0,0 +1,7 @@
#!/sbin/openrc-run
command=/sbin/syslogd
command_args=""
name="syslog"
description="provides syslod"
#pidfile="/run/${RC_SVCNAME}.pid"


+ 97
- 0
board/bangBMC/overlay/etc/init.d/udev View File

@@ -0,0 +1,97 @@
#!/sbin/openrc-run
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

command_args="${udev_opts}"
command_background=yes
pidfile=/run/udev.pid
description="udev manages device permissions and symbolic links in /dev"
extra_started_commands="reload"
description_reload="Reload the udev rules and databases"

depend()
{
need sysfs dev-mount
before checkfs fsck
keyword -lxc -systemd-nspawn -vserver
}

get_udevd_binary() {
local bins="/sbin/udevd /lib/systemd/systemd-udevd /usr/lib/systemd/systemd-udevd"
for f in ${bins}; do
if [ -x "$f" -a ! -L "$f" ]; then
command="$f"
fi
done
if [ -z "$command" ]; then
eerror "Unable to find udev executable."
return 1
fi
}

start_pre()
{
# make sure devtmpfs is in the kernel
if ! grep -qs devtmpfs /proc/filesystems; then
eerror "CONFIG_DEVTMPFS=y is required in your kernel configuration"
eerror "for this version of udev to run successfully."
eerror "This requires immediate attention."
if ! mountinfo -q /dev; then
mount -n -t tmpfs dev /dev
busybox mdev -s
mkdir /dev/pts
fi
return 1
fi

# make sure /dev is a mounted devtmpfs
if ! mountinfo -q -f devtmpfs /dev; then
eerror "Udev requires /dev to be a mounted devtmpfs."
eerror "Please reconfigure your system."
return 1
fi

# load unix domain sockets if built as module, Bug #221253
# and not yet loaded, Bug #363549
if [ ! -e /proc/net/unix ]; then
if ! modprobe unix; then
eerror "Cannot load the unix domain socket module"
return 1
fi
fi

get_udevd_binary || return 1

if [ -e /proc/sys/kernel/hotplug ]; then
echo "" >/proc/sys/kernel/hotplug
fi

if yesno "${udev_debug:-NO}"; then
command_args="${command_args} --debug 2> /run/udevdebug.log"
fi

return 0
}

stop()
{
local rc=0
ebegin "Stopping ${name:-$RC_SVCNAME}"
udevadm control --exit
rc=$?
if [ $rc -ne 0 ]; then
eend $rc "Failed to stop $RC_SVCNAME using udevadm"
ebegin "Trying with start-stop-daemon"
start-stop-daemon --stop --pidfile "${pidfile}"
rc=$?
fi
[ $rc -eq 0 ] && rm -f "${pidfile}"
eend $rc "Failed to stop $RC_SVCNAME"
}

reload()
{
ebegin "reloading udev rules and databases"
udevadm control --reload
eend $?
}

+ 19
- 0
board/bangBMC/overlay/etc/init.d/udev-settle View File

@@ -0,0 +1,19 @@
#!/sbin/openrc-run
# Copyright 2014 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

depend()
{
need udev
after udev-trigger
provide dev-settle
keyword -lxc -systemd-nspawn -vserver
}

start()
{
ebegin "Waiting for uevents to be processed"
udevadm settle \
${udev_settle_timeout:+--timeout=}$udev_settle_timeout
eend $?
}

+ 96
- 0
board/bangBMC/overlay/etc/init.d/udev-trigger View File

@@ -0,0 +1,96 @@
#!/sbin/openrc-run
# Copyright 2014 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

description="udev Coldplug all Devices"

udevmonitor_log=/run/udevmonitor.log
udevmonitor_pid=/run/udevmonitor.pid

depend()
{
need udev
provide dev
keyword -lxc -systemd-nspawn -vserver
}

start_pre()
{
if yesno "${udev_monitor:-no}"; then
einfo "Running udevadm monitor ${udev_monitor_opts} to log all events"
start-stop-daemon --start --stdout "${udevmonitor_log}" \
--make-pidfile --pidfile "${udevmonitor_pid}" \
--background --exec /bin/udevadm -- monitor ${udev_monitor_opts}
fi
return 0
}

display_hotplugged_services()
{
local svcfile= svc= services=
for svcfile in "${RC_SVCDIR}"/hotplugged/*; do
svc="${svcfile##*/}"
[ -x "${svcfile}" ] || continue

services="${services} ${svc}"
done
[ -n "${services}" ] && einfo "Device initiated services:${HILITE}${services}${NORMAL}"
return 0
}

start_post()
{
if yesno "${udev_monitor:-no}"; then
if yesno "${udev_monitor_keep_running:-no}"; then
ewarn "udevmonitor is still writing into ${udevmonitor_log}"
else
einfo "Stopping udevmonitor: Log is in ${udevmonitor_log}"
start-stop-daemon --stop --pidfile "${udevmonitor_pid}" \
--exec /bin/udevadm
fi
fi
display_hotplugged_services
return 0
}

# This is here because some software expects /dev/root to exist.
# For more information, see this bug:
# https://bugs.gentoo.org/show_bug.cgi?id=438380
dev_root_link()
{
local RULESDIR=/run/udev/rules.d
[ -d $RULESDIR ] || mkdir -p $RULESDIR
eval $(udevadm info --export --export-prefix=ROOT_ --device-id-of-file=/ ||
true)
[ "$ROOT_MAJOR" -a "$ROOT_MINOR" ] || return 0

# btrfs filesystems have bogus major/minor numbers
[ "$ROOT_MAJOR" != 0 ] || return 0

echo 'ACTION=="add|change", SUBSYSTEM=="block", ENV{MAJOR}=="'$ROOT_MAJOR'", ENV{MINOR}=="'$ROOT_MINOR'", SYMLINK+="root"' > $RULESDIR/61-dev-root-link.rules
return 0
}

start()
{
if yesno ${rc_dev_root_symlink:-yes}; then
ebegin "Generating a rule to create a /dev/root symlink"
dev_root_link
eend $?
fi

get_bootparam "nocoldplug" && rc_coldplug="no"
if ! yesno ${rc_coldplug:-${RC_COLDPLUG:-yes}}; then
einfo "Setting /dev permissions and symbolic links"
udevadm trigger --attr-match=dev --action=add
udevadm trigger --subsystem-match=net --action=add
rc=$?
ewarn "Skipping udev coldplug sequence"
return $rc
fi

ebegin "Populating /dev with existing devices through uevents"
udevadm trigger --type=subsystems --action=add
udevadm trigger --type=devices --action=add
eend $?
}

+ 23
- 0
board/bangBMC/overlay/etc/inittab View File

@@ -0,0 +1,23 @@
# hybrid inittab for using sysvinit/busybox init
# with openrc rc controll

# mount all the common things.
# openrc might have mount services for this
# however busybox's support for openrc is not complete yet,
# so just do it here for now
#::sysinit:/bin/mount -t proc proc /proc
::sysinit:/bin/mount -o remount,rw /
::sysinit:/bin/mkdir -p /dev/pts /dev/shm
::sysinit:/bin/mount -a

::sysinit:/sbin/openrc sysinit
::sysinit:/sbin/openrc boot
::sysinit:/sbin/openrc default


# Launch a getty on ttyS4
# openrc (a)getty controll is a bit more complex (and flexible)
# but lets just put this one-liner here
ttyS4::respawn:/sbin/getty -L ttyS4 115200 xterm

::shutdown:/sbin/openrc shutdown

+ 4
- 0
board/bangBMC/overlay/etc/obmc-console.conf View File

@@ -0,0 +1,4 @@
lpc-address = 0x3f8
sirq = 4
local-tty = ttyS0
local-tty-baud = 115200

+ 314
- 0
board/bangBMC/overlay/etc/rc.conf View File

@@ -0,0 +1,314 @@
# Global OpenRC configuration settings

# Set to "YES" if you want the rc system to try and start services
# in parallel for a slight speed improvement. When running in parallel we
# prefix the service output with its name as the output will get
# jumbled up.
# WARNING: whilst we have improved parallel, it can still potentially lock
# the boot process. Don't file bugs about this unless you can supply
# patches that fix it without breaking other things!
rc_parallel="YES"

# Set rc_interactive to "YES" and you'll be able to press the I key during
# boot so you can choose to start specific services. Set to "NO" to disable
# this feature. This feature is automatically disabled if rc_parallel is
# set to YES.
#rc_interactive="YES"

# If we need to drop to a shell, you can specify it here.
# If not specified we use $SHELL, otherwise the one specified in /etc/passwd,
# otherwise /bin/sh
# Linux users could specify /sbin/sulogin
#rc_shell=/bin/sh

# Do we allow any started service in the runlevel to satisfy the dependency
# or do we want all of them regardless of state? For example, if net.eth0
# and net.eth1 are in the default runlevel then with rc_depend_strict="NO"
# both will be started, but services that depend on 'net' will work if either
# one comes up. With rc_depend_strict="YES" we would require them both to
# come up.
#rc_depend_strict="YES"

# rc_hotplug controls which services we allow to be hotplugged.
# A hotplugged service is one started by a dynamic dev manager when a matching
# hardware device is found.
# Hotplugged services appear in the "hotplugged" runlevel.
# If rc_hotplug is set to any value, we compare the name of this service
# to every pattern in the value, from left to right, and we allow the
# service to be hotplugged if it matches a pattern, or if it matches no
# patterns. Patterns can include shell wildcards.
# To disable services from being hotplugged, prefix patterns with "!".
#If rc_hotplug is not set or is empty, all hotplugging is disabled.
# Example - rc_hotplug="net.wlan !net.*"
# This allows net.wlan and any service not matching net.* to be hotplugged.
# Example - rc_hotplug="!net.*"
# This allows services that do not match "net.*" to be hotplugged.

# rc_logger launches a logging daemon to log the entire rc process to
# /var/log/rc.log
# NOTE: Linux systems require the devfs service to be started before
# logging can take place and as such cannot log the sysinit runlevel.
#rc_logger="NO"

# Through rc_log_path you can specify a custom log file.
# The default value is: /var/log/rc.log
#rc_log_path="/var/log/rc.log"

# If you want verbose output for OpenRC, set this to yes. If you want
# verbose output for service foo only, set it to yes in /etc/conf.d/foo.
#rc_verbose=no

# By default we filter the environment for our running scripts. To allow other
# variables through, add them here. Use a * to allow all variables through.
#rc_env_allow="VAR1 VAR2"

# By default we assume that all daemons will start correctly.
# However, some do not - a classic example is that they fork and return 0 AND
# then child barfs on a configuration error. Or the daemon has a bug and the
# child crashes. You can set the number of milliseconds start-stop-daemon
# waits to check that the daemon is still running after starting here.
# The default is 0 - no checking.
#rc_start_wait=100

# rc_nostop is a list of services which will not stop when changing runlevels.
# This still allows the service itself to be stopped when called directly.
#rc_nostop=""

# rc will attempt to start crashed services by default.
# However, it will not stop them by default as that could bring down other
# critical services.
#rc_crashed_stop=NO
#rc_crashed_start=YES

# Set rc_nocolor to yes if you do not want colors displayed in OpenRC
# output.
#rc_nocolor=NO

##############################################################################
# MISC CONFIGURATION VARIABLES
# There variables are shared between many init scripts

# Set unicode to YES to turn on unicode support for keyboards and screens.
#unicode="NO"

# This is how long fuser should wait for a remote server to respond. The
# default is 60 seconds, but it can be adjusted here.
#rc_fuser_timeout=60

# Below is the default list of network fstypes.
#
# afs ceph cifs coda davfs fuse fuse.sshfs gfs glusterfs lustre ncpfs
# nfs nfs4 ocfs2 shfs smbfs
#
# If you would like to add to this list, you can do so by adding your
# own fstypes to the following variable.
#extra_net_fs_list=""

##############################################################################
# SERVICE CONFIGURATION VARIABLES
# These variables are documented here, but should be configured in
# /etc/conf.d/foo for service foo and NOT enabled here unless you
# really want them to work on a global basis.
# If your service has characters in its name which are not legal in
# shell variable names and you configure the variables for it in this
# file, those characters should be replaced with underscores in the
# variable names as shown below.

# Some daemons are started and stopped via start-stop-daemon.
# We can set some things on a per service basis, like the nicelevel.
#SSD_NICELEVEL="-19"
# Or the ionice level. The format is class[:data] , just like the
# --ionice start-stop-daemon parameter.
#SSD_IONICELEVEL="2:2"

# Pass ulimit parameters
# If you are using bash in POSIX mode for your shell, note that the
# ulimit command uses a block size of 512 bytes for the -c and -f
# options
#rc_ulimit="-u 30"

# It's possible to define extra dependencies for services like so
#rc_config="/etc/foo"
#rc_need="openvpn"
#rc_use="net.eth0"
#rc_after="clock"
#rc_before="local"
#rc_provide="!net"

# You can also enable the above commands here for each service. Below is an
# example for service foo.
#rc_foo_config="/etc/foo"
#rc_foo_need="openvpn"
#rc_foo_after="clock"

# Below is an example for service foo-bar. Note that the '-' is illegal
# in a shell variable name, so we convert it to an underscore.
# example for service foo-bar.
#rc_foo_bar_config="/etc/foo-bar"
#rc_foo_bar_need="openvpn"
#rc_foo_bar_after="clock"

# You can also remove dependencies.
# This is mainly used for saying which services do NOT provide net.
#rc_net_tap0_provide="!net"

# This is the subsystem type.
# It is used to match against keywords set by the keyword call in the
# depend function of service scripts.
#
# It should be set to the value representing the environment this file is
# PRESENTLY in, not the virtualization the environment is capable of.
# If it is commented out, automatic detection will be used.
#
# The list below shows all possible settings as well as the host
# operating systems where they can be used and autodetected.
#
# "" - nothing special
# "docker" - Docker container manager (Linux)
# "jail" - Jail (DragonflyBSD or FreeBSD)
# "lxc" - Linux Containers
# "openvz" - Linux OpenVZ
# "prefix" - Prefix
# "rkt" - CoreOS container management system (Linux)
# "subhurd" - Hurd subhurds (to be checked)
# "systemd-nspawn" - Container created by systemd-nspawn (Linux)
# "uml" - Usermode Linux
# "vserver" - Linux vserver
# "xen0" - Xen0 Domain (Linux and NetBSD)
# "xenU" - XenU Domain (Linux and NetBSD)
#rc_sys=""

# if you use openrc-init, which is currently only available on Linux,
# this is the default runlevel to activate after "sysinit" and "boot"
# when booting.
#rc_default_runlevel="default"

# on Linux and Hurd, this is the number of ttys allocated for logins
# It is used in the consolefont, keymaps, numlock and termencoding
# service scripts.
rc_tty_number=12

##############################################################################
# LINUX CGROUPS RESOURCE MANAGEMENT

# This sets the mode used to mount cgroups.
# "hybrid" mounts cgroups version 2 on /sys/fs/cgroup/unified and
# cgroups version 1 on /sys/fs/cgroup.
# "legacy" mounts cgroups version 1 on /sys/fs/cgroup
# "unified" mounts cgroups version 2 on /sys/fs/cgroup
#rc_cgroup_mode="hybrid"

# This is a list of controllers which should be enabled for cgroups version 2.
# If hybrid mode is being used, controllers listed here will not be
# available for cgroups version 1.
# This is a global setting.
#rc_cgroup_controllers=""

# This variable contains the cgroups version 2 settings for your services.
# If this is set in this file, the settings will apply to all services.
# If you want different settings for each service, place the settings in
# /etc/conf.d/foo for service foo.
# The format is to specify the setting and value followed by a newline.
# Multiple settings and values can be specified.
# For example, you would use this to set the maximum memory and maximum
# number of pids for a service.
#rc_cgroup_settings="
#memory.max 10485760
#pids.max max
#"
#
# For more information about the adjustments that can be made with
# cgroups version 2, see Documentation/cgroups-v2.txt in the linux kernel
# source tree.
#rc_cgroup_settings=""

# This switch controls whether or not cgroups version 1 controllers are
# individually mounted under
# /sys/fs/cgroup in hybrid or legacy mode.
#rc_controller_cgroups="YES"

# The following setting turns on the memory.use_hierarchy setting in the
# root memory cgroup for cgroups v1.
# It must be set to yes in this file if you want this functionality.
#rc_cgroup_memory_use_hierarchy="NO"

# The following settings allow you to set up values for the cgroups version 1
# controllers for your services.
# They can be set in this file;, however, if you do this, the settings
# will apply to all of your services.
# If you want different settings for each service, place the settings in
# /etc/conf.d/foo for service foo.
# The format is to specify the names of the settings followed by their
# values. Each variable can hold multiple settings.
# For example, you would use this to set the cpu.shares setting in the
# cpu controller to 512 for your service.
# rc_cgroup_cpu="
# cpu.shares 512
# "
#
# For more information about the adjustments that can be made with
# cgroups version 1, see Documentation/cgroups-v1/* in the linux kernel
# source tree.

# Set the blkio controller settings for this service.
#rc_cgroup_blkio=""

# Set the cpu controller settings for this service.
#rc_cgroup_cpu=""

# Add this service to the cpuacct controller (any value means yes).
#rc_cgroup_cpuacct=""

# Set the cpuset controller settings for this service.
#rc_cgroup_cpuset=""

# Set the devices controller settings for this service.
#rc_cgroup_devices=""

# Set the hugetlb controller settings for this service.
#rc_cgroup_hugetlb=""

# Set the memory controller settings for this service.
#rc_cgroup_memory=""

# Set the net_cls controller settings for this service.
#rc_cgroup_net_cls=""

# Set the net_prio controller settings for this service.
#rc_cgroup_net_prio=""

# Set the pids controller settings for this service.
#rc_cgroup_pids=""

# Set this to YES if you want all of the processes in a service's cgroup
# killed when the service is stopped or restarted.
# Be aware that setting this to yes means all of a service's
# child processes will be killed. Keep this in mind if you set this to
# yes here instead of for the individual services in
# /etc/conf.d/<service>.
# To perform this cleanup manually for a stopped service, you can
# execute cgroup_cleanup with /etc/init.d/<service> cgroup_cleanup or
# rc-service <service> cgroup_cleanup.
# The process followed in this cleanup is the following:
# 1. send stopsig (sigterm if it isn't set) to all processes left in the
# cgroup immediately followed by sigcont.
# 2. Send sighup to all processes in the cgroup if rc_send_sighup is
# yes.
# 3. delay for rc_timeout_stopsec seconds.
# 4. send sigkill to all processes in the cgroup unless disabled by
# setting rc_send_sigkill to no.
# rc_cgroup_cleanup="NO"

# If this is yes, we will send sighup to the processes in the cgroup
# immediately after stopsig and sigcont.
#rc_send_sighup="NO"

# This is the amount of time in seconds that we delay after sending sigcont
# and optionally sighup, before we optionally send sigkill to all
# processes in the # cgroup.
# The default is 90 seconds.
#rc_timeout_stopsec="90"

# If this is set to no, we do not send sigkill to all processes in the
# cgroup.
#rc_send_sigkill="YES"

+ 1
- 0
board/bangBMC/overlay/etc/runlevels/default/atx-gpio View File

@@ -0,0 +1 @@
../../init.d/atx-gpio

+ 1
- 0
board/bangBMC/overlay/etc/runlevels/default/dropbear View File

@@ -0,0 +1 @@
../../init.d/dropbear

+ 1
- 0
board/bangBMC/overlay/etc/runlevels/default/ipl-mon View File

@@ -0,0 +1 @@
../../init.d/ipl-mon

+ 1
- 0
board/bangBMC/overlay/etc/runlevels/default/ipmi-bt-miniroute View File

@@ -0,0 +1 @@
../../init.d/ipmi-bt-miniroute

+ 1
- 0
board/bangBMC/overlay/etc/runlevels/default/mboxd View File

@@ -0,0 +1 @@
../../init.d/mboxd

+ 1
- 0
board/bangBMC/overlay/etc/runlevels/default/op-fan-daemon View File

@@ -0,0 +1 @@
../../init.d/op-fan-daemon

+ 1
- 0
board/bangBMC/overlay/etc/runlevels/default/power-button-gpio View File

@@ -0,0 +1 @@
../../init.d/power-button-gpio

+ 1
- 0
board/bangBMC/overlay/etc/runlevels/default/ssh-virtual View File

@@ -0,0 +1 @@
../../init.d/ssh-virtual

+ 1
- 0
board/bangBMC/overlay/etc/runlevels/sysinit/dhcp.eth0 View File

@@ -0,0 +1 @@
../../init.d/dhcp.eth0

+ 1
- 0
board/bangBMC/overlay/etc/runlevels/sysinit/klogd View File

@@ -0,0 +1 @@
../../init.d/klogd

+ 1
- 0
board/bangBMC/overlay/etc/runlevels/sysinit/obmc-console View File

@@ -0,0 +1 @@
../../init.d/obmc-console

+ 1
- 0
board/bangBMC/overlay/etc/runlevels/sysinit/syslogd View File

@@ -0,0 +1 @@
../../init.d/syslogd

+ 1
- 0
board/bangBMC/overlay/etc/runlevels/sysinit/udev View File

@@ -0,0 +1 @@
../../init.d/udev

+ 1
- 0
board/bangBMC/overlay/etc/runlevels/sysinit/udev-trigger View File

@@ -0,0 +1 @@
../../init.d/udev-trigger

+ 1
- 0
board/bangBMC/overlay/etc/udev/rules.d/61-aspeed-vuart.rules View File

@@ -0,0 +1 @@
SUBSYSTEM=="tty", ATTRS{iomem_base}=="0x1E787000", SYMLINK+="ttyVUART0"

+ 4
- 0
board/bangBMC/overlay/init View File

@@ -0,0 +1,4 @@
#!/bin/sh
echo "Initrd"
export TERM=xterm
exec busybox init

+ 0
- 0
View File


BIN
View File


+ 3
- 0
board/bangBMC/overlay/new.run View File

@@ -0,0 +1,3 @@
echo "Nyaa!!!"
echo "This doesn't do anything!"
exec busybox init

+ 34
- 0
board/bangBMC/overlay/usr/alt-bin/avsbus-disable.sh View File

@@ -0,0 +1,34 @@
#!/bin/sh

# Get CPU count
CPU_COUNT=1
STATUS_FLAGS=$(i2cget -y 12 0x31 0x7)
if [ $? != 0 ]; then
STATUS_FLAGS=$(i2cget -y 12 0x31 0x7)
fi
if [ $? != 0 ]; then
STATUS_FLAGS=$(i2cget -y 12 0x31 0x7)
fi
CPU_PRESENT_FLAG_N=$(( ${STATUS_FLAGS} & 0x20 ))
if [ $CPU_PRESENT_FLAG_N != 0 ]; then
CPU_COUNT=$(( ${CPU_COUNT} + 1 ))
fi
echo "Found $CPU_COUNT CPU(s)"

i2cset -y 4 0x70 0x00 0x00 b # VDD 0 - PAGE set
i2cset -y 4 0x70 0x01 0x80 b # VDD 0
i2cset -y 4 0x70 0x00 0x01 b # VCS 0 - PAGE set
i2cset -y 4 0x70 0x01 0x80 b # VCS 0
i2cset -y 4 0x70 0x00 0x00 b # VCS 0 - PAGE reset
i2cset -y 4 0x73 0x00 0x00 b # VDN 0 - PAGE set
i2cset -y 4 0x73 0x01 0x80 b # VDN 0

if [ $CPU_COUNT -gt 1 ]; then
i2cset -y 5 0x70 0x00 0x00 b # VDD 1 - PAGE set
i2cset -y 5 0x70 0x01 0x80 b # VDD 1
i2cset -y 5 0x70 0x00 0x01 b # VCS 1 - PAGE set
i2cset -y 5 0x70 0x01 0x80 b # VCS 1
i2cset -y 5 0x70 0x00 0x00 b # VCS 1 - PAGE reset
i2cset -y 5 0x73 0x00 0x00 b # VDN 1 - PAGE set
i2cset -y 5 0x73 0x01 0x80 b # VDN 1
fi

+ 34
- 0
board/bangBMC/overlay/usr/alt-bin/avsbus-enable.sh View File

@@ -0,0 +1,34 @@
#!/bin/sh

# Get CPU count
CPU_COUNT=1
STATUS_FLAGS=$(i2cget -y 12 0x31 0x7)
if [ $? != 0 ]; then
STATUS_FLAGS=$(i2cget -y 12 0x31 0x7)
fi
if [ $? != 0 ]; then
STATUS_FLAGS=$(i2cget -y 12 0x31 0x7)
fi
CPU_PRESENT_FLAG_N=$(( ${STATUS_FLAGS} & 0x20 ))
if [ $CPU_PRESENT_FLAG_N != 0 ]; then
CPU_COUNT=$(( ${CPU_COUNT} + 1 ))
fi
echo "Found $CPU_COUNT CPU(s)"

i2cset -y 4 0x70 0x00 0x00 b # VDD 0 - PAGE set
i2cset -y 4 0x70 0x01 0xB0 b # VDD 0
i2cset -y 4 0x70 0x00 0x01 b # VCS 0 - PAGE set
i2cset -y 4 0x70 0x01 0xB0 b # VCS 0
i2cset -y 4 0x70 0x00 0x00 b # VCS 0 - PAGE reset
i2cset -y 4 0x73 0x00 0x00 b # VDN 0 - PAGE set
i2cset -y 4 0x73 0x01 0xB0 b # VDN 0

if [ $CPU_COUNT -gt 1 ]; then
i2cset -y 5 0x70 0x00 0x00 b # VDD 1 - PAGE set
i2cset -y 5 0x70 0x01 0xB0 b # VDD 1
i2cset -y 5 0x70 0x00 0x01 b # VCS 1 - PAGE set
i2cset -y 5 0x70 0x01 0xB0 b # VCS 1
i2cset -y 5 0x70 0x00 0x00 b # VCS 1 - PAGE reset
i2cset -y 5 0x73 0x00 0x00 b # VDN 1 - PAGE set
i2cset -y 5 0x73 0x01 0xB0 b # VDN 1
fi

+ 23
- 0
board/bangBMC/overlay/usr/alt-bin/avsbus-workaround.sh View File

@@ -0,0 +1,23 @@
#!/bin/sh

# Get CPU count
CPU_COUNT=1
STATUS_FLAGS=$(i2cget -y 12 0x31 0x7)
if [ $? != 0 ]; then
STATUS_FLAGS=$(i2cget -y 12 0x31 0x7)
fi
if [ $? != 0 ]; then
STATUS_FLAGS=$(i2cget -y 12 0x31 0x7)
fi
CPU_PRESENT_FLAG_N=$(( ${STATUS_FLAGS} & 0x20 ))
if [ $CPU_PRESENT_FLAG_N != 0 ]; then
CPU_COUNT=$(( ${CPU_COUNT} + 1 ))
fi
echo "Found $CPU_COUNT CPU(s)"

i2cset -y 4 0x28 0x2E 0x23 b # VDD/VCS 0
i2cset -y 4 0x2B 0x2E 0x23 b # VDN 0
if [ $CPU_COUNT -gt 1 ]; then
i2cset -y 5 0x28 0x2E 0x23 b # VDD/VCS 1
i2cset -y 5 0x2B 0x2E 0x23 b # VDN 1
fi

+ 135
- 0
board/bangBMC/overlay/usr/alt-bin/create_usbhid.sh View File

@@ -0,0 +1,135 @@
#!/bin/sh

new_directory="/sys/kernel/config/usb_gadget/obmc_hid"

if [ -e "${new_directory}" ]; then
exit 0
fi

# create gadget
original_directory="$(pwd)"
mkdir "${new_directory}"
cd "${new_directory}"

# add basic information
echo 0x0100 > bcdDevice
echo 0x0200 > bcdUSB
echo 0x0104 > idProduct # Multifunction Composite Gadget
echo 0x1d6b > idVendor # Linux Foundation

# create English locale
mkdir strings/0x409

echo "OpenBMC" > strings/0x409/manufacturer
echo "virtual_input" > strings/0x409/product
echo "OBMC0001" > strings/0x409/serialnumber

# Create HID keyboard function
mkdir functions/hid.0

echo 1 > functions/hid.0/protocol # 1: keyboard
echo 8 > functions/hid.0/report_length
echo 1 > functions/hid.0/subclass

# Binary HID keyboard descriptor
# 0x05, 0x01, // USAGE_PAGE (Generic Desktop)
# 0x09, 0x06, // USAGE (Keyboard)
# 0xa1, 0x01, // COLLECTION (Application)
# 0x05, 0x07, // USAGE_PAGE (Keyboard)
# 0x19, 0xe0, // USAGE_MINIMUM (Keyboard LeftControl)
# 0x29, 0xe7, // USAGE_MAXIMUM (Keyboard Right GUI)
# 0x15, 0x00, // LOGICAL_MINIMUM (0)
# 0x25, 0x01, // LOGICAL_MAXIMUM (1)
# 0x75, 0x01, // REPORT_SIZE (1)
# 0x95, 0x08, // REPORT_COUNT (8)
# 0x81, 0x02, // INPUT (Data,Var,Abs)
# 0x95, 0x01, // REPORT_COUNT (1)
# 0x75, 0x08, // REPORT_SIZE (8)
# 0x81, 0x03, // INPUT (Data,Var,Abs)
# 0x95, 0x05, // REPORT_COUNT (5)
# 0x75, 0x01, // REPORT_SIZE (1)
# 0x05, 0x08, // USAGE_PAGE (LEDs)
# 0x19, 0x01, // USAGE_MINIMUM (Num Lock)
# 0x29, 0x05, // USAGE_MAXIMUM (Kana)
# 0x91, 0x02, // OUTPUT (Data,Var,Abs)
# 0x95, 0x01, // REPORT_COUNT (1)
# 0x75, 0x03, // REPORT_SIZE (3)
# 0x91, 0x03, // OUTPUT (Cnst,Var,Abs)
# 0x95, 0x06, // REPORT_COUNT (6)
# 0x75, 0x08, // REPORT_SIZE (8)
# 0x15, 0x00, // LOGICAL_MINIMUM (0)
# 0x25, 0x65, // LOGICAL_MAXIMUM (101)
# 0x05, 0x07, // USAGE_PAGE (Keyboard)
# 0x19, 0x00, // USAGE_MINIMUM (Reserved (no event indicated))
# 0x29, 0x65, // USAGE_MAXIMUM (Keyboard Application)
# 0x81, 0x00, // INPUT (Data,Ary,Abs)
# 0xc0 // END_COLLECTION
echo -ne '\x05\x01\x09\x06\xa1\x01\x05\x07\x19\xe0\x29\xe7\x15\x00\x25\x01\x75\x01\x95\x08\x81\x02\x95\x01\x75\x08\x81\x03\x95\x05\x75\x01\x05\x08\x19\x01\x29\x05\x91\x02\x95\x01\x75\x03\x91\x03\x95\x06\x75\x08\x15\x00\x25\x65\x05\x07\x19\x00\x29\x65\x81\x00\xc0' > functions/hid.0/report_desc

# Create HID mouse function
mkdir functions/hid.1

echo 2 > functions/hid.1/protocol # 2: mouse
echo 5 > functions/hid.1/report_length
echo 1 > functions/hid.1/subclass

# Binary HID mouse descriptor (absolute coordinate)
# 0x05, 0x01, // USAGE_PAGE (Generic Desktop)
# 0x09, 0x02, // USAGE (Mouse)
# 0xa1, 0x01, // COLLECTION (Application)
# 0x09, 0x01, // USAGE (Pointer)
# 0xa1, 0x00, // COLLECTION (Physical)
# 0x05, 0x09, // USAGE_PAGE (Button)
# 0x19, 0x01, // USAGE_MINIMUM (Button 1)
# 0x29, 0x03, // USAGE_MAXIMUM (Button 3)
# 0x15, 0x00, // LOGICAL_MINIMUM (0)
# 0x25, 0x01, // LOGICAL_MAXIMUM (1)
# 0x95, 0x03, // REPORT_COUNT (3)
# 0x75, 0x01, // REPORT_SIZE (1)
# 0x81, 0x02, // INPUT (Data,Var,Abs)
# 0x95, 0x01, // REPORT_COUNT (1)
# 0x75, 0x05, // REPORT_SIZE (5)
# 0x81, 0x03, // INPUT (Cnst,Var,Abs)
# 0x05, 0x01, // USAGE_PAGE (Generic Desktop)
# 0x09, 0x30, // USAGE (X)
# 0x09, 0x31, // USAGE (Y)
# 0x35, 0x00, // PHYSICAL_MINIMUM (0)
# 0x46, 0xff, 0x7f, // PHYSICAL_MAXIMUM (32767)
# 0x15, 0x00, // LOGICAL_MINIMUM (0)
# 0x26, 0xff, 0x7f, // LOGICAL_MAXIMUM (32767)
# 0x65, 0x11, // UNIT (SI Lin:Distance)
# 0x55, 0x00, // UNIT_EXPONENT (0)
# 0x75, 0x10, // REPORT_SIZE (16)