summaryrefslogtreecommitdiffstats
path: root/meta-facebook
diff options
context:
space:
mode:
Diffstat (limited to 'meta-facebook')
-rw-r--r--meta-facebook/COPYING340
-rw-r--r--meta-facebook/meta-wedge/conf/bblayers.conf.sample22
-rw-r--r--meta-facebook/meta-wedge/conf/conf-notes.txt2
-rw-r--r--meta-facebook/meta-wedge/conf/layer.conf10
-rw-r--r--meta-facebook/meta-wedge/conf/local.conf.sample145
-rw-r--r--meta-facebook/meta-wedge/conf/machine/wedge.conf14
-rw-r--r--meta-facebook/meta-wedge/recipes-core/busybox/busybox/busybox.cfg18
-rw-r--r--meta-facebook/meta-wedge/recipes-core/busybox/busybox/syslog.conf5
-rw-r--r--meta-facebook/meta-wedge/recipes-core/busybox/busybox_%.bbappend6
-rw-r--r--meta-facebook/meta-wedge/recipes-core/images/wedge-image.bb1
-rw-r--r--meta-facebook/meta-wedge/recipes-core/images/wedge-image.inc81
-rw-r--r--meta-facebook/meta-wedge/recipes-core/init-ifupdown/files/interfaces11
-rw-r--r--meta-facebook/meta-wedge/recipes-core/init-ifupdown/init-ifupdown_%.bbappend2
-rw-r--r--meta-facebook/meta-wedge/recipes-core/sysvinit/sysvinit-inittab_%.bbappend5
-rw-r--r--meta-facebook/meta-wedge/recipes-kernel/linux/files/defconfig1480
-rw-r--r--meta-facebook/meta-wedge/recipes-kernel/linux/linux-aspeed_2.6%.bbappend8
-rw-r--r--meta-facebook/meta-wedge/recipes-wedge/bmc-log/bmc-log_0.1.bb50
-rw-r--r--meta-facebook/meta-wedge/recipes-wedge/bmc-log/files/Makefile24
-rw-r--r--meta-facebook/meta-wedge/recipes-wedge/bmc-log/files/bmc-log-config16
-rw-r--r--meta-facebook/meta-wedge/recipes-wedge/bmc-log/files/bmc-log.c559
-rw-r--r--meta-facebook/meta-wedge/recipes-wedge/bmc-log/files/bmc-log.h46
-rwxr-xr-xmeta-facebook/meta-wedge/recipes-wedge/bmc-log/files/bmc-log.sh77
-rwxr-xr-xmeta-facebook/meta-wedge/recipes-wedge/fan-ctrl/fan-ctrl/get_fan_speed.sh59
-rwxr-xr-xmeta-facebook/meta-wedge/recipes-wedge/fan-ctrl/fan-ctrl/init_pwm.sh71
-rwxr-xr-xmeta-facebook/meta-wedge/recipes-wedge/fan-ctrl/fan-ctrl/set_fan_speed.sh85
-rw-r--r--meta-facebook/meta-wedge/recipes-wedge/fan-ctrl/fan-ctrl/setup-fan.sh39
-rw-r--r--meta-facebook/meta-wedge/recipes-wedge/fan-ctrl/fan-ctrl_0.1.bbappend64
-rw-r--r--meta-facebook/meta-wedge/recipes-wedge/fblibs/files/alert_control/Makefile27
-rw-r--r--meta-facebook/meta-wedge/recipes-wedge/fblibs/files/alert_control/alert_control.c117
-rw-r--r--meta-facebook/meta-wedge/recipes-wedge/fblibs/files/alert_control/alert_control.h64
-rw-r--r--meta-facebook/meta-wedge/recipes-wedge/fblibs/files/ipmi/Makefile27
-rw-r--r--meta-facebook/meta-wedge/recipes-wedge/fblibs/files/ipmi/ipmi.c81
-rw-r--r--meta-facebook/meta-wedge/recipes-wedge/fblibs/files/ipmi/ipmi.h35
-rw-r--r--meta-facebook/meta-wedge/recipes-wedge/fblibs/libalert-control_0.1.bb38
-rw-r--r--meta-facebook/meta-wedge/recipes-wedge/fblibs/libipmi_0.1.bb39
-rw-r--r--meta-facebook/meta-wedge/recipes-wedge/fbutils/files/COPYING340
-rw-r--r--meta-facebook/meta-wedge/recipes-wedge/fbutils/files/at93cx6.py318
-rwxr-xr-xmeta-facebook/meta-wedge/recipes-wedge/fbutils/files/at93cx6_util.py223
-rw-r--r--meta-facebook/meta-wedge/recipes-wedge/fbutils/files/bcm5396.py467
-rw-r--r--meta-facebook/meta-wedge/recipes-wedge/fbutils/files/bcm5396_util.py266
-rw-r--r--meta-facebook/meta-wedge/recipes-wedge/fbutils/files/board-utils.sh163
-rw-r--r--meta-facebook/meta-wedge/recipes-wedge/fbutils/files/create_vlan_intf37
-rw-r--r--meta-facebook/meta-wedge/recipes-wedge/fbutils/files/eth0_mac_fixup.sh55
-rwxr-xr-xmeta-facebook/meta-wedge/recipes-wedge/fbutils/files/mdio.py124
-rwxr-xr-xmeta-facebook/meta-wedge/recipes-wedge/fbutils/files/mount_data0.sh61
-rw-r--r--meta-facebook/meta-wedge/recipes-wedge/fbutils/files/post_led.sh105
-rw-r--r--meta-facebook/meta-wedge/recipes-wedge/fbutils/files/power-on.sh72
-rwxr-xr-xmeta-facebook/meta-wedge/recipes-wedge/fbutils/files/power_led.sh49
-rw-r--r--meta-facebook/meta-wedge/recipes-wedge/fbutils/files/rc.early25
-rw-r--r--meta-facebook/meta-wedge/recipes-wedge/fbutils/files/rc.local26
-rw-r--r--meta-facebook/meta-wedge/recipes-wedge/fbutils/files/reset_usb.sh36
-rwxr-xr-xmeta-facebook/meta-wedge/recipes-wedge/fbutils/files/setup-gpio.sh457
-rwxr-xr-xmeta-facebook/meta-wedge/recipes-wedge/fbutils/files/setup_rov.sh106
-rw-r--r--meta-facebook/meta-wedge/recipes-wedge/fbutils/files/setup_switch.py49
-rwxr-xr-xmeta-facebook/meta-wedge/recipes-wedge/fbutils/files/sol.sh44
-rw-r--r--meta-facebook/meta-wedge/recipes-wedge/fbutils/files/src/include/i2c-dev.h362
-rw-r--r--meta-facebook/meta-wedge/recipes-wedge/fbutils/files/start_us_monitor.sh73
-rwxr-xr-xmeta-facebook/meta-wedge/recipes-wedge/fbutils/files/us_console.sh47
-rw-r--r--meta-facebook/meta-wedge/recipes-wedge/fbutils/files/us_monitor.sh56
-rw-r--r--meta-facebook/meta-wedge/recipes-wedge/fbutils/files/wedge_power.sh190
-rw-r--r--meta-facebook/meta-wedge/recipes-wedge/fbutils/files/wedge_us_mac.sh29
-rw-r--r--meta-facebook/meta-wedge/recipes-wedge/fbutils/openbmc-utils_%.bbappend95
-rw-r--r--meta-facebook/meta-wedge/recipes-wedge/ipmid/files/Makefile29
-rw-r--r--meta-facebook/meta-wedge/recipes-wedge/ipmid/files/ipmid.c1490
-rw-r--r--meta-facebook/meta-wedge/recipes-wedge/ipmid/files/platform/fruid.h28
-rw-r--r--meta-facebook/meta-wedge/recipes-wedge/ipmid/files/platform/sdr.c412
-rw-r--r--meta-facebook/meta-wedge/recipes-wedge/ipmid/files/platform/sdr.h132
-rw-r--r--meta-facebook/meta-wedge/recipes-wedge/ipmid/files/platform/sel.c438
-rw-r--r--meta-facebook/meta-wedge/recipes-wedge/ipmid/files/platform/sel.h51
-rw-r--r--meta-facebook/meta-wedge/recipes-wedge/ipmid/files/platform/sensor.h117
-rw-r--r--meta-facebook/meta-wedge/recipes-wedge/ipmid/files/platform/timestamp.c46
-rw-r--r--meta-facebook/meta-wedge/recipes-wedge/ipmid/files/platform/timestamp.h30
-rw-r--r--meta-facebook/meta-wedge/recipes-wedge/ipmid/files/platform/wedge/fruid.c183
-rw-r--r--meta-facebook/meta-wedge/recipes-wedge/ipmid/files/platform/wedge/sensor.c371
-rw-r--r--meta-facebook/meta-wedge/recipes-wedge/ipmid/files/setup-ipmid.sh32
-rw-r--r--meta-facebook/meta-wedge/recipes-wedge/ipmid/ipmid_0.1.bb69
-rw-r--r--meta-facebook/meta-wedge/recipes-wedge/lm_sensors/files/wedge.conf77
-rw-r--r--meta-facebook/meta-wedge/recipes-wedge/lm_sensors/lmsensors_%.bbappend14
-rw-r--r--meta-facebook/meta-wedge/recipes-wedge/oob-nic/oob-nic/src/Makefile29
-rw-r--r--meta-facebook/meta-wedge/recipes-wedge/oob-nic/oob-nic/src/README10
-rw-r--r--meta-facebook/meta-wedge/recipes-wedge/oob-nic/oob-nic/src/etc/oob-nic.sh101
-rw-r--r--meta-facebook/meta-wedge/recipes-wedge/oob-nic/oob-nic/src/hlist.h73
-rw-r--r--meta-facebook/meta-wedge/recipes-wedge/oob-nic/oob-nic/src/i2craw.c245
-rw-r--r--meta-facebook/meta-wedge/recipes-wedge/oob-nic/oob-nic/src/intf.c254
-rw-r--r--meta-facebook/meta-wedge/recipes-wedge/oob-nic/oob-nic/src/intf.h31
-rw-r--r--meta-facebook/meta-wedge/recipes-wedge/oob-nic/oob-nic/src/libnetlink.c717
-rw-r--r--meta-facebook/meta-wedge/recipes-wedge/oob-nic/oob-nic/src/libnetlink.h161
-rw-r--r--meta-facebook/meta-wedge/recipes-wedge/oob-nic/oob-nic/src/ll_map.c225
-rw-r--r--meta-facebook/meta-wedge/recipes-wedge/oob-nic/oob-nic/src/ll_map.h32
-rw-r--r--meta-facebook/meta-wedge/recipes-wedge/oob-nic/oob-nic/src/main.c204
-rw-r--r--meta-facebook/meta-wedge/recipes-wedge/oob-nic/oob-nic/src/nic.c517
-rw-r--r--meta-facebook/meta-wedge/recipes-wedge/oob-nic/oob-nic/src/nic.h44
-rw-r--r--meta-facebook/meta-wedge/recipes-wedge/oob-nic/oob-nic/src/nic_defs.h149
-rw-r--r--meta-facebook/meta-wedge/recipes-wedge/oob-nic/oob-nic_0.1.bb44
-rw-r--r--meta-facebook/meta-wedge/recipes-wedge/po-eeprom/files/Makefile26
-rw-r--r--meta-facebook/meta-wedge/recipes-wedge/po-eeprom/files/po-eeprom.c80
-rw-r--r--meta-facebook/meta-wedge/recipes-wedge/po-eeprom/po-eeprom_0.1.bb42
-rw-r--r--meta-facebook/meta-wedge/recipes-wedge/rackmon/rackmon/Makefile40
-rw-r--r--meta-facebook/meta-wedge/recipes-wedge/rackmon/rackmon/gpiowatch.c93
-rw-r--r--meta-facebook/meta-wedge/recipes-wedge/rackmon/rackmon/hexfile.py174
-rw-r--r--meta-facebook/meta-wedge/recipes-wedge/rackmon/rackmon/modbus.c352
-rw-r--r--meta-facebook/meta-wedge/recipes-wedge/rackmon/rackmon/modbus.h85
-rw-r--r--meta-facebook/meta-wedge/recipes-wedge/rackmon/rackmon/modbuscmd.c131
-rw-r--r--meta-facebook/meta-wedge/recipes-wedge/rackmon/rackmon/modbussim.c181
-rwxr-xr-xmeta-facebook/meta-wedge/recipes-wedge/rackmon/rackmon/psu-update-delta.py319
-rw-r--r--meta-facebook/meta-wedge/recipes-wedge/rackmon/rackmon/rackmon-config.py220
-rw-r--r--meta-facebook/meta-wedge/recipes-wedge/rackmon/rackmon/rackmond.c637
-rw-r--r--meta-facebook/meta-wedge/recipes-wedge/rackmon/rackmon/rackmond.h46
-rw-r--r--meta-facebook/meta-wedge/recipes-wedge/rackmon/rackmon/rackmond.py26
-rw-r--r--meta-facebook/meta-wedge/recipes-wedge/rackmon/rackmon/rackmondata.c58
-rw-r--r--meta-facebook/meta-wedge/recipes-wedge/rackmon/rackmon/setup-rackmond.sh20
-rw-r--r--meta-facebook/meta-wedge/recipes-wedge/rackmon/rackmon_0.1.bb81
-rw-r--r--meta-facebook/meta-wedge/recipes-wedge/rest-api/files/bmc_command.py112
-rw-r--r--meta-facebook/meta-wedge/recipes-wedge/rest-api/files/rest.py221
-rw-r--r--meta-facebook/meta-wedge/recipes-wedge/rest-api/files/rest_bmc.py77
-rw-r--r--meta-facebook/meta-wedge/recipes-wedge/rest-api/files/rest_fruid.py89
-rw-r--r--meta-facebook/meta-wedge/recipes-wedge/rest-api/files/rest_gpios.py56
-rw-r--r--meta-facebook/meta-wedge/recipes-wedge/rest-api/files/rest_modbus.py28
-rw-r--r--meta-facebook/meta-wedge/recipes-wedge/rest-api/files/rest_psu_update.py81
-rw-r--r--meta-facebook/meta-wedge/recipes-wedge/rest-api/files/rest_sensors.py57
-rw-r--r--meta-facebook/meta-wedge/recipes-wedge/rest-api/files/rest_server.py68
-rw-r--r--meta-facebook/meta-wedge/recipes-wedge/rest-api/files/rest_slotid.py33
-rw-r--r--meta-facebook/meta-wedge/recipes-wedge/rest-api/files/setup-rest-api.sh79
-rw-r--r--meta-facebook/meta-wedge/recipes-wedge/rest-api/rest-api_0.1.bb71
-rw-r--r--meta-facebook/meta-wedge/recipes-wedge/sensor-setup/files/sensor-setup.sh52
-rw-r--r--meta-facebook/meta-wedge/recipes-wedge/sensor-setup/sensor-setup_0.1.bb38
-rw-r--r--meta-facebook/meta-wedge/recipes-wedge/sms-kcsd/sms-kcsd/Makefile26
-rw-r--r--meta-facebook/meta-wedge/recipes-wedge/sms-kcsd/sms-kcsd/setup-sms-kcs.sh32
-rw-r--r--meta-facebook/meta-wedge/recipes-wedge/sms-kcsd/sms-kcsd/sms-kcsd.c144
-rw-r--r--meta-facebook/meta-wedge/recipes-wedge/sms-kcsd/sms-kcsd_0.1.bb61
-rwxr-xr-xmeta-facebook/meta-wedge/recipes-wedge/usb-console/files/usbcons.sh80
-rwxr-xr-xmeta-facebook/meta-wedge/recipes-wedge/usb-console/files/usbmon.sh34
-rw-r--r--meta-facebook/meta-wedge/recipes-wedge/usb-console/usb-console_0.1.bb42
-rw-r--r--meta-facebook/meta-wedge/recipes-wedge/wedge-eeprom/files/lib/Makefile27
-rw-r--r--meta-facebook/meta-wedge/recipes-wedge/wedge-eeprom/files/lib/wedge_eeprom.c419
-rw-r--r--meta-facebook/meta-wedge/recipes-wedge/wedge-eeprom/files/lib/wedge_eeprom.h125
-rw-r--r--meta-facebook/meta-wedge/recipes-wedge/wedge-eeprom/files/utils/Makefile26
-rw-r--r--meta-facebook/meta-wedge/recipes-wedge/wedge-eeprom/files/utils/weutil.c75
-rw-r--r--meta-facebook/meta-wedge/recipes-wedge/wedge-eeprom/libwedge-eeprom_0.1.bb40
-rw-r--r--meta-facebook/meta-wedge/recipes-wedge/wedge-eeprom/wedge-eeprom_0.1.bb38
-rw-r--r--meta-facebook/meta-wedge100/conf/bblayers.conf.sample23
-rw-r--r--meta-facebook/meta-wedge100/conf/conf-notes.txt2
-rw-r--r--meta-facebook/meta-wedge100/conf/layer.conf10
-rw-r--r--meta-facebook/meta-wedge100/conf/local.conf.sample145
-rw-r--r--meta-facebook/meta-wedge100/conf/machine/wedge100.conf18
-rwxr-xr-xmeta-facebook/meta-wedge100/recipes-core/fan-ctrl/fan-ctrl/get_fan_speed.sh59
-rwxr-xr-xmeta-facebook/meta-wedge100/recipes-core/fan-ctrl/fan-ctrl/set_fan_speed.sh46
-rw-r--r--meta-facebook/meta-wedge100/recipes-core/fan-ctrl/fan-ctrl/setup-fan.sh33
-rw-r--r--meta-facebook/meta-wedge100/recipes-core/fan-ctrl/fan-ctrl_0.1.bbappend46
-rw-r--r--meta-facebook/meta-wedge100/recipes-core/images/wedge100-image.bb82
-rw-r--r--meta-facebook/meta-wedge100/recipes-core/sysvinit/sysvinit-inittab_%.bbappend5
-rw-r--r--meta-facebook/meta-wedge100/recipes-kernel/com-e-mod/files/COPYING340
-rw-r--r--meta-facebook/meta-wedge100/recipes-kernel/com-e-mod/files/Makefile31
-rw-r--r--meta-facebook/meta-wedge100/recipes-kernel/com-e-mod/files/com_e_driver.c365
-rw-r--r--meta-facebook/meta-wedge100/recipes-kernel/com-e-mod/kernel-module-com-e-driver_0.1.bb40
-rw-r--r--meta-facebook/meta-wedge100/recipes-kernel/cpld-mod/files/COPYING340
-rw-r--r--meta-facebook/meta-wedge100/recipes-kernel/cpld-mod/files/Makefile31
-rw-r--r--meta-facebook/meta-wedge100/recipes-kernel/cpld-mod/files/fancpld.c396
-rw-r--r--meta-facebook/meta-wedge100/recipes-kernel/cpld-mod/files/syscpld.c281
-rw-r--r--meta-facebook/meta-wedge100/recipes-kernel/cpld-mod/kernel-module-cpld_0.1.bb42
-rw-r--r--meta-facebook/meta-wedge100/recipes-kernel/i2c-dev-sysfs-mod/files/COPYING340
-rw-r--r--meta-facebook/meta-wedge100/recipes-kernel/i2c-dev-sysfs-mod/files/Makefile31
-rw-r--r--meta-facebook/meta-wedge100/recipes-kernel/i2c-dev-sysfs-mod/files/i2c_dev_sysfs.c349
-rw-r--r--meta-facebook/meta-wedge100/recipes-kernel/i2c-dev-sysfs-mod/files/i2c_dev_sysfs.h84
-rw-r--r--meta-facebook/meta-wedge100/recipes-kernel/i2c-dev-sysfs-mod/kernel-module-i2c-dev-sysfs_0.1.bb42
-rw-r--r--meta-facebook/meta-wedge100/recipes-kernel/linux/files/defconfig1462
-rw-r--r--meta-facebook/meta-wedge100/recipes-kernel/linux/linux-aspeed_2.6%.bbappend8
-rw-r--r--meta-facebook/meta-wedge100/recipes-utils/lm_sensors/files/wedge100.conf78
-rw-r--r--meta-facebook/meta-wedge100/recipes-utils/lm_sensors/lmsensors_%.bbappend10
-rw-r--r--meta-facebook/meta-wedge100/recipes-utils/oob-nic/oob-nic_%.bbappend5
-rw-r--r--meta-facebook/meta-wedge100/recipes-utils/openbmc-gpio/files/board_gpio_rev_table.py33
-rw-r--r--meta-facebook/meta-wedge100/recipes-utils/openbmc-gpio/files/board_gpio_table_v1.py107
-rw-r--r--meta-facebook/meta-wedge100/recipes-utils/openbmc-gpio/files/board_gpio_table_v2.py118
-rw-r--r--meta-facebook/meta-wedge100/recipes-utils/openbmc-gpio/files/data/wedge100-BMC-GPIO-DVT.csv104
-rw-r--r--meta-facebook/meta-wedge100/recipes-utils/openbmc-gpio/files/data/wedge100-BMC-GPIO-EVT.csv83
-rw-r--r--meta-facebook/meta-wedge100/recipes-utils/openbmc-gpio/files/openbmc_gpio_setup.py75
-rw-r--r--meta-facebook/meta-wedge100/recipes-utils/openbmc-gpio/files/setup_board.py22
-rw-r--r--meta-facebook/meta-wedge100/recipes-utils/openbmc-gpio/files/wedge100_gpio_parse.py102
-rw-r--r--meta-facebook/meta-wedge100/recipes-utils/openbmc-gpio/openbmc-gpio_%.bbappend36
-rw-r--r--meta-facebook/meta-wedge100/recipes-utils/openbmc-utils/files/COPYING340
-rw-r--r--meta-facebook/meta-wedge100/recipes-utils/openbmc-utils/files/board-utils.sh81
-rw-r--r--meta-facebook/meta-wedge100/recipes-utils/openbmc-utils/files/disable_watchdog.sh6
-rw-r--r--meta-facebook/meta-wedge100/recipes-utils/openbmc-utils/files/power-on.sh51
-rw-r--r--meta-facebook/meta-wedge100/recipes-utils/openbmc-utils/files/wedge_power.sh187
-rw-r--r--meta-facebook/meta-wedge100/recipes-utils/openbmc-utils/files/wedge_us_mac.sh38
-rw-r--r--meta-facebook/meta-wedge100/recipes-utils/openbmc-utils/openbmc-utils_%.bbappend64
-rw-r--r--meta-facebook/meta-wedge100/recipes-utils/wedge-eeprom/libwedge-eeprom_0.1.bbappend18
-rw-r--r--meta-facebook/meta-yosemite/conf/bblayers.conf.sample22
-rw-r--r--meta-facebook/meta-yosemite/conf/conf-notes.txt2
-rw-r--r--meta-facebook/meta-yosemite/conf/layer.conf10
-rw-r--r--meta-facebook/meta-yosemite/conf/local.conf.sample145
-rw-r--r--meta-facebook/meta-yosemite/conf/machine/yosemite.conf9
-rw-r--r--meta-facebook/meta-yosemite/recipes-core/busybox/busybox/busybox.cfg18
-rw-r--r--meta-facebook/meta-yosemite/recipes-core/busybox/busybox/syslog.conf5
-rw-r--r--meta-facebook/meta-yosemite/recipes-core/busybox/busybox_%.bbappend6
-rw-r--r--meta-facebook/meta-yosemite/recipes-core/images/yosemite-image.bb1
-rw-r--r--meta-facebook/meta-yosemite/recipes-core/images/yosemite-image.inc91
-rw-r--r--meta-facebook/meta-yosemite/recipes-core/init-ifupdown/files/interfaces11
-rw-r--r--meta-facebook/meta-yosemite/recipes-core/init-ifupdown/init-ifupdown_%.bbappend2
-rw-r--r--meta-facebook/meta-yosemite/recipes-core/sysvinit/sysvinit-inittab_%.bbappend2
-rw-r--r--meta-facebook/meta-yosemite/recipes-kernel/linux/files/defconfig1480
-rw-r--r--meta-facebook/meta-yosemite/recipes-kernel/linux/linux-aspeed_2.6%.bbappend8
-rw-r--r--meta-facebook/meta-yosemite/recipes-yosemite/bic-cached/bic-cached_0.1.bb44
-rw-r--r--meta-facebook/meta-yosemite/recipes-yosemite/bic-cached/files/Makefile10
-rw-r--r--meta-facebook/meta-yosemite/recipes-yosemite/bic-cached/files/bic-cached.c133
-rw-r--r--meta-facebook/meta-yosemite/recipes-yosemite/bic-cached/files/setup-bic-cached.sh33
-rw-r--r--meta-facebook/meta-yosemite/recipes-yosemite/consoled/consoled_0.1.bbappend53
-rw-r--r--meta-facebook/meta-yosemite/recipes-yosemite/consoled/files/setup-consoled.sh51
-rwxr-xr-xmeta-facebook/meta-yosemite/recipes-yosemite/fan-ctrl/fan-ctrl/get_fan_speed.sh53
-rwxr-xr-xmeta-facebook/meta-yosemite/recipes-yosemite/fan-ctrl/fan-ctrl/init_pwm.sh64
-rwxr-xr-xmeta-facebook/meta-yosemite/recipes-yosemite/fan-ctrl/fan-ctrl/set_fan_speed.sh79
-rw-r--r--meta-facebook/meta-yosemite/recipes-yosemite/fan-ctrl/fan-ctrl/setup-fan.sh36
-rw-r--r--meta-facebook/meta-yosemite/recipes-yosemite/fan-ctrl/fan-ctrl_0.1.bbappend64
-rw-r--r--meta-facebook/meta-yosemite/recipes-yosemite/fblibs/files/bic/Makefile11
-rw-r--r--meta-facebook/meta-yosemite/recipes-yosemite/fblibs/files/bic/bic.c755
-rw-r--r--meta-facebook/meta-yosemite/recipes-yosemite/fblibs/files/bic/bic.h181
-rw-r--r--meta-facebook/meta-yosemite/recipes-yosemite/fblibs/files/pal/Makefile11
-rw-r--r--meta-facebook/meta-yosemite/recipes-yosemite/fblibs/files/pal/pal.c1953
-rw-r--r--meta-facebook/meta-yosemite/recipes-yosemite/fblibs/files/pal/pal.h149
-rw-r--r--meta-facebook/meta-yosemite/recipes-yosemite/fblibs/files/yosemite_common/Makefile11
-rw-r--r--meta-facebook/meta-yosemite/recipes-yosemite/fblibs/files/yosemite_common/yosemite_common.c150
-rw-r--r--meta-facebook/meta-yosemite/recipes-yosemite/fblibs/files/yosemite_common/yosemite_common.h47
-rw-r--r--meta-facebook/meta-yosemite/recipes-yosemite/fblibs/files/yosemite_fruid/Makefile27
-rw-r--r--meta-facebook/meta-yosemite/recipes-yosemite/fblibs/files/yosemite_fruid/yosemite_fruid.c117
-rw-r--r--meta-facebook/meta-yosemite/recipes-yosemite/fblibs/files/yosemite_fruid/yosemite_fruid.h38
-rw-r--r--meta-facebook/meta-yosemite/recipes-yosemite/fblibs/files/yosemite_gpio/Makefile27
-rw-r--r--meta-facebook/meta-yosemite/recipes-yosemite/fblibs/files/yosemite_gpio/yosemite_gpio.c120
-rw-r--r--meta-facebook/meta-yosemite/recipes-yosemite/fblibs/files/yosemite_gpio/yosemite_gpio.h39
-rw-r--r--meta-facebook/meta-yosemite/recipes-yosemite/fblibs/files/yosemite_sensor/Makefile11
-rw-r--r--meta-facebook/meta-yosemite/recipes-yosemite/fblibs/files/yosemite_sensor/yosemite_sensor.c883
-rw-r--r--meta-facebook/meta-yosemite/recipes-yosemite/fblibs/files/yosemite_sensor/yosemite_sensor.h175
-rw-r--r--meta-facebook/meta-yosemite/recipes-yosemite/fblibs/libbic_0.1.bb25
-rw-r--r--meta-facebook/meta-yosemite/recipes-yosemite/fblibs/libpal_0.1.bb28
-rw-r--r--meta-facebook/meta-yosemite/recipes-yosemite/fblibs/libyosemite-common_0.1.bb25
-rw-r--r--meta-facebook/meta-yosemite/recipes-yosemite/fblibs/libyosemite-fruid_0.1.bb43
-rw-r--r--meta-facebook/meta-yosemite/recipes-yosemite/fblibs/libyosemite-gpio_0.1.bb43
-rw-r--r--meta-facebook/meta-yosemite/recipes-yosemite/fblibs/libyosemite-sensor_0.1.bb25
-rw-r--r--meta-facebook/meta-yosemite/recipes-yosemite/fbutils/bic-util_0.1.bb21
-rw-r--r--meta-facebook/meta-yosemite/recipes-yosemite/fbutils/fbutils_0.1.bb102
-rw-r--r--meta-facebook/meta-yosemite/recipes-yosemite/fbutils/files/COPYING340
-rw-r--r--meta-facebook/meta-yosemite/recipes-yosemite/fbutils/files/ast-functions147
-rw-r--r--meta-facebook/meta-yosemite/recipes-yosemite/fbutils/files/at93c46.py276
-rwxr-xr-xmeta-facebook/meta-yosemite/recipes-yosemite/fbutils/files/at93c46_util.py194
-rw-r--r--meta-facebook/meta-yosemite/recipes-yosemite/fbutils/files/bcm5396.py452
-rw-r--r--meta-facebook/meta-yosemite/recipes-yosemite/fbutils/files/bcm5396_util.py260
-rw-r--r--meta-facebook/meta-yosemite/recipes-yosemite/fbutils/files/bic-util/Makefile10
-rw-r--r--meta-facebook/meta-yosemite/recipes-yosemite/fbutils/files/bic-util/bic-util.c401
-rw-r--r--meta-facebook/meta-yosemite/recipes-yosemite/fbutils/files/create_vlan_intf37
-rw-r--r--meta-facebook/meta-yosemite/recipes-yosemite/fbutils/files/eth0_mac_fixup.sh41
-rwxr-xr-xmeta-facebook/meta-yosemite/recipes-yosemite/fbutils/files/fcswitcher.sh83
-rw-r--r--meta-facebook/meta-yosemite/recipes-yosemite/fbutils/files/fpc-util/Makefile10
-rw-r--r--meta-facebook/meta-yosemite/recipes-yosemite/fbutils/files/fpc-util/fpc-util.c85
-rw-r--r--meta-facebook/meta-yosemite/recipes-yosemite/fbutils/files/fw-util/Makefile10
-rw-r--r--meta-facebook/meta-yosemite/recipes-yosemite/fbutils/files/fw-util/fw-util.c161
-rwxr-xr-xmeta-facebook/meta-yosemite/recipes-yosemite/fbutils/files/mdio.py124
-rwxr-xr-xmeta-facebook/meta-yosemite/recipes-yosemite/fbutils/files/mount_data0.sh61
-rw-r--r--meta-facebook/meta-yosemite/recipes-yosemite/fbutils/files/post_led.sh105
-rw-r--r--meta-facebook/meta-yosemite/recipes-yosemite/fbutils/files/power-on.sh99
-rwxr-xr-xmeta-facebook/meta-yosemite/recipes-yosemite/fbutils/files/power_led.sh58
-rw-r--r--meta-facebook/meta-yosemite/recipes-yosemite/fbutils/files/power_util.py151
-rw-r--r--meta-facebook/meta-yosemite/recipes-yosemite/fbutils/files/rc.early25
-rw-r--r--meta-facebook/meta-yosemite/recipes-yosemite/fbutils/files/rc.local26
-rw-r--r--meta-facebook/meta-yosemite/recipes-yosemite/fbutils/files/reset_usb.sh55
-rwxr-xr-xmeta-facebook/meta-yosemite/recipes-yosemite/fbutils/files/setup-gpio.sh401
-rwxr-xr-xmeta-facebook/meta-yosemite/recipes-yosemite/fbutils/files/setup_rov.sh99
-rw-r--r--meta-facebook/meta-yosemite/recipes-yosemite/fbutils/files/setup_switch.py49
-rwxr-xr-xmeta-facebook/meta-yosemite/recipes-yosemite/fbutils/files/sol-util74
-rw-r--r--meta-facebook/meta-yosemite/recipes-yosemite/fbutils/files/src/include/i2c-dev.h364
-rw-r--r--meta-facebook/meta-yosemite/recipes-yosemite/fbutils/files/src/include/log.h59
-rwxr-xr-xmeta-facebook/meta-yosemite/recipes-yosemite/fbutils/files/us_console.sh41
-rwxr-xr-xmeta-facebook/meta-yosemite/recipes-yosemite/fbutils/files/watch-fc.sh34
-rw-r--r--meta-facebook/meta-yosemite/recipes-yosemite/fbutils/files/wedge_us_mac.sh29
-rw-r--r--meta-facebook/meta-yosemite/recipes-yosemite/fbutils/files/yosemite-sensors/Makefile10
-rw-r--r--meta-facebook/meta-yosemite/recipes-yosemite/fbutils/files/yosemite-sensors/yosemite-sensors.c405
-rw-r--r--meta-facebook/meta-yosemite/recipes-yosemite/fbutils/files/yosemite_power.sh169
-rw-r--r--meta-facebook/meta-yosemite/recipes-yosemite/fbutils/fpc-util_0.1.bb21
-rw-r--r--meta-facebook/meta-yosemite/recipes-yosemite/fbutils/fw-util_0.1.bb21
-rw-r--r--meta-facebook/meta-yosemite/recipes-yosemite/fbutils/yosemite-sensors_0.1.bb21
-rw-r--r--meta-facebook/meta-yosemite/recipes-yosemite/front-paneld/files/Makefile10
-rw-r--r--meta-facebook/meta-yosemite/recipes-yosemite/front-paneld/files/front-paneld.c587
-rw-r--r--meta-facebook/meta-yosemite/recipes-yosemite/front-paneld/files/setup-front-paneld.sh16
-rw-r--r--meta-facebook/meta-yosemite/recipes-yosemite/front-paneld/front-paneld_0.1.bb44
-rw-r--r--meta-facebook/meta-yosemite/recipes-yosemite/fruid/fruid_0.1.bbappend24
-rw-r--r--meta-facebook/meta-yosemite/recipes-yosemite/gpiod/files/Makefile26
-rw-r--r--meta-facebook/meta-yosemite/recipes-yosemite/gpiod/files/gpiod.c380
-rw-r--r--meta-facebook/meta-yosemite/recipes-yosemite/gpiod/files/setup-gpiod.sh54
-rw-r--r--meta-facebook/meta-yosemite/recipes-yosemite/gpiod/gpiod_0.1.bb62
-rw-r--r--meta-facebook/meta-yosemite/recipes-yosemite/ipmbd/files/setup-ipmbd.sh104
-rw-r--r--meta-facebook/meta-yosemite/recipes-yosemite/ipmbd/ipmbd_0.1.bbappend28
-rw-r--r--meta-facebook/meta-yosemite/recipes-yosemite/ipmid/files/bic.c78
-rw-r--r--meta-facebook/meta-yosemite/recipes-yosemite/ipmid/files/bic.h29
-rw-r--r--meta-facebook/meta-yosemite/recipes-yosemite/ipmid/files/fruid.c120
-rw-r--r--meta-facebook/meta-yosemite/recipes-yosemite/ipmid/files/lan.c127
-rw-r--r--meta-facebook/meta-yosemite/recipes-yosemite/ipmid/files/sensor.c371
-rw-r--r--meta-facebook/meta-yosemite/recipes-yosemite/ipmid/files/setup-ipmid.sh32
-rw-r--r--meta-facebook/meta-yosemite/recipes-yosemite/ipmid/ipmid_0.2.bbappend49
-rw-r--r--meta-facebook/meta-yosemite/recipes-yosemite/lm_sensors/files/yosemite.conf44
-rw-r--r--meta-facebook/meta-yosemite/recipes-yosemite/lm_sensors/lmsensors_%.bbappend10
-rw-r--r--meta-facebook/meta-yosemite/recipes-yosemite/me-util/files/Makefile10
-rw-r--r--meta-facebook/meta-yosemite/recipes-yosemite/me-util/files/me-util.c119
-rw-r--r--meta-facebook/meta-yosemite/recipes-yosemite/me-util/me-util_0.1.bb38
-rw-r--r--meta-facebook/meta-yosemite/recipes-yosemite/oob-nic/oob-nic/src/Makefile29
-rw-r--r--meta-facebook/meta-yosemite/recipes-yosemite/oob-nic/oob-nic/src/README10
-rw-r--r--meta-facebook/meta-yosemite/recipes-yosemite/oob-nic/oob-nic/src/etc/oob-nic.sh93
-rw-r--r--meta-facebook/meta-yosemite/recipes-yosemite/oob-nic/oob-nic/src/hlist.h73
-rw-r--r--meta-facebook/meta-yosemite/recipes-yosemite/oob-nic/oob-nic/src/i2craw.c245
-rw-r--r--meta-facebook/meta-yosemite/recipes-yosemite/oob-nic/oob-nic/src/intf.c254
-rw-r--r--meta-facebook/meta-yosemite/recipes-yosemite/oob-nic/oob-nic/src/intf.h31
-rw-r--r--meta-facebook/meta-yosemite/recipes-yosemite/oob-nic/oob-nic/src/libnetlink.c717
-rw-r--r--meta-facebook/meta-yosemite/recipes-yosemite/oob-nic/oob-nic/src/libnetlink.h161
-rw-r--r--meta-facebook/meta-yosemite/recipes-yosemite/oob-nic/oob-nic/src/ll_map.c225
-rw-r--r--meta-facebook/meta-yosemite/recipes-yosemite/oob-nic/oob-nic/src/ll_map.h32
-rw-r--r--meta-facebook/meta-yosemite/recipes-yosemite/oob-nic/oob-nic/src/main.c192
-rw-r--r--meta-facebook/meta-yosemite/recipes-yosemite/oob-nic/oob-nic/src/nic.c487
-rw-r--r--meta-facebook/meta-yosemite/recipes-yosemite/oob-nic/oob-nic/src/nic.h44
-rw-r--r--meta-facebook/meta-yosemite/recipes-yosemite/oob-nic/oob-nic/src/nic_defs.h143
-rw-r--r--meta-facebook/meta-yosemite/recipes-yosemite/oob-nic/oob-nic_0.1.bb44
-rw-r--r--meta-facebook/meta-yosemite/recipes-yosemite/rest-api/files/plat_tree.py84
-rw-r--r--meta-facebook/meta-yosemite/recipes-yosemite/rest-api/files/setup-rest-api.sh32
-rw-r--r--meta-facebook/meta-yosemite/recipes-yosemite/rest-api/rest-api_0.2.bbappend62
-rw-r--r--meta-facebook/meta-yosemite/recipes-yosemite/sensor-mon/files/setup-sensord.sh55
-rw-r--r--meta-facebook/meta-yosemite/recipes-yosemite/sensor-mon/sensor-mon_0.1.bbappend55
-rw-r--r--meta-facebook/meta-yosemite/recipes-yosemite/sensor-setup/files/sensor-setup.sh54
-rw-r--r--meta-facebook/meta-yosemite/recipes-yosemite/sensor-setup/sensor-setup_0.1.bb38
-rwxr-xr-xmeta-facebook/meta-yosemite/recipes-yosemite/usb-console/files/usbcons.sh80
-rwxr-xr-xmeta-facebook/meta-yosemite/recipes-yosemite/usb-console/files/usbmon.sh25
-rw-r--r--meta-facebook/meta-yosemite/recipes-yosemite/usb-console/usb-console_0.1.bb42
327 files changed, 0 insertions, 43075 deletions
diff --git a/meta-facebook/COPYING b/meta-facebook/COPYING
deleted file mode 100644
index 3912109..0000000
--- a/meta-facebook/COPYING
+++ /dev/null
@@ -1,340 +0,0 @@
- GNU GENERAL PUBLIC LICENSE
- Version 2, June 1991
-
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.
- 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
- Preamble
-
- The licenses for most software are designed to take away your
-freedom to share and change it. By contrast, the GNU General Public
-License is intended to guarantee your freedom to share and change free
-software--to make sure the software is free for all its users. This
-General Public License applies to most of the Free Software
-Foundation's software and to any other program whose authors commit to
-using it. (Some other Free Software Foundation software is covered by
-the GNU Library General Public License instead.) You can apply it to
-your programs, too.
-
- When we speak of free software, we are referring to freedom, not
-price. Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-this service if you wish), that you receive source code or can get it
-if you want it, that you can change the software or use pieces of it
-in new free programs; and that you know you can do these things.
-
- To protect your rights, we need to make restrictions that forbid
-anyone to deny you these rights or to ask you to surrender the rights.
-These restrictions translate to certain responsibilities for you if you
-distribute copies of the software, or if you modify it.
-
- For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must give the recipients all the rights that
-you have. You must make sure that they, too, receive or can get the
-source code. And you must show them these terms so they know their
-rights.
-
- We protect your rights with two steps: (1) copyright the software, and
-(2) offer you this license which gives you legal permission to copy,
-distribute and/or modify the software.
-
- Also, for each author's protection and ours, we want to make certain
-that everyone understands that there is no warranty for this free
-software. If the software is modified by someone else and passed on, we
-want its recipients to know that what they have is not the original, so
-that any problems introduced by others will not reflect on the original
-authors' reputations.
-
- Finally, any free program is threatened constantly by software
-patents. We wish to avoid the danger that redistributors of a free
-program will individually obtain patent licenses, in effect making the
-program proprietary. To prevent this, we have made it clear that any
-patent must be licensed for everyone's free use or not licensed at all.
-
- The precise terms and conditions for copying, distribution and
-modification follow.
-
- GNU GENERAL PUBLIC LICENSE
- TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
- 0. This License applies to any program or other work which contains
-a notice placed by the copyright holder saying it may be distributed
-under the terms of this General Public License. The "Program", below,
-refers to any such program or work, and a "work based on the Program"
-means either the Program or any derivative work under copyright law:
-that is to say, a work containing the Program or a portion of it,
-either verbatim or with modifications and/or translated into another
-language. (Hereinafter, translation is included without limitation in
-the term "modification".) Each licensee is addressed as "you".
-
-Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope. The act of
-running the Program is not restricted, and the output from the Program
-is covered only if its contents constitute a work based on the
-Program (independent of having been made by running the Program).
-Whether that is true depends on what the Program does.
-
- 1. You may copy and distribute verbatim copies of the Program's
-source code as you receive it, in any medium, provided that you
-conspicuously and appropriately publish on each copy an appropriate
-copyright notice and disclaimer of warranty; keep intact all the
-notices that refer to this License and to the absence of any warranty;
-and give any other recipients of the Program a copy of this License
-along with the Program.
-
-You may charge a fee for the physical act of transferring a copy, and
-you may at your option offer warranty protection in exchange for a fee.
-
- 2. You may modify your copy or copies of the Program or any portion
-of it, thus forming a work based on the Program, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
- a) You must cause the modified files to carry prominent notices
- stating that you changed the files and the date of any change.
-
- b) You must cause any work that you distribute or publish, that in
- whole or in part contains or is derived from the Program or any
- part thereof, to be licensed as a whole at no charge to all third
- parties under the terms of this License.
-
- c) If the modified program normally reads commands interactively
- when run, you must cause it, when started running for such
- interactive use in the most ordinary way, to print or display an
- announcement including an appropriate copyright notice and a
- notice that there is no warranty (or else, saying that you provide
- a warranty) and that users may redistribute the program under
- these conditions, and telling the user how to view a copy of this
- License. (Exception: if the Program itself is interactive but
- does not normally print such an announcement, your work based on
- the Program is not required to print an announcement.)
-
-These requirements apply to the modified work as a whole. If
-identifiable sections of that work are not derived from the Program,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works. But when you
-distribute the same sections as part of a whole which is a work based
-on the Program, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Program.
-
-In addition, mere aggregation of another work not based on the Program
-with the Program (or with a work based on the Program) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
- 3. You may copy and distribute the Program (or a work based on it,
-under Section 2) in object code or executable form under the terms of
-Sections 1 and 2 above provided that you also do one of the following:
-
- a) Accompany it with the complete corresponding machine-readable
- source code, which must be distributed under the terms of Sections
- 1 and 2 above on a medium customarily used for software interchange; or,
-
- b) Accompany it with a written offer, valid for at least three
- years, to give any third party, for a charge no more than your
- cost of physically performing source distribution, a complete
- machine-readable copy of the corresponding source code, to be
- distributed under the terms of Sections 1 and 2 above on a medium
- customarily used for software interchange; or,
-
- c) Accompany it with the information you received as to the offer
- to distribute corresponding source code. (This alternative is
- allowed only for noncommercial distribution and only if you
- received the program in object code or executable form with such
- an offer, in accord with Subsection b above.)
-
-The source code for a work means the preferred form of the work for
-making modifications to it. For an executable work, complete source
-code means all the source code for all modules it contains, plus any
-associated interface definition files, plus the scripts used to
-control compilation and installation of the executable. However, as a
-special exception, the source code distributed need not include
-anything that is normally distributed (in either source or binary
-form) with the major components (compiler, kernel, and so on) of the
-operating system on which the executable runs, unless that component
-itself accompanies the executable.
-
-If distribution of executable or object code is made by offering
-access to copy from a designated place, then offering equivalent
-access to copy the source code from the same place counts as
-distribution of the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
- 4. You may not copy, modify, sublicense, or distribute the Program
-except as expressly provided under this License. Any attempt
-otherwise to copy, modify, sublicense or distribute the Program is
-void, and will automatically terminate your rights under this License.
-However, parties who have received copies, or rights, from you under
-this License will not have their licenses terminated so long as such
-parties remain in full compliance.
-
- 5. You are not required to accept this License, since you have not
-signed it. However, nothing else grants you permission to modify or
-distribute the Program or its derivative works. These actions are
-prohibited by law if you do not accept this License. Therefore, by
-modifying or distributing the Program (or any work based on the
-Program), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Program or works based on it.
-
- 6. Each time you redistribute the Program (or any work based on the
-Program), the recipient automatically receives a license from the
-original licensor to copy, distribute or modify the Program subject to
-these terms and conditions. You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties to
-this License.
-
- 7. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License. If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Program at all. For example, if a patent
-license would not permit royalty-free redistribution of the Program by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Program.
-
-If any portion of this section is held invalid or unenforceable under
-any particular circumstance, the balance of the section is intended to
-apply and the section as a whole is intended to apply in other
-circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system, which is
-implemented by public license practices. Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
- 8. If the distribution and/or use of the Program is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Program under this License
-may add an explicit geographical distribution limitation excluding
-those countries, so that distribution is permitted only in or among
-countries not thus excluded. In such case, this License incorporates
-the limitation as if written in the body of this License.
-
- 9. The Free Software Foundation may publish revised and/or new versions
-of the General Public License from time to time. Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
-Each version is given a distinguishing version number. If the Program
-specifies a version number of this License which applies to it and "any
-later version", you have the option of following the terms and conditions
-either of that version or of any later version published by the Free
-Software Foundation. If the Program does not specify a version number of
-this License, you may choose any version ever published by the Free Software
-Foundation.
-
- 10. If you wish to incorporate parts of the Program into other free
-programs whose distribution conditions are different, write to the author
-to ask for permission. For software which is copyrighted by the Free
-Software Foundation, write to the Free Software Foundation; we sometimes
-make exceptions for this. Our decision will be guided by the two goals
-of preserving the free status of all derivatives of our free software and
-of promoting the sharing and reuse of software generally.
-
- NO WARRANTY
-
- 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
-FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
-OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
-PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
-OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
-TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
-PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
-REPAIR OR CORRECTION.
-
- 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
-REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
-INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
-OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
-TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
-YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
-PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGES.
-
- END OF TERMS AND CONDITIONS
-
- How to Apply These Terms to Your New Programs
-
- If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
- To do so, attach the following notices to the program. It is safest
-to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least
-the "copyright" line and a pointer to where the full notice is found.
-
- <one line to give the program's name and a brief idea of what it does.>
- Copyright (C) <year> <name of author>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
-
-Also add information on how to contact you by electronic and paper mail.
-
-If the program is interactive, make it output a short notice like this
-when it starts in an interactive mode:
-
- Gnomovision version 69, Copyright (C) year name of author
- Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
- This is free software, and you are welcome to redistribute it
- under certain conditions; type `show c' for details.
-
-The hypothetical commands `show w' and `show c' should show the appropriate
-parts of the General Public License. Of course, the commands you use may
-be called something other than `show w' and `show c'; they could even be
-mouse-clicks or menu items--whatever suits your program.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the program, if
-necessary. Here is a sample; alter the names:
-
- Yoyodyne, Inc., hereby disclaims all copyright interest in the program
- `Gnomovision' (which makes passes at compilers) written by James Hacker.
-
- <signature of Ty Coon>, 1 April 1989
- Ty Coon, President of Vice
-
-This General Public License does not permit incorporating your program into
-proprietary programs. If your program is a subroutine library, you may
-consider it more useful to permit linking proprietary applications with the
-library. If this is what you want to do, use the GNU Library General
-Public License instead of this License.
diff --git a/meta-facebook/meta-wedge/conf/bblayers.conf.sample b/meta-facebook/meta-wedge/conf/bblayers.conf.sample
deleted file mode 100644
index 90d4956..0000000
--- a/meta-facebook/meta-wedge/conf/bblayers.conf.sample
+++ /dev/null
@@ -1,22 +0,0 @@
-# LAYER_CONF_VERSION is increased each time build/conf/bblayers.conf
-# changes incompatibly
-LCONF_VERSION = "6"
-
-BBPATH = "${TOPDIR}"
-BBFILES ?= ""
-
-BBLAYERS ?= " \
- ##OEROOT##/meta \
- ##OEROOT##/meta-yocto \
- ##OEROOT##/meta-yocto-bsp \
- ##OEROOT##/meta-openembedded/meta-oe \
- ##OEROOT##/meta-openembedded/meta-networking \
- ##OEROOT##/meta-openembedded/meta-python \
- ##OEROOT##/meta-openbmc \
- ##OEROOT##/meta-openbmc/meta-aspeed \
- ##OEROOT##/meta-openbmc/meta-facebook/meta-wedge \
- "
-BBLAYERS_NON_REMOVABLE ?= " \
- ##OEROOT##/meta \
- ##OEROOT##/meta-yocto \
- "
diff --git a/meta-facebook/meta-wedge/conf/conf-notes.txt b/meta-facebook/meta-wedge/conf/conf-notes.txt
deleted file mode 100644
index ad3d503..0000000
--- a/meta-facebook/meta-wedge/conf/conf-notes.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-Common targets are:
- wedge-image
diff --git a/meta-facebook/meta-wedge/conf/layer.conf b/meta-facebook/meta-wedge/conf/layer.conf
deleted file mode 100644
index 630361f..0000000
--- a/meta-facebook/meta-wedge/conf/layer.conf
+++ /dev/null
@@ -1,10 +0,0 @@
-# We have a conf and classes directory, add to BBPATH
-BBPATH .= ":${LAYERDIR}"
-
-# We have recipes-* directories, add to BBFILES
-BBFILES += "${LAYERDIR}/recipes-*/*/*.bb \
- ${LAYERDIR}/recipes-*/*/*.bbappend"
-
-BBFILE_COLLECTIONS += "wedge"
-BBFILE_PATTERN_wedge = "^${LAYERDIR}/"
-BBFILE_PRIORITY_wedge = "8"
diff --git a/meta-facebook/meta-wedge/conf/local.conf.sample b/meta-facebook/meta-wedge/conf/local.conf.sample
deleted file mode 100644
index 7ddcaa6..0000000
--- a/meta-facebook/meta-wedge/conf/local.conf.sample
+++ /dev/null
@@ -1,145 +0,0 @@
-#
-# Local configuration file for building the OpenBMC image.
-#
-
-# Always look for packages first in our own local package mirror
-SOURCE_MIRROR_URL ?= "file://${TOPDIR}/../meta-openbmc/source_mirror/"
-INHERIT += "own-mirrors"
-
-# Save local tarballs for all packages we download.
-# This can be used to update our mirror directory above.
-BB_GENERATE_MIRROR_TARBALLS = "1"
-
-# The following setting will prevent bitbake from downloading anything over the
-# network. This can be used to ensure that we get everything from a local
-# file:// mirror.
-#
-# Comment this out if you do need to download new packages from the internet.
-# However, once you have downloaded the package you should check them into our
-# mirror repository so that other developers will always get it from the mirror
-# repo.
-BB_NO_NETWORK = "fb-only"
-
-# Parallelism Options
-#
-# How many tasks bitbake should run in parallel:
-BB_NUMBER_THREADS ?= "${@oe.utils.cpu_count()}"
-# How many processes make should run in parallel:
-PARALLEL_MAKE ?= "-j ${@oe.utils.cpu_count()}"
-
-# Machine Selection
-MACHINE ??= "wedge"
-
-# Build directory locationds.
-#
-#DL_DIR ?= "${TOPDIR}/downloads"
-#SSTATE_DIR ?= "${TOPDIR}/sstate-cache"
-#TMPDIR = "${TOPDIR}/tmp"
-
-#
-# Default policy config
-# We could eventually create our own distro config if desired,
-# but for now we use the standard poky distro settings.
-#
-DISTRO ?= "poky"
-
-# Use RPM packages
-PACKAGE_CLASSES ?= "package_rpm"
-
-# Extra image features.
-# Currently we do not enable anything extra here.
-#EXTRA_IMAGE_FEATURES = ""
-
-# We build on CentOS 6.3.
-# Don't complain about it, even though it isn't in poky's default
-# list of supported distros.
-SANITY_TESTED_DISTROS_append ?= " CentOS-6.3 \n "
-
-#
-# Additional image features
-#
-# The following is a list of additional classes to use when building images which
-# enable extra features. Some available options which can be included in this variable
-# are:
-# - 'buildstats' collect build statistics
-# - 'image-mklibs' to reduce shared library files size for an image
-# - 'image-prelink' in order to prelink the filesystem image
-# - 'image-swab' to perform host system intrusion detection
-# NOTE: if listing mklibs & prelink both, then make sure mklibs is before prelink
-# NOTE: mklibs also needs to be explicitly enabled for a given image, see local.conf.extended
-USER_CLASSES ?= "buildstats image-mklibs image-prelink"
-
-#
-# Interactive shell configuration
-#
-# Under certain circumstances the system may need input from you and to do this it
-# can launch an interactive shell. It needs to do this since the build is
-# multithreaded and needs to be able to handle the case where more than one parallel
-# process may require the user's attention. The default is iterate over the available
-# terminal types to find one that works.
-#
-# Examples of the occasions this may happen are when resolving patches which cannot
-# be applied, to use the devshell or the kernel menuconfig
-#
-# Supported values are auto, gnome, xfce, rxvt, screen, konsole (KDE 3.x only), none
-# Note: currently, Konsole support only works for KDE 3.x due to the way
-# newer Konsole versions behave
-#OE_TERMINAL = "auto"
-# By default disable interactive patch resolution (tasks will just fail instead):
-PATCHRESOLVE = "noop"
-
-#
-# Disk Space Monitoring during the build
-#
-# Monitor the disk space during the build. If there is less that 1GB of space or less
-# than 100K inodes in any key build location (TMPDIR, DL_DIR, SSTATE_DIR), gracefully
-# shutdown the build. If there is less that 100MB or 1K inodes, perform a hard abort
-# of the build. The reason for this is that running completely out of space can corrupt
-# files and damages the build in ways which may not be easily recoverable.
-BB_DISKMON_DIRS = "\
- STOPTASKS,${TMPDIR},1G,100K \
- STOPTASKS,${DL_DIR},1G,100K \
- STOPTASKS,${SSTATE_DIR},1G,100K \
- ABORT,${TMPDIR},100M,1K \
- ABORT,${DL_DIR},100M,1K \
- ABORT,${SSTATE_DIR},100M,1K"
-
-#
-# Shared-state files from other locations
-#
-# As mentioned above, shared state files are prebuilt cache data objects which can
-# used to accelerate build time. This variable can be used to configure the system
-# to search other mirror locations for these objects before it builds the data itself.
-#
-# This can be a filesystem directory, or a remote url such as http or ftp. These
-# would contain the sstate-cache results from previous builds (possibly from other
-# machines). This variable works like fetcher MIRRORS/PREMIRRORS and points to the
-# cache locations to check for the shared objects.
-# NOTE: if the mirror uses the same structure as SSTATE_DIR, you need to add PATH
-# at the end as shown in the examples below. This will be substituted with the
-# correct path within the directory structure.
-#SSTATE_MIRRORS ?= "\
-#file://.* http://someserver.tld/share/sstate/PATH;downloadfilename=PATH \n \
-#file://.* file:///some/local/dir/sstate/PATH"
-
-
-# CONF_VERSION is increased each time build/conf/ changes incompatibly and is used to
-# track the version of this file when it was generated. This can safely be ignored if
-# this doesn't mean anything to you.
-CONF_VERSION = "1"
-
-
-# Update root password to '0penBmc' and change the root shell back to bash.
-# This default root password is used at the ODM and system integrator. It will be
-# changed during provisioning at the datacenter.
-INHERIT += "extrausers"
-
-EXTRA_USERS_PARAMS = " \
- usermod -s /bin/bash root; \
- usermod -p '\$1\$UGMqyqdG\$FZiylVFmRRfl9Z0Ue8G7e/' root; \
- "
-
-OLDEST_KERNEL = "2.6.28"
-
-INHERIT += "blacklist"
-PNBLACKLIST[glibc] = "glibc 2.21 does not work with our kernel 2.6.28" \ No newline at end of file
diff --git a/meta-facebook/meta-wedge/conf/machine/wedge.conf b/meta-facebook/meta-wedge/conf/machine/wedge.conf
deleted file mode 100644
index 49241aa..0000000
--- a/meta-facebook/meta-wedge/conf/machine/wedge.conf
+++ /dev/null
@@ -1,14 +0,0 @@
-#@TYPE: Machine
-#@NAME: Wedge
-#@DESCRIPTION: Machine configuration for Facebook Wedge
-
-UBOOT_MACHINE_wedge = "wedge_config"
-
-require conf/machine/include/ast1250.inc
-
-# configuration for preferred version of packages
-PREFERRED_VERSION_libipmi = "0.1"
-PREFERRED_VERSION_ipmid = "0.1"
-PREFERRED_VERSION_rest-api = "0.1"
-
-TCLIBC = 'eglibc'
diff --git a/meta-facebook/meta-wedge/recipes-core/busybox/busybox/busybox.cfg b/meta-facebook/meta-wedge/recipes-core/busybox/busybox/busybox.cfg
deleted file mode 100644
index 66da117..0000000
--- a/meta-facebook/meta-wedge/recipes-core/busybox/busybox/busybox.cfg
+++ /dev/null
@@ -1,18 +0,0 @@
-CONFIG_SH_MATH_SUPPORT_64=y
-CONFIG_DEVMEM=y
-CONFIG_LSUSB=y
-CONFIG_FEATURE_PS_ADDITIONAL_COLUMNS=y
-CONFIG_RX=y
-CONFIG_FLASHCP=y
-CONFIG_FLASH_LOCK=y
-CONFIG_FLASH_UNLOCK=y
-CONFIG_FLASH_ERASEALL=y
-CONFIG_TRACEROUTE6=y
-CONFIG_VCONFIG=y
-# we use the standalone ip util
-CONFIG_IP=n
-# use dhclient, as udhcpc will flush all v6 link local addresses during renew
-CONFIG_FEATURE_IFUPDOWN_EXTERNAL_DHCP=y
-CONFIG_UDHCPD=n
-CONFIG_UDHCPC=n
-CONFIG_UDHCPC6=n
diff --git a/meta-facebook/meta-wedge/recipes-core/busybox/busybox/syslog.conf b/meta-facebook/meta-wedge/recipes-core/busybox/busybox/syslog.conf
deleted file mode 100644
index 817a9a9..0000000
--- a/meta-facebook/meta-wedge/recipes-core/busybox/busybox/syslog.conf
+++ /dev/null
@@ -1,5 +0,0 @@
-# /etc/syslog.conf Configuration file for busybox's syslogd utility
-# Send emergency messages to the console
-*.emerg /dev/console
-# Store everything else
-*.* /var/log/messages
diff --git a/meta-facebook/meta-wedge/recipes-core/busybox/busybox_%.bbappend b/meta-facebook/meta-wedge/recipes-core/busybox/busybox_%.bbappend
deleted file mode 100644
index 0047f92..0000000
--- a/meta-facebook/meta-wedge/recipes-core/busybox/busybox_%.bbappend
+++ /dev/null
@@ -1,6 +0,0 @@
-FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
-
-SRC_URI += " \
- file://busybox.cfg \
- file://syslog.conf \
- "
diff --git a/meta-facebook/meta-wedge/recipes-core/images/wedge-image.bb b/meta-facebook/meta-wedge/recipes-core/images/wedge-image.bb
deleted file mode 100644
index 04c31f6..0000000
--- a/meta-facebook/meta-wedge/recipes-core/images/wedge-image.bb
+++ /dev/null
@@ -1 +0,0 @@
-include wedge-image.inc
diff --git a/meta-facebook/meta-wedge/recipes-core/images/wedge-image.inc b/meta-facebook/meta-wedge/recipes-core/images/wedge-image.inc
deleted file mode 100644
index a31655e..0000000
--- a/meta-facebook/meta-wedge/recipes-core/images/wedge-image.inc
+++ /dev/null
@@ -1,81 +0,0 @@
-inherit aspeed_uboot_image
-
-# /dev
-require recipes-core/images/aspeed-dev.inc
-
-# Base this image on core-image-minimal
-include recipes-core/images/core-image-minimal.bb
-
-# Changing the image compression from gz to lzma achieves 30% saving (~3M).
-# However, the current u-boot does not have lzma enabled. Stick to gz
-# until we generate a new u-boot image.
-IMAGE_FSTYPES += "cpio.lzma.u-boot"
-UBOOT_IMAGE_ENTRYPOINT = "0x40800000"
-
-PYTHON_PKGS = " \
- python-core \
- python-io \
- python-json \
- python-shell \
- python-subprocess \
- python-argparse \
- python-ctypes \
- python-datetime \
- python-email \
- python-threading \
- python-mime \
- python-pickle \
- python-misc \
- python-netserver \
- "
-
-NTP_PKGS = " \
- ntp \
- ntp-utils \
- sntp \
- ntpdate \
- "
-
-# Include modules in rootfs
-IMAGE_INSTALL += " \
- kernel-modules \
- u-boot \
- u-boot-fw-utils \
- openbmc-utils \
- fan-ctrl \
- rackmon \
- watchdog-ctrl \
- i2c-tools \
- sensor-setup \
- usb-console \
- oob-nic \
- lldp-util \
- bmc-log \
- lmsensors-sensors \
- wedge-eeprom \
- sms-kcsd \
- rest-api \
- cherryPy \
- bottle \
- ipmid \
- po-eeprom \
- bitbang \
- ${PYTHON_PKGS} \
- ${NTP_PKGS} \
- iproute2 \
- dhcp-client \
- spatula \
- "
-
-IMAGE_FEATURES += " \
- ssh-server-openssh \
- tools-debug \
- "
-
-DISTRO_FEATURES += " \
- ext2 \
- ipv6 \
- nfs \
- usbgadget \
- usbhost \
- "
diff --git a/meta-facebook/meta-wedge/recipes-core/init-ifupdown/files/interfaces b/meta-facebook/meta-wedge/recipes-core/init-ifupdown/files/interfaces
deleted file mode 100644
index 36e342e..0000000
--- a/meta-facebook/meta-wedge/recipes-core/init-ifupdown/files/interfaces
+++ /dev/null
@@ -1,11 +0,0 @@
-# The loopback interface
-auto lo
-iface lo inet loopback
-
-auto eth0
-iface eth0 inet dhcp
-
-auto usb0
-iface usb0 inet6 static
- address fe80::1
- netmask 64
diff --git a/meta-facebook/meta-wedge/recipes-core/init-ifupdown/init-ifupdown_%.bbappend b/meta-facebook/meta-wedge/recipes-core/init-ifupdown/init-ifupdown_%.bbappend
deleted file mode 100644
index 7d74521..0000000
--- a/meta-facebook/meta-wedge/recipes-core/init-ifupdown/init-ifupdown_%.bbappend
+++ /dev/null
@@ -1,2 +0,0 @@
-
-FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
diff --git a/meta-facebook/meta-wedge/recipes-core/sysvinit/sysvinit-inittab_%.bbappend b/meta-facebook/meta-wedge/recipes-core/sysvinit/sysvinit-inittab_%.bbappend
deleted file mode 100644
index 0a6d604..0000000
--- a/meta-facebook/meta-wedge/recipes-core/sysvinit/sysvinit-inittab_%.bbappend
+++ /dev/null
@@ -1,5 +0,0 @@
-# ttyS0 is UART5, connected to the debug board, selected by GPIOB2
-# ttyS1 is UART1, connected to uS, selected by GPIOB2
-# ttyS2 is UART3, connected to the front panel Console port
-# ttyS3 is UART4, used as RS485 connected as rackmon
-SERIAL_CONSOLES += "57600;ttyS0 9600;ttyS2"
diff --git a/meta-facebook/meta-wedge/recipes-kernel/linux/files/defconfig b/meta-facebook/meta-wedge/recipes-kernel/linux/files/defconfig
deleted file mode 100644
index 41fe288..0000000
--- a/meta-facebook/meta-wedge/recipes-kernel/linux/files/defconfig
+++ /dev/null
@@ -1,1480 +0,0 @@
-#
-# Automatically generated make config: don't edit
-# Linux kernel version: 2.6.28.9
-# Tue Feb 3 16:41:40 2015
-#
-CONFIG_ARM=y
-CONFIG_SYS_SUPPORTS_APM_EMULATION=y
-CONFIG_GENERIC_GPIO=y
-CONFIG_GENERIC_TIME=y
-CONFIG_GENERIC_CLOCKEVENTS=y
-CONFIG_MMU=y
-# CONFIG_NO_IOPORT is not set
-CONFIG_GENERIC_HARDIRQS=y
-CONFIG_STACKTRACE_SUPPORT=y
-CONFIG_HAVE_LATENCYTOP_SUPPORT=y
-CONFIG_LOCKDEP_SUPPORT=y
-CONFIG_TRACE_IRQFLAGS_SUPPORT=y
-CONFIG_HARDIRQS_SW_RESEND=y
-CONFIG_GENERIC_IRQ_PROBE=y
-CONFIG_RWSEM_GENERIC_SPINLOCK=y
-# CONFIG_ARCH_HAS_ILOG2_U32 is not set
-# CONFIG_ARCH_HAS_ILOG2_U64 is not set
-CONFIG_GENERIC_HWEIGHT=y
-CONFIG_GENERIC_CALIBRATE_DELAY=y
-CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
-CONFIG_VECTORS_BASE=0xffff0000
-CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
-
-#
-# General setup
-#
-CONFIG_EXPERIMENTAL=y
-CONFIG_BROKEN_ON_SMP=y
-CONFIG_INIT_ENV_ARG_LIMIT=32
-CONFIG_LOCALVERSION=""
-# CONFIG_LOCALVERSION_AUTO is not set
-CONFIG_KERNEL_GZIP=y
-# CONFIG_KERNEL_BZIP2 is not set
-# CONFIG_KERNEL_LZMA is not set
-CONFIG_SWAP=y
-CONFIG_SYSVIPC=y
-CONFIG_SYSVIPC_SYSCTL=y
-# CONFIG_POSIX_MQUEUE is not set
-# CONFIG_BSD_PROCESS_ACCT is not set
-# CONFIG_TASKSTATS is not set
-# CONFIG_AUDIT is not set
-CONFIG_IKCONFIG=m
-CONFIG_IKCONFIG_PROC=y
-CONFIG_LOG_BUF_SHIFT=16
-# CONFIG_CGROUPS is not set
-# CONFIG_GROUP_SCHED is not set
-CONFIG_SYSFS_DEPRECATED=y
-CONFIG_SYSFS_DEPRECATED_V2=y
-# CONFIG_RELAY is not set
-CONFIG_NAMESPACES=y
-# CONFIG_UTS_NS is not set
-# CONFIG_IPC_NS is not set
-# CONFIG_USER_NS is not set
-# CONFIG_PID_NS is not set
-CONFIG_BLK_DEV_INITRD=y
-CONFIG_INITRAMFS_SOURCE=""
-CONFIG_CC_OPTIMIZE_FOR_SIZE=y
-CONFIG_SYSCTL=y
-CONFIG_ANON_INODES=y
-# CONFIG_EMBEDDED is not set
-CONFIG_UID16=y
-CONFIG_SYSCTL_SYSCALL=y
-CONFIG_KALLSYMS=y
-CONFIG_KALLSYMS_EXTRA_PASS=y
-CONFIG_HOTPLUG=y
-CONFIG_PRINTK=y
-CONFIG_BUG=y
-CONFIG_ELF_CORE=y
-CONFIG_BASE_FULL=y
-CONFIG_FUTEX=y
-CONFIG_EPOLL=y
-CONFIG_SIGNALFD=y
-CONFIG_TIMERFD=y
-CONFIG_EVENTFD=y
-CONFIG_SHMEM=y
-CONFIG_AIO=y
-CONFIG_VM_EVENT_COUNTERS=y
-CONFIG_SLUB_DEBUG=y
-CONFIG_COMPAT_BRK=y
-# CONFIG_SLAB is not set
-CONFIG_SLUB=y
-# CONFIG_SLOB is not set
-# CONFIG_PROFILING is not set
-# CONFIG_MARKERS is not set
-CONFIG_HAVE_OPROFILE=y
-# CONFIG_KPROBES is not set
-CONFIG_HAVE_KPROBES=y
-CONFIG_HAVE_KRETPROBES=y
-CONFIG_HAVE_GENERIC_DMA_COHERENT=y
-CONFIG_SLABINFO=y
-CONFIG_RT_MUTEXES=y
-# CONFIG_TINY_SHMEM is not set
-CONFIG_BASE_SMALL=0
-CONFIG_MODULES=y
-# CONFIG_MODULE_FORCE_LOAD is not set
-CONFIG_MODULE_UNLOAD=y
-# CONFIG_MODULE_FORCE_UNLOAD is not set
-# CONFIG_MODVERSIONS is not set
-# CONFIG_MODULE_SRCVERSION_ALL is not set
-CONFIG_KMOD=y
-CONFIG_BLOCK=y
-# CONFIG_LBD is not set
-# CONFIG_BLK_DEV_IO_TRACE is not set
-# CONFIG_LSF is not set
-# CONFIG_BLK_DEV_BSG is not set
-# CONFIG_BLK_DEV_INTEGRITY is not set
-
-#
-# IO Schedulers
-#
-CONFIG_IOSCHED_NOOP=y
-CONFIG_IOSCHED_AS=y
-CONFIG_IOSCHED_DEADLINE=y
-CONFIG_IOSCHED_CFQ=y
-# CONFIG_DEFAULT_AS is not set
-# CONFIG_DEFAULT_DEADLINE is not set
-CONFIG_DEFAULT_CFQ=y
-# CONFIG_DEFAULT_NOOP is not set
-CONFIG_DEFAULT_IOSCHED="cfq"
-CONFIG_CLASSIC_RCU=y
-CONFIG_FREEZER=y
-
-#
-# System Type
-#
-CONFIG_ARCH_ASPEED=y
-# CONFIG_ARCH_AAEC2000 is not set
-# CONFIG_ARCH_INTEGRATOR is not set
-# CONFIG_ARCH_REALVIEW is not set
-# CONFIG_ARCH_VERSATILE is not set
-# CONFIG_ARCH_AT91 is not set
-# CONFIG_ARCH_CLPS7500 is not set
-# CONFIG_ARCH_CLPS711X is not set
-# CONFIG_ARCH_EBSA110 is not set
-# CONFIG_ARCH_EP93XX is not set
-# CONFIG_ARCH_FOOTBRIDGE is not set
-# CONFIG_ARCH_NETX is not set
-# CONFIG_ARCH_H720X is not set
-# CONFIG_ARCH_IMX is not set
-# CONFIG_ARCH_IOP13XX is not set
-# CONFIG_ARCH_IOP32X is not set
-# CONFIG_ARCH_IOP33X is not set
-# CONFIG_ARCH_IXP23XX is not set
-# CONFIG_ARCH_IXP2000 is not set
-# CONFIG_ARCH_IXP4XX is not set
-# CONFIG_ARCH_L7200 is not set
-# CONFIG_ARCH_KIRKWOOD is not set
-# CONFIG_ARCH_KS8695 is not set
-# CONFIG_ARCH_NS9XXX is not set
-# CONFIG_ARCH_LOKI is not set
-# CONFIG_ARCH_MV78XX0 is not set
-# CONFIG_ARCH_MXC is not set
-# CONFIG_ARCH_ORION5X is not set
-# CONFIG_ARCH_PNX4008 is not set
-# CONFIG_ARCH_PXA is not set
-# CONFIG_ARCH_RPC is not set
-# CONFIG_ARCH_SA1100 is not set
-# CONFIG_ARCH_S3C2410 is not set
-# CONFIG_ARCH_SHARK is not set
-# CONFIG_ARCH_LH7A40X is not set
-# CONFIG_ARCH_DAVINCI is not set
-# CONFIG_ARCH_OMAP is not set
-# CONFIG_ARCH_MSM is not set
-CONFIG_IRMP=y
-# CONFIG_PCEXT is not set
-# CONFIG_REMOTEFX is not set
-# CONFIG_ARCH_AST1100 is not set
-# CONFIG_ARCH_AST2100 is not set
-# CONFIG_ARCH_AST2200 is not set
-# CONFIG_ARCH_AST2300 is not set
-CONFIG_ARCH_AST2400=y
-CONFIG_WEDGE=y
-# CONFIG_ARCH_AST2500 is not set
-
-#
-# FLASH Chip Select
-#
-# CONFIG_AST_CS0_NOR is not set
-# CONFIG_AST_CS0_NAND is not set
-CONFIG_AST_CS0_SPI=y
-# CONFIG_AST_CS0_NONE is not set
-# CONFIG_AST_CS1_NOR is not set
-# CONFIG_AST_CS1_NAND is not set
-# CONFIG_AST_CS1_SPI is not set
-CONFIG_AST_CS1_NONE=y
-# CONFIG_AST_CS2_NOR is not set
-# CONFIG_AST_CS2_NAND is not set
-# CONFIG_AST_CS2_SPI is not set
-CONFIG_AST_CS2_NONE=y
-# CONFIG_AST_CS3_NOR is not set
-# CONFIG_AST_CS3_NAND is not set
-# CONFIG_AST_CS3_SPI is not set
-CONFIG_AST_CS3_NONE=y
-# CONFIG_AST_CS4_NOR is not set
-# CONFIG_AST_CS4_NAND is not set
-# CONFIG_AST_CS4_SPI is not set
-CONFIG_AST_CS4_NONE=y
-# CONFIG_ARCH_AST1070 is not set
-# CONFIG_AST_SCU_LOCK is not set
-
-#
-# Boot options
-#
-
-#
-# Power management
-#
-CONFIG_PLAT_ASPEED=y
-
-#
-# Processor Type
-#
-CONFIG_CPU_32=y
-CONFIG_CPU_ARM926T=y
-CONFIG_CPU_32v5=y
-CONFIG_CPU_ABRT_EV5TJ=y
-CONFIG_CPU_PABRT_NOIFAR=y
-CONFIG_CPU_CACHE_VIVT=y
-CONFIG_CPU_COPY_V4WB=y
-CONFIG_CPU_TLB_V4WBI=y
-CONFIG_CPU_CP15=y
-CONFIG_CPU_CP15_MMU=y
-
-#
-# Processor Features
-#
-CONFIG_ARM_THUMB=y
-# CONFIG_CPU_ICACHE_DISABLE is not set
-# CONFIG_CPU_DCACHE_DISABLE is not set
-# CONFIG_CPU_DCACHE_WRITETHROUGH is not set
-# CONFIG_CPU_CACHE_ROUND_ROBIN is not set
-# CONFIG_OUTER_CACHE is not set
-
-#
-# Bus support
-#
-CONFIG_ARM_AMBA=y
-# CONFIG_PCI_SYSCALL is not set
-# CONFIG_ARCH_SUPPORTS_MSI is not set
-# CONFIG_PCCARD is not set
-
-#
-# Kernel Features
-#
-CONFIG_TICK_ONESHOT=y
-CONFIG_NO_HZ=y
-CONFIG_HIGH_RES_TIMERS=y
-CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
-CONFIG_VMSPLIT_3G=y
-# CONFIG_VMSPLIT_2G is not set
-# CONFIG_VMSPLIT_1G is not set
-CONFIG_PAGE_OFFSET=0xC0000000
-# CONFIG_PREEMPT is not set
-CONFIG_HZ=100
-CONFIG_AEABI=y
-CONFIG_OABI_COMPAT=y
-CONFIG_ARCH_FLATMEM_HAS_HOLES=y
-# CONFIG_ARCH_SPARSEMEM_DEFAULT is not set
-# CONFIG_ARCH_SELECT_MEMORY_MODEL is not set
-CONFIG_SELECT_MEMORY_MODEL=y
-CONFIG_FLATMEM_MANUAL=y
-# CONFIG_DISCONTIGMEM_MANUAL is not set
-# CONFIG_SPARSEMEM_MANUAL is not set
-CONFIG_FLATMEM=y
-CONFIG_FLAT_NODE_MEM_MAP=y
-CONFIG_PAGEFLAGS_EXTENDED=y
-CONFIG_SPLIT_PTLOCK_CPUS=4096
-# CONFIG_RESOURCES_64BIT is not set
-# CONFIG_PHYS_ADDR_T_64BIT is not set
-CONFIG_ZONE_DMA_FLAG=0
-CONFIG_VIRT_TO_BUS=y
-CONFIG_UNEVICTABLE_LRU=y
-CONFIG_ALIGNMENT_TRAP=y
-
-#
-# Boot options
-#
-CONFIG_ZBOOT_ROM_TEXT=0
-CONFIG_ZBOOT_ROM_BSS=0
-CONFIG_CMDLINE=""
-# CONFIG_XIP_KERNEL is not set
-# CONFIG_KEXEC is not set
-
-#
-# CPU Power Management
-#
-# CONFIG_CPU_IDLE is not set
-
-#
-# Floating point emulation
-#
-
-#
-# At least one emulation must be selected
-#
-CONFIG_FPE_NWFPE=y
-CONFIG_FPE_NWFPE_XP=y
-# CONFIG_FPE_FASTFPE is not set
-CONFIG_VFP=y
-
-#
-# Userspace binary formats
-#
-CONFIG_BINFMT_ELF=y
-# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
-CONFIG_HAVE_AOUT=y
-CONFIG_BINFMT_AOUT=y
-# CONFIG_BINFMT_MISC is not set
-
-#
-# Power management options
-#
-CONFIG_PM=y
-# CONFIG_PM_DEBUG is not set
-CONFIG_PM_SLEEP=y
-CONFIG_SUSPEND=y
-CONFIG_SUSPEND_FREEZER=y
-# CONFIG_APM_EMULATION is not set
-CONFIG_ARCH_SUSPEND_POSSIBLE=y
-CONFIG_NET=y
-
-#
-# Networking options
-#
-CONFIG_PACKET=y
-# CONFIG_PACKET_MMAP is not set
-CONFIG_UNIX=y
-CONFIG_XFRM=y
-# CONFIG_XFRM_USER is not set
-# CONFIG_XFRM_SUB_POLICY is not set
-# CONFIG_XFRM_MIGRATE is not set
-# CONFIG_XFRM_STATISTICS is not set
-# CONFIG_NET_KEY is not set
-CONFIG_INET=y
-CONFIG_IP_MULTICAST=y
-# CONFIG_IP_ADVANCED_ROUTER is not set
-CONFIG_IP_FIB_HASH=y
-CONFIG_IP_PNP=y
-CONFIG_IP_PNP_DHCP=y
-CONFIG_IP_PNP_BOOTP=y
-# CONFIG_IP_PNP_RARP is not set
-# CONFIG_NET_IPIP is not set
-# CONFIG_NET_IPGRE is not set
-# CONFIG_IP_MROUTE is not set
-# CONFIG_ARPD is not set
-# CONFIG_SYN_COOKIES is not set
-# CONFIG_INET_AH is not set
-# CONFIG_INET_ESP is not set
-# CONFIG_INET_IPCOMP is not set
-# CONFIG_INET_XFRM_TUNNEL is not set
-CONFIG_INET_TUNNEL=m
-CONFIG_INET_XFRM_MODE_TRANSPORT=y
-CONFIG_INET_XFRM_MODE_TUNNEL=y
-CONFIG_INET_XFRM_MODE_BEET=y
-# CONFIG_INET_LRO is not set
-CONFIG_INET_DIAG=y
-CONFIG_INET_TCP_DIAG=y
-# CONFIG_TCP_CONG_ADVANCED is not set
-CONFIG_TCP_CONG_CUBIC=y
-CONFIG_DEFAULT_TCP_CONG="cubic"
-# CONFIG_TCP_MD5SIG is not set
-CONFIG_IPV6=m
-# CONFIG_IPV6_PRIVACY is not set
-# CONFIG_IPV6_ROUTER_PREF is not set
-# CONFIG_IPV6_OPTIMISTIC_DAD is not set
-# CONFIG_INET6_AH is not set
-# CONFIG_INET6_ESP is not set
-# CONFIG_INET6_IPCOMP is not set
-# CONFIG_IPV6_MIP6 is not set
-# CONFIG_INET6_XFRM_TUNNEL is not set
-# CONFIG_INET6_TUNNEL is not set
-CONFIG_INET6_XFRM_MODE_TRANSPORT=m
-CONFIG_INET6_XFRM_MODE_TUNNEL=m
-CONFIG_INET6_XFRM_MODE_BEET=m
-# CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION is not set
-CONFIG_IPV6_SIT=m
-CONFIG_IPV6_NDISC_NODETYPE=y
-# CONFIG_IPV6_TUNNEL is not set
-# CONFIG_IPV6_MULTIPLE_TABLES is not set
-# CONFIG_IPV6_MROUTE is not set
-# CONFIG_NETWORK_SECMARK is not set
-# CONFIG_NETFILTER is not set
-# CONFIG_IP_DCCP is not set
-# CONFIG_IP_SCTP is not set
-# CONFIG_TIPC is not set
-# CONFIG_ATM is not set
-# CONFIG_BRIDGE is not set
-# CONFIG_NET_DSA is not set
-CONFIG_VLAN_8021Q=m
-# CONFIG_VLAN_8021Q_GVRP is not set
-# CONFIG_DECNET is not set
-# CONFIG_LLC2 is not set
-# CONFIG_IPX is not set
-# CONFIG_ATALK is not set
-# CONFIG_X25 is not set
-# CONFIG_LAPB is not set
-# CONFIG_ECONET is not set
-CONFIG_WAN_ROUTER=y
-# CONFIG_NET_SCHED is not set
-
-#
-# Network testing
-#
-# CONFIG_NET_PKTGEN is not set
-# CONFIG_HAMRADIO is not set
-# CONFIG_CAN is not set
-# CONFIG_IRDA is not set
-# CONFIG_BT is not set
-# CONFIG_AF_RXRPC is not set
-# CONFIG_PHONET is not set
-# CONFIG_WIRELESS is not set
-# CONFIG_RFKILL is not set
-# CONFIG_NET_9P is not set
-
-#
-# Device Drivers
-#
-
-#
-# Generic Driver Options
-#
-CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
-CONFIG_STANDALONE=y
-CONFIG_PREVENT_FIRMWARE_BUILD=y
-CONFIG_FW_LOADER=y
-CONFIG_FIRMWARE_IN_KERNEL=y
-CONFIG_EXTRA_FIRMWARE=""
-# CONFIG_SYS_HYPERVISOR is not set
-CONFIG_CONNECTOR=y
-CONFIG_PROC_EVENTS=y
-CONFIG_MTD=y
-# CONFIG_MTD_DEBUG is not set
-CONFIG_MTD_CONCAT=y
-CONFIG_MTD_PARTITIONS=y
-# CONFIG_MTD_REDBOOT_PARTS is not set
-CONFIG_MTD_CMDLINE_PARTS=y
-# CONFIG_MTD_AFS_PARTS is not set
-# CONFIG_MTD_AR7_PARTS is not set
-
-#
-# User Modules And Translation Layers
-#
-CONFIG_MTD_CHAR=y
-CONFIG_MTD_BLKDEVS=y
-CONFIG_MTD_BLOCK=y
-# CONFIG_FTL is not set
-# CONFIG_NFTL is not set
-# CONFIG_INFTL is not set
-# CONFIG_RFD_FTL is not set
-# CONFIG_SSFDC is not set
-# CONFIG_MTD_OOPS is not set
-
-#
-# RAM/ROM/Flash chip drivers
-#
-# CONFIG_MTD_CFI is not set
-# CONFIG_MTD_JEDECPROBE is not set
-CONFIG_MTD_MAP_BANK_WIDTH_1=y
-CONFIG_MTD_MAP_BANK_WIDTH_2=y
-CONFIG_MTD_MAP_BANK_WIDTH_4=y
-# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
-# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
-# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
-CONFIG_MTD_CFI_I1=y
-CONFIG_MTD_CFI_I2=y
-# CONFIG_MTD_CFI_I4 is not set
-# CONFIG_MTD_CFI_I8 is not set
-# CONFIG_MTD_RAM is not set
-# CONFIG_MTD_ROM is not set
-# CONFIG_MTD_ABSENT is not set
-
-#
-# Mapping drivers for chip access
-#
-# CONFIG_MTD_COMPLEX_MAPPINGS is not set
-# CONFIG_MTD_PLATRAM is not set
-
-#
-# Self-contained MTD device drivers
-#
-CONFIG_MTD_DATAFLASH=m
-CONFIG_MTD_DATAFLASH_WRITE_VERIFY=y
-# CONFIG_MTD_DATAFLASH_OTP is not set
-CONFIG_MTD_M25P80=y
-CONFIG_M25PXX_USE_FAST_READ=y
-# CONFIG_MTD_SLRAM is not set
-# CONFIG_MTD_PHRAM is not set
-# CONFIG_MTD_MTDRAM is not set
-# CONFIG_MTD_BLOCK2MTD is not set
-
-#
-# Disk-On-Chip Device Drivers
-#
-# CONFIG_MTD_DOC2000 is not set
-# CONFIG_MTD_DOC2001 is not set
-# CONFIG_MTD_DOC2001PLUS is not set
-# CONFIG_MTD_NAND is not set
-# CONFIG_MTD_ONENAND is not set
-
-#
-# UBI - Unsorted block images
-#
-# CONFIG_MTD_UBI is not set
-# CONFIG_PARPORT is not set
-CONFIG_BLK_DEV=y
-# CONFIG_BLK_DEV_COW_COMMON is not set
-CONFIG_BLK_DEV_LOOP=y
-# CONFIG_BLK_DEV_CRYPTOLOOP is not set
-CONFIG_BLK_DEV_NBD=y
-# CONFIG_BLK_DEV_UB is not set
-CONFIG_BLK_DEV_RAM=y
-CONFIG_BLK_DEV_RAM_COUNT=16
-CONFIG_BLK_DEV_RAM_SIZE=16384
-# CONFIG_BLK_DEV_XIP is not set
-# CONFIG_RD_BZIP2 is not set
-CONFIG_RD_LZMA=y
-CONFIG_RD_GZIP=y
-# CONFIG_CDROM_PKTCDVD is not set
-# CONFIG_ATA_OVER_ETH is not set
-CONFIG_MISC_DEVICES=y
-# CONFIG_EEPROM_93CX6 is not set
-# CONFIG_ICS932S401 is not set
-# CONFIG_ENCLOSURE_SERVICES is not set
-# CONFIG_C2PORT is not set
-CONFIG_HAVE_IDE=y
-# CONFIG_IDE is not set
-
-#
-# SCSI device support
-#
-# CONFIG_RAID_ATTRS is not set
-CONFIG_SCSI=y
-CONFIG_SCSI_DMA=y
-CONFIG_SCSI_TGT=y
-# CONFIG_SCSI_NETLINK is not set
-CONFIG_SCSI_PROC_FS=y
-
-#
-# SCSI support type (disk, tape, CD-ROM)
-#
-CONFIG_BLK_DEV_SD=y
-# CONFIG_CHR_DEV_ST is not set
-# CONFIG_CHR_DEV_OSST is not set
-# CONFIG_BLK_DEV_SR is not set
-CONFIG_CHR_DEV_SG=y
-# CONFIG_CHR_DEV_SCH is not set
-
-#
-# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
-#
-# CONFIG_SCSI_MULTI_LUN is not set
-# CONFIG_SCSI_CONSTANTS is not set
-# CONFIG_SCSI_LOGGING is not set
-CONFIG_SCSI_SCAN_ASYNC=y
-CONFIG_SCSI_WAIT_SCAN=m
-
-#
-# SCSI Transports
-#
-# CONFIG_SCSI_SPI_ATTRS is not set
-# CONFIG_SCSI_FC_ATTRS is not set
-CONFIG_SCSI_ISCSI_ATTRS=m
-# CONFIG_SCSI_SAS_LIBSAS is not set
-# CONFIG_SCSI_SRP_ATTRS is not set
-# CONFIG_SCSI_LOWLEVEL is not set
-# CONFIG_SCSI_DH is not set
-# CONFIG_ATA is not set
-# CONFIG_MD is not set
-CONFIG_NETDEVICES=y
-# CONFIG_DUMMY is not set
-CONFIG_BONDING=m
-# CONFIG_MACVLAN is not set
-# CONFIG_EQUALIZER is not set
-CONFIG_TUN=m
-# CONFIG_VETH is not set
-# CONFIG_NET_ETHERNET is not set
-CONFIG_NETDEV_1000=y
-CONFIG_ASPEEDMAC=y
-# CONFIG_NETDEV_10000 is not set
-
-#
-# Wireless LAN
-#
-# CONFIG_WLAN_PRE80211 is not set
-# CONFIG_WLAN_80211 is not set
-# CONFIG_IWLWIFI_LEDS is not set
-
-#
-# USB Network Adapters
-#
-# CONFIG_USB_CATC is not set
-# CONFIG_USB_KAWETH is not set
-# CONFIG_USB_PEGASUS is not set
-# CONFIG_USB_RTL8150 is not set
-# CONFIG_USB_USBNET is not set
-# CONFIG_WAN is not set
-# CONFIG_PPP is not set
-# CONFIG_SLIP is not set
-# CONFIG_NETCONSOLE is not set
-# CONFIG_NETPOLL is not set
-# CONFIG_NET_POLL_CONTROLLER is not set
-# CONFIG_ISDN is not set
-
-#
-# Input device support
-#
-CONFIG_INPUT=y
-# CONFIG_INPUT_FF_MEMLESS is not set
-# CONFIG_INPUT_POLLDEV is not set
-
-#
-# Userland interfaces
-#
-CONFIG_INPUT_MOUSEDEV=y
-CONFIG_INPUT_MOUSEDEV_PSAUX=y
-CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
-CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
-# CONFIG_INPUT_JOYDEV is not set
-CONFIG_INPUT_EVDEV=y
-# CONFIG_INPUT_EVBUG is not set
-
-#
-# Input Device Drivers
-#
-CONFIG_INPUT_KEYBOARD=y
-CONFIG_KEYBOARD_ATKBD=y
-# CONFIG_KEYBOARD_SUNKBD is not set
-# CONFIG_KEYBOARD_LKKBD is not set
-# CONFIG_KEYBOARD_XTKBD is not set
-# CONFIG_KEYBOARD_NEWTON is not set
-# CONFIG_KEYBOARD_STOWAWAY is not set
-# CONFIG_KEYBOARD_GPIO is not set
-CONFIG_INPUT_MOUSE=y
-CONFIG_MOUSE_PS2=y
-CONFIG_MOUSE_PS2_ALPS=y
-CONFIG_MOUSE_PS2_LOGIPS2PP=y
-CONFIG_MOUSE_PS2_SYNAPTICS=y
-CONFIG_MOUSE_PS2_LIFEBOOK=y
-CONFIG_MOUSE_PS2_TRACKPOINT=y
-# CONFIG_MOUSE_PS2_ELANTECH is not set
-# CONFIG_MOUSE_PS2_TOUCHKIT is not set
-CONFIG_MOUSE_SERIAL=y
-# CONFIG_MOUSE_APPLETOUCH is not set
-# CONFIG_MOUSE_BCM5974 is not set
-# CONFIG_MOUSE_VSXXXAA is not set
-# CONFIG_MOUSE_GPIO is not set
-# CONFIG_INPUT_JOYSTICK is not set
-# CONFIG_INPUT_TABLET is not set
-# CONFIG_INPUT_TOUCHSCREEN is not set
-# CONFIG_INPUT_MISC is not set
-
-#
-# Hardware I/O ports
-#
-CONFIG_SERIO=y
-CONFIG_SERIO_SERPORT=y
-# CONFIG_SERIO_AMBAKMI is not set
-CONFIG_SERIO_LIBPS2=y
-# CONFIG_SERIO_RAW is not set
-# CONFIG_GAMEPORT is not set
-
-#
-# Character devices
-#
-CONFIG_VT=y
-CONFIG_CONSOLE_TRANSLATIONS=y
-CONFIG_VT_CONSOLE=y
-CONFIG_HW_CONSOLE=y
-# CONFIG_VT_HW_CONSOLE_BINDING is not set
-CONFIG_DEVKMEM=y
-CONFIG_SERIAL_NONSTANDARD=y
-# CONFIG_N_HDLC is not set
-# CONFIG_RISCOM8 is not set
-# CONFIG_SPECIALIX is not set
-# CONFIG_RIO is not set
-# CONFIG_STALDRV is not set
-
-#
-# Serial drivers
-#
-CONFIG_SERIAL_8250=y
-CONFIG_SERIAL_8250_CONSOLE=y
-CONFIG_SERIAL_8250_NR_UARTS=4
-CONFIG_SERIAL_8250_RUNTIME_UARTS=4
-# CONFIG_SERIAL_AST_DMA_UART is not set
-# CONFIG_SERIAL_8250_EXTENDED is not set
-
-#
-# Non-8250 serial port support
-#
-# CONFIG_SERIAL_AMBA_PL010 is not set
-# CONFIG_SERIAL_AMBA_PL011 is not set
-# CONFIG_SERIAL_AST is not set
-CONFIG_SERIAL_CORE=y
-CONFIG_SERIAL_CORE_CONSOLE=y
-CONFIG_UNIX98_PTYS=y
-CONFIG_LEGACY_PTYS=y
-CONFIG_LEGACY_PTY_COUNT=256
-# CONFIG_IPMI_HANDLER is not set
-CONFIG_AST_MISC=y
-# CONFIG_AST_VIDEO is not set
-# CONFIG_ADC_CAT9883 is not set
-# CONFIG_AST_SPI_BIOS is not set
-CONFIG_AST_PECI=y
-# CONFIG_AST_KCS is not set
-# CONFIG_AST_GPIO is not set
-# CONFIG_HW_RANDOM is not set
-CONFIG_NVRAM=y
-# CONFIG_R3964 is not set
-# CONFIG_RAW_DRIVER is not set
-# CONFIG_TCG_TPM is not set
-CONFIG_I2C=y
-CONFIG_I2C_BOARDINFO=y
-CONFIG_I2C_CHARDEV=y
-CONFIG_I2C_HELPER_AUTO=y
-
-#
-# I2C Hardware Bus support
-#
-
-#
-# I2C system bus drivers (mostly embedded / system-on-chip)
-#
-# CONFIG_I2C_GPIO is not set
-# CONFIG_I2C_OCORES is not set
-CONFIG_I2C_AST=y
-CONFIG_AST_I2C_SLAVE_MODE=y
-CONFIG_AST_I2C_SLAVE_EEPROM=y
-# CONFIG_AST_I2C_SLAVE_RDWR is not set
-# CONFIG_I2C_SIMTEC is not set
-
-#
-# External I2C/SMBus adapter drivers
-#
-# CONFIG_I2C_PARPORT_LIGHT is not set
-# CONFIG_I2C_TAOS_EVM is not set
-# CONFIG_I2C_TINY_USB is not set
-
-#
-# Other I2C/SMBus bus drivers
-#
-# CONFIG_I2C_PCA_PLATFORM is not set
-# CONFIG_I2C_STUB is not set
-
-#
-# Miscellaneous I2C Chip support
-#
-# CONFIG_DS1682 is not set
-CONFIG_AT24=m
-# CONFIG_SENSORS_EEPROM is not set
-CONFIG_SENSORS_PCF8574=m
-# CONFIG_PCF8575 is not set
-# CONFIG_SENSORS_PCA9539 is not set
-# CONFIG_SENSORS_PCF8591 is not set
-# CONFIG_TPS65010 is not set
-# CONFIG_SENSORS_MAX6875 is not set
-# CONFIG_SENSORS_TSL2550 is not set
-# CONFIG_I2C_DEBUG_CORE is not set
-# CONFIG_I2C_DEBUG_ALGO is not set
-# CONFIG_I2C_DEBUG_BUS is not set
-# CONFIG_I2C_DEBUG_CHIP is not set
-CONFIG_SPI=y
-CONFIG_SPI_MASTER=y
-
-#
-# SPI Master Controller Drivers
-#
-CONFIG_SPI_AST=y
-CONFIG_SPI_FMC=y
-CONFIG_SPI_BITBANG=y
-
-#
-# SPI Protocol Masters
-#
-CONFIG_SPI_AT25=m
-# CONFIG_SPI_SPIDEV is not set
-# CONFIG_SPI_TLE62X0 is not set
-CONFIG_ARCH_REQUIRE_GPIOLIB=y
-CONFIG_GPIOLIB=y
-CONFIG_GPIO_SYSFS=y
-
-#
-# Memory mapped GPIO expanders:
-#
-
-#
-# I2C GPIO expanders:
-#
-# CONFIG_GPIO_MAX732X is not set
-# CONFIG_GPIO_PCA953X is not set
-# CONFIG_GPIO_PCF857X is not set
-
-#
-# PCI GPIO expanders:
-#
-
-#
-# SPI GPIO expanders:
-#
-# CONFIG_GPIO_MAX7301 is not set
-# CONFIG_GPIO_MCP23S08 is not set
-# CONFIG_W1 is not set
-# CONFIG_POWER_SUPPLY is not set
-CONFIG_HWMON=y
-# CONFIG_HWMON_VID is not set
-# CONFIG_SENSORS_AD7414 is not set
-# CONFIG_SENSORS_AD7418 is not set
-# CONFIG_SENSORS_ADCXX is not set
-# CONFIG_SENSORS_ADM1021 is not set
-# CONFIG_SENSORS_ADM1025 is not set
-# CONFIG_SENSORS_ADM1026 is not set
-# CONFIG_SENSORS_ADM1029 is not set
-# CONFIG_SENSORS_ADM1031 is not set
-# CONFIG_SENSORS_ADM9240 is not set
-# CONFIG_SENSORS_ADT7462 is not set
-# CONFIG_SENSORS_ADT7470 is not set
-# CONFIG_SENSORS_ADT7473 is not set
-# CONFIG_SENSORS_ATXP1 is not set
-# CONFIG_SENSORS_DS1621 is not set
-# CONFIG_SENSORS_F71805F is not set
-# CONFIG_SENSORS_F71882FG is not set
-# CONFIG_SENSORS_F75375S is not set
-# CONFIG_SENSORS_GL518SM is not set
-# CONFIG_SENSORS_GL520SM is not set
-# CONFIG_SENSORS_IT87 is not set
-# CONFIG_SENSORS_LM63 is not set
-# CONFIG_SENSORS_LM70 is not set
-CONFIG_SENSORS_LM75=m
-# CONFIG_SENSORS_LM77 is not set
-# CONFIG_SENSORS_LM78 is not set
-# CONFIG_SENSORS_LM80 is not set
-# CONFIG_SENSORS_LM83 is not set
-# CONFIG_SENSORS_LM85 is not set
-# CONFIG_SENSORS_LM87 is not set
-# CONFIG_SENSORS_LM90 is not set
-# CONFIG_SENSORS_LM92 is not set
-# CONFIG_SENSORS_LM93 is not set
-CONFIG_SENSORS_MAX127=m
-# CONFIG_SENSORS_MAX1111 is not set
-# CONFIG_SENSORS_MAX1619 is not set
-# CONFIG_SENSORS_MAX6650 is not set
-# CONFIG_SENSORS_PC87360 is not set
-# CONFIG_SENSORS_PC87427 is not set
-# CONFIG_SENSORS_DME1737 is not set
-# CONFIG_SENSORS_SMSC47M1 is not set
-# CONFIG_SENSORS_SMSC47M192 is not set
-# CONFIG_SENSORS_SMSC47B397 is not set
-CONFIG_SENSORS_ADS7828=m
-# CONFIG_SENSORS_THMC50 is not set
-# CONFIG_SENSORS_VT1211 is not set
-# CONFIG_SENSORS_W83781D is not set
-# CONFIG_SENSORS_W83791D is not set
-# CONFIG_SENSORS_W83792D is not set
-# CONFIG_SENSORS_W83793 is not set
-# CONFIG_SENSORS_W83L785TS is not set
-# CONFIG_SENSORS_W83L786NG is not set
-# CONFIG_SENSORS_W83627HF is not set
-# CONFIG_SENSORS_W83627EHF is not set
-CONFIG_SENSORS_AST_ADC=y
-CONFIG_SENSORS_AST_PWM_FAN=y
-CONFIG_SENSORS_FB_PANTHER_PLUS=m
-CONFIG_PMBUS=m
-CONFIG_SENSORS_PMBUS=m
-CONFIG_SENSORS_ADM1275=m
-# CONFIG_SENSORS_LM25066 is not set
-# CONFIG_SENSORS_LTC2978 is not set
-# CONFIG_SENSORS_MAX16064 is not set
-# CONFIG_SENSORS_MAX34440 is not set
-# CONFIG_SENSORS_MAX8688 is not set
-CONFIG_SENSORS_PFE1100=m
-CONFIG_SENSORS_PFE3000=m
-# CONFIG_SENSORS_UCD9000 is not set
-# CONFIG_SENSORS_UCD9200 is not set
-# CONFIG_SENSORS_ZL6100 is not set
-# CONFIG_HWMON_DEBUG_CHIP is not set
-CONFIG_THERMAL=y
-CONFIG_THERMAL_HWMON=y
-CONFIG_WATCHDOG=y
-# CONFIG_WATCHDOG_NOWAYOUT is not set
-
-#
-# Watchdog Device Drivers
-#
-# CONFIG_SOFT_WATCHDOG is not set
-CONFIG_AST_WATCHDOG=y
-
-#
-# USB-based Watchdog Cards
-#
-# CONFIG_USBPCWATCHDOG is not set
-CONFIG_SSB_POSSIBLE=y
-
-#
-# Sonics Silicon Backplane
-#
-# CONFIG_SSB is not set
-
-#
-# Multifunction device drivers
-#
-# CONFIG_MFD_CORE is not set
-# CONFIG_MFD_SM501 is not set
-# CONFIG_MFD_ASIC3 is not set
-# CONFIG_HTC_EGPIO is not set
-# CONFIG_HTC_PASIC3 is not set
-# CONFIG_MFD_TMIO is not set
-# CONFIG_MFD_TC6393XB is not set
-# CONFIG_PMIC_DA903X is not set
-# CONFIG_MFD_WM8400 is not set
-# CONFIG_MFD_WM8350_I2C is not set
-
-#
-# Multimedia devices
-#
-
-#
-# Multimedia core support
-#
-# CONFIG_VIDEO_DEV is not set
-# CONFIG_DVB_CORE is not set
-# CONFIG_VIDEO_MEDIA is not set
-
-#
-# Multimedia drivers
-#
-# CONFIG_DAB is not set
-
-#
-# Graphics support
-#
-# CONFIG_VGASTATE is not set
-# CONFIG_VIDEO_OUTPUT_CONTROL is not set
-# CONFIG_FB is not set
-# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
-
-#
-# Display device support
-#
-# CONFIG_DISPLAY_SUPPORT is not set
-
-#
-# Console display driver support
-#
-# CONFIG_VGA_CONSOLE is not set
-CONFIG_DUMMY_CONSOLE=y
-# CONFIG_SOUND is not set
-# CONFIG_HID_SUPPORT is not set
-CONFIG_USB_SUPPORT=y
-CONFIG_USB_ARCH_HAS_HCD=y
-# CONFIG_USB_ARCH_HAS_OHCI is not set
-CONFIG_USB_ARCH_HAS_EHCI=y
-CONFIG_USB=m
-# CONFIG_USB_DEBUG is not set
-# CONFIG_USB_ANNOUNCE_NEW_DEVICES is not set
-
-#
-# Miscellaneous USB options
-#
-CONFIG_USB_DEVICEFS=y
-CONFIG_USB_DEVICE_CLASS=y
-# CONFIG_USB_DYNAMIC_MINORS is not set
-# CONFIG_USB_SUSPEND is not set
-# CONFIG_USB_OTG is not set
-# CONFIG_USB_MON is not set
-# CONFIG_USB_WUSB is not set
-# CONFIG_USB_WUSB_CBAF is not set
-
-#
-# USB Host Controller Drivers
-#
-# CONFIG_USB_C67X00_HCD is not set
-# CONFIG_USB_EHCI_HCD is not set
-# CONFIG_USB_ISP116X_HCD is not set
-# CONFIG_USB_SL811_HCD is not set
-# CONFIG_USB_R8A66597_HCD is not set
-# CONFIG_USB_HWA_HCD is not set
-
-#
-# AST USB Drivers
-#
-CONFIG_AST_USB_UHCI_HCD=y
-# CONFIG_AST_USB_UHCI_MULTIPORT_1 is not set
-# CONFIG_AST_USB_UHCI_MULTIPORT_2 is not set
-CONFIG_AST_USB_UHCI_MULTIPORT_4=y
-# CONFIG_USB_EHCI_SPLIT_ISO is not set
-
-#
-# USB Device Class drivers
-#
-# CONFIG_USB_ACM is not set
-# CONFIG_USB_PRINTER is not set
-# CONFIG_USB_WDM is not set
-# CONFIG_USB_TMC is not set
-
-#
-# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may also be needed;
-#
-
-#
-# see USB_STORAGE Help for more information
-#
-CONFIG_USB_STORAGE=m
-# CONFIG_USB_STORAGE_DEBUG is not set
-# CONFIG_USB_STORAGE_DATAFAB is not set
-# CONFIG_USB_STORAGE_FREECOM is not set
-# CONFIG_USB_STORAGE_ISD200 is not set
-# CONFIG_USB_STORAGE_DPCM is not set
-# CONFIG_USB_STORAGE_USBAT is not set
-# CONFIG_USB_STORAGE_SDDR09 is not set
-# CONFIG_USB_STORAGE_SDDR55 is not set
-# CONFIG_USB_STORAGE_JUMPSHOT is not set
-# CONFIG_USB_STORAGE_ALAUDA is not set
-# CONFIG_USB_STORAGE_ONETOUCH is not set
-# CONFIG_USB_STORAGE_KARMA is not set
-# CONFIG_USB_STORAGE_CYPRESS_ATACB is not set
-# CONFIG_USB_LIBUSUAL is not set
-
-#
-# USB Imaging devices
-#
-# CONFIG_USB_MDC800 is not set
-# CONFIG_USB_MICROTEK is not set
-
-#
-# USB port drivers
-#
-# CONFIG_USB_SERIAL is not set
-
-#
-# USB Miscellaneous drivers
-#
-# CONFIG_USB_EMI62 is not set
-# CONFIG_USB_EMI26 is not set
-# CONFIG_USB_ADUTUX is not set
-# CONFIG_USB_SEVSEG is not set
-# CONFIG_USB_RIO500 is not set
-# CONFIG_USB_LEGOTOWER is not set
-# CONFIG_USB_LCD is not set
-# CONFIG_USB_BERRY_CHARGE is not set
-# CONFIG_USB_LED is not set
-# CONFIG_USB_CYPRESS_CY7C63 is not set
-# CONFIG_USB_CYTHERM is not set
-# CONFIG_USB_PHIDGET is not set
-# CONFIG_USB_IDMOUSE is not set
-# CONFIG_USB_FTDI_ELAN is not set
-# CONFIG_USB_APPLEDISPLAY is not set
-# CONFIG_USB_LD is not set
-# CONFIG_USB_TRANCEVIBRATOR is not set
-# CONFIG_USB_IOWARRIOR is not set
-# CONFIG_USB_TEST is not set
-# CONFIG_USB_ISIGHTFW is not set
-# CONFIG_USB_VST is not set
-CONFIG_USB_GADGET=y
-# CONFIG_USB_GADGET_DEBUG_FILES is not set
-CONFIG_USB_GADGET_VBUS_DRAW=2
-CONFIG_USB_GADGET_SELECTED=y
-# CONFIG_USB_GADGET_AT91 is not set
-# CONFIG_USB_GADGET_ATMEL_USBA is not set
-# CONFIG_USB_GADGET_FSL_USB2 is not set
-# CONFIG_USB_GADGET_LH7A40X is not set
-# CONFIG_USB_GADGET_OMAP is not set
-# CONFIG_USB_GADGET_PXA25X is not set
-# CONFIG_USB_GADGET_PXA27X is not set
-# CONFIG_USB_GADGET_S3C2410 is not set
-# CONFIG_USB_GADGET_M66592 is not set
-# CONFIG_USB_GADGET_AMD5536UDC is not set
-# CONFIG_USB_GADGET_FSL_QE is not set
-# CONFIG_USB_GADGET_NET2280 is not set
-# CONFIG_USB_GADGET_GOKU is not set
-CONFIG_USB_GADGET_ASPEED_AST=y
-CONFIG_USB_ASPEED_AST=y
-# CONFIG_USB_GADGET_DUMMY_HCD is not set
-CONFIG_USB_GADGET_DUALSPEED=y
-CONFIG_USB_ZERO=m
-CONFIG_USB_ETH=m
-CONFIG_USB_ETH_RNDIS=y
-CONFIG_USB_GADGETFS=m
-CONFIG_USB_FILE_STORAGE=m
-# CONFIG_USB_FILE_STORAGE_TEST is not set
-CONFIG_USB_G_SERIAL=m
-# CONFIG_USB_MIDI_GADGET is not set
-# CONFIG_USB_G_PRINTER is not set
-CONFIG_USB_CDC_COMPOSITE=m
-# CONFIG_MMC is not set
-# CONFIG_MEMSTICK is not set
-# CONFIG_ACCESSIBILITY is not set
-# CONFIG_NEW_LEDS is not set
-CONFIG_RTC_LIB=y
-CONFIG_RTC_CLASS=y
-# CONFIG_RTC_HCTOSYS is not set
-# CONFIG_RTC_DEBUG is not set
-
-#
-# RTC interfaces
-#
-CONFIG_RTC_INTF_SYSFS=y
-CONFIG_RTC_INTF_PROC=y
-CONFIG_RTC_INTF_DEV=y
-# CONFIG_RTC_INTF_DEV_UIE_EMUL is not set
-# CONFIG_RTC_DRV_TEST is not set
-
-#
-# I2C RTC drivers
-#
-# CONFIG_RTC_DRV_DS1307 is not set
-# CONFIG_RTC_DRV_DS1374 is not set
-# CONFIG_RTC_DRV_DS1672 is not set
-# CONFIG_RTC_DRV_MAX6900 is not set
-# CONFIG_RTC_DRV_RS5C372 is not set
-# CONFIG_RTC_DRV_ISL1208 is not set
-# CONFIG_RTC_DRV_X1205 is not set
-# CONFIG_RTC_DRV_PCF8563 is not set
-# CONFIG_RTC_DRV_PCF8583 is not set
-# CONFIG_RTC_DRV_M41T80 is not set
-# CONFIG_RTC_DRV_S35390A is not set
-# CONFIG_RTC_DRV_FM3130 is not set
-# CONFIG_RTC_DRV_RX8581 is not set
-
-#
-# SPI RTC drivers
-#
-# CONFIG_RTC_DRV_M41T94 is not set
-# CONFIG_RTC_DRV_DS1305 is not set
-# CONFIG_RTC_DRV_DS1390 is not set
-# CONFIG_RTC_DRV_MAX6902 is not set
-# CONFIG_RTC_DRV_R9701 is not set
-# CONFIG_RTC_DRV_RS5C348 is not set
-# CONFIG_RTC_DRV_DS3234 is not set
-
-#
-# Platform RTC drivers
-#
-# CONFIG_RTC_DRV_CMOS is not set
-# CONFIG_RTC_DRV_DS1286 is not set
-# CONFIG_RTC_DRV_DS1511 is not set
-# CONFIG_RTC_DRV_DS1553 is not set
-# CONFIG_RTC_DRV_DS1742 is not set
-# CONFIG_RTC_DRV_STK17TA8 is not set
-# CONFIG_RTC_DRV_M48T86 is not set
-# CONFIG_RTC_DRV_M48T35 is not set
-# CONFIG_RTC_DRV_M48T59 is not set
-# CONFIG_RTC_DRV_BQ4802 is not set
-# CONFIG_RTC_DRV_V3020 is not set
-
-#
-# on-CPU RTC drivers
-#
-# CONFIG_RTC_DRV_PL030 is not set
-# CONFIG_RTC_DRV_PL031 is not set
-CONFIG_RTC_DRV_ASPEED=y
-# CONFIG_DMADEVICES is not set
-# CONFIG_REGULATOR is not set
-# CONFIG_UIO is not set
-
-#
-# File systems
-#
-CONFIG_EXT2_FS=y
-CONFIG_EXT2_FS_XATTR=y
-CONFIG_EXT2_FS_POSIX_ACL=y
-CONFIG_EXT2_FS_SECURITY=y
-# CONFIG_EXT2_FS_XIP is not set
-# CONFIG_EXT3_FS is not set
-# CONFIG_EXT4_FS is not set
-CONFIG_FS_MBCACHE=y
-# CONFIG_REISERFS_FS is not set
-# CONFIG_JFS_FS is not set
-CONFIG_FS_POSIX_ACL=y
-CONFIG_FILE_LOCKING=y
-# CONFIG_XFS_FS is not set
-# CONFIG_OCFS2_FS is not set
-CONFIG_DNOTIFY=y
-CONFIG_INOTIFY=y
-CONFIG_INOTIFY_USER=y
-# CONFIG_QUOTA is not set
-# CONFIG_AUTOFS_FS is not set
-# CONFIG_AUTOFS4_FS is not set
-# CONFIG_FUSE_FS is not set
-CONFIG_GENERIC_ACL=y
-
-#
-# CD-ROM/DVD Filesystems
-#
-# CONFIG_ISO9660_FS is not set
-# CONFIG_UDF_FS is not set
-
-#
-# DOS/FAT/NT Filesystems
-#
-CONFIG_FAT_FS=y
-CONFIG_MSDOS_FS=y
-CONFIG_VFAT_FS=y
-CONFIG_FAT_DEFAULT_CODEPAGE=437
-CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
-CONFIG_NTFS_FS=y
-# CONFIG_NTFS_DEBUG is not set
-CONFIG_NTFS_RW=y
-
-#
-# Pseudo filesystems
-#
-CONFIG_PROC_FS=y
-CONFIG_PROC_SYSCTL=y
-CONFIG_PROC_PAGE_MONITOR=y
-CONFIG_SYSFS=y
-CONFIG_TMPFS=y
-CONFIG_TMPFS_POSIX_ACL=y
-# CONFIG_HUGETLB_PAGE is not set
-CONFIG_CONFIGFS_FS=m
-
-#
-# Miscellaneous filesystems
-#
-# CONFIG_ADFS_FS is not set
-# CONFIG_AFFS_FS is not set
-# CONFIG_HFS_FS is not set
-# CONFIG_HFSPLUS_FS is not set
-# CONFIG_BEFS_FS is not set
-# CONFIG_BFS_FS is not set
-# CONFIG_EFS_FS is not set
-CONFIG_YAFFS_FS=y
-CONFIG_YAFFS_YAFFS1=y
-# CONFIG_YAFFS_9BYTE_TAGS is not set
-# CONFIG_YAFFS_DOES_ECC is not set
-CONFIG_YAFFS_YAFFS2=y
-CONFIG_YAFFS_AUTO_YAFFS2=y
-# CONFIG_YAFFS_DISABLE_TAGS_ECC is not set
-# CONFIG_YAFFS_DISABLE_LAZY_LOAD is not set
-# CONFIG_YAFFS_DISABLE_WIDE_TNODES is not set
-# CONFIG_YAFFS_ALWAYS_CHECK_CHUNK_ERASED is not set
-CONFIG_YAFFS_SHORT_NAMES_IN_RAM=y
-# CONFIG_YAFFS_EMPTY_LOST_AND_FOUND is not set
-CONFIG_JFFS2_FS=y
-CONFIG_JFFS2_FS_DEBUG=0
-CONFIG_JFFS2_FS_WRITEBUFFER=y
-# CONFIG_JFFS2_FS_WBUF_VERIFY is not set
-# CONFIG_JFFS2_SUMMARY is not set
-# CONFIG_JFFS2_FS_XATTR is not set
-# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
-CONFIG_JFFS2_ZLIB=y
-# CONFIG_JFFS2_LZO is not set
-CONFIG_JFFS2_RTIME=y
-# CONFIG_JFFS2_RUBIN is not set
-# CONFIG_CRAMFS is not set
-# CONFIG_VXFS_FS is not set
-# CONFIG_MINIX_FS is not set
-# CONFIG_OMFS_FS is not set
-# CONFIG_HPFS_FS is not set
-# CONFIG_QNX4FS_FS is not set
-# CONFIG_ROMFS_FS is not set
-# CONFIG_SYSV_FS is not set
-# CONFIG_UFS_FS is not set
-CONFIG_NETWORK_FILESYSTEMS=y
-CONFIG_NFS_FS=y
-# CONFIG_NFS_V3 is not set
-# CONFIG_NFS_V4 is not set
-CONFIG_ROOT_NFS=y
-# CONFIG_NFSD is not set
-CONFIG_LOCKD=y
-CONFIG_NFS_COMMON=y
-CONFIG_SUNRPC=y
-# CONFIG_SUNRPC_REGISTER_V4 is not set
-# CONFIG_RPCSEC_GSS_KRB5 is not set
-# CONFIG_RPCSEC_GSS_SPKM3 is not set
-# CONFIG_SMB_FS is not set
-# CONFIG_CIFS is not set
-# CONFIG_NCP_FS is not set
-# CONFIG_CODA_FS is not set
-# CONFIG_AFS_FS is not set
-
-#
-# Partition Types
-#
-# CONFIG_PARTITION_ADVANCED is not set
-CONFIG_MSDOS_PARTITION=y
-CONFIG_NLS=y
-CONFIG_NLS_DEFAULT="utf8"
-CONFIG_NLS_CODEPAGE_437=y
-# CONFIG_NLS_CODEPAGE_737 is not set
-# CONFIG_NLS_CODEPAGE_775 is not set
-# CONFIG_NLS_CODEPAGE_850 is not set
-# CONFIG_NLS_CODEPAGE_852 is not set
-# CONFIG_NLS_CODEPAGE_855 is not set
-# CONFIG_NLS_CODEPAGE_857 is not set
-# CONFIG_NLS_CODEPAGE_860 is not set
-# CONFIG_NLS_CODEPAGE_861 is not set
-# CONFIG_NLS_CODEPAGE_862 is not set
-# CONFIG_NLS_CODEPAGE_863 is not set
-# CONFIG_NLS_CODEPAGE_864 is not set
-# CONFIG_NLS_CODEPAGE_865 is not set
-# CONFIG_NLS_CODEPAGE_866 is not set
-# CONFIG_NLS_CODEPAGE_869 is not set
-CONFIG_NLS_CODEPAGE_936=y
-CONFIG_NLS_CODEPAGE_950=y
-CONFIG_NLS_CODEPAGE_932=y
-# CONFIG_NLS_CODEPAGE_949 is not set
-# CONFIG_NLS_CODEPAGE_874 is not set
-# CONFIG_NLS_ISO8859_8 is not set
-# CONFIG_NLS_CODEPAGE_1250 is not set
-# CONFIG_NLS_CODEPAGE_1251 is not set
-CONFIG_NLS_ASCII=y
-CONFIG_NLS_ISO8859_1=y
-# CONFIG_NLS_ISO8859_2 is not set
-# CONFIG_NLS_ISO8859_3 is not set
-# CONFIG_NLS_ISO8859_4 is not set
-# CONFIG_NLS_ISO8859_5 is not set
-# CONFIG_NLS_ISO8859_6 is not set
-# CONFIG_NLS_ISO8859_7 is not set
-# CONFIG_NLS_ISO8859_9 is not set
-# CONFIG_NLS_ISO8859_13 is not set
-# CONFIG_NLS_ISO8859_14 is not set
-# CONFIG_NLS_ISO8859_15 is not set
-# CONFIG_NLS_KOI8_R is not set
-# CONFIG_NLS_KOI8_U is not set
-CONFIG_NLS_UTF8=y
-# CONFIG_DLM is not set
-
-#
-# Kernel hacking
-#
-# CONFIG_PRINTK_TIME is not set
-# CONFIG_ENABLE_WARN_DEPRECATED is not set
-CONFIG_ENABLE_MUST_CHECK=y
-CONFIG_FRAME_WARN=1024
-CONFIG_MAGIC_SYSRQ=y
-# CONFIG_UNUSED_SYMBOLS is not set
-# CONFIG_DEBUG_FS is not set
-# CONFIG_HEADERS_CHECK is not set
-# CONFIG_DEBUG_KERNEL is not set
-# CONFIG_SLUB_DEBUG_ON is not set
-# CONFIG_SLUB_STATS is not set
-CONFIG_DEBUG_BUGVERBOSE=y
-CONFIG_DEBUG_MEMORY_INIT=y
-CONFIG_FRAME_POINTER=y
-# CONFIG_RCU_CPU_STALL_DETECTOR is not set
-# CONFIG_LATENCYTOP is not set
-# CONFIG_SYSCTL_SYSCALL_CHECK is not set
-CONFIG_HAVE_FUNCTION_TRACER=y
-
-#
-# Tracers
-#
-# CONFIG_DYNAMIC_PRINTK_DEBUG is not set
-# CONFIG_SAMPLES is not set
-CONFIG_HAVE_ARCH_KGDB=y
-# CONFIG_DEBUG_USER is not set
-
-#
-# Security options
-#
-# CONFIG_KEYS is not set
-# CONFIG_SECURITY is not set
-# CONFIG_SECURITYFS is not set
-# CONFIG_SECURITY_FILE_CAPABILITIES is not set
-CONFIG_CRYPTO=y
-
-#
-# Crypto core or helper
-#
-# CONFIG_CRYPTO_FIPS is not set
-CONFIG_CRYPTO_ALGAPI=y
-CONFIG_CRYPTO_ALGAPI2=y
-CONFIG_CRYPTO_AEAD=m
-CONFIG_CRYPTO_AEAD2=y
-CONFIG_CRYPTO_BLKCIPHER=y
-CONFIG_CRYPTO_BLKCIPHER2=y
-CONFIG_CRYPTO_HASH=y
-CONFIG_CRYPTO_HASH2=y
-CONFIG_CRYPTO_RNG2=y
-CONFIG_CRYPTO_MANAGER=y
-CONFIG_CRYPTO_MANAGER2=y
-# CONFIG_CRYPTO_GF128MUL is not set
-CONFIG_CRYPTO_NULL=y
-# CONFIG_CRYPTO_CRYPTD is not set
-CONFIG_CRYPTO_AUTHENC=m
-# CONFIG_CRYPTO_TEST is not set
-
-#
-# Authenticated Encryption with Associated Data
-#
-# CONFIG_CRYPTO_CCM is not set
-# CONFIG_CRYPTO_GCM is not set
-# CONFIG_CRYPTO_SEQIV is not set
-
-#
-# Block modes
-#
-CONFIG_CRYPTO_CBC=y
-# CONFIG_CRYPTO_CTR is not set
-# CONFIG_CRYPTO_CTS is not set
-# CONFIG_CRYPTO_ECB is not set
-# CONFIG_CRYPTO_LRW is not set
-# CONFIG_CRYPTO_PCBC is not set
-# CONFIG_CRYPTO_XTS is not set
-
-#
-# Hash modes
-#
-CONFIG_CRYPTO_HMAC=y
-# CONFIG_CRYPTO_XCBC is not set
-
-#
-# Digest
-#
-# CONFIG_CRYPTO_CRC32C is not set
-# CONFIG_CRYPTO_MD4 is not set
-CONFIG_CRYPTO_MD5=y
-# CONFIG_CRYPTO_MICHAEL_MIC is not set
-# CONFIG_CRYPTO_RMD128 is not set
-# CONFIG_CRYPTO_RMD160 is not set
-# CONFIG_CRYPTO_RMD256 is not set
-# CONFIG_CRYPTO_RMD320 is not set
-CONFIG_CRYPTO_SHA1=y
-# CONFIG_CRYPTO_SHA256 is not set
-# CONFIG_CRYPTO_SHA512 is not set
-# CONFIG_CRYPTO_TGR192 is not set
-# CONFIG_CRYPTO_WP512 is not set
-
-#
-# Ciphers
-#
-# CONFIG_CRYPTO_AES is not set
-# CONFIG_CRYPTO_ANUBIS is not set
-# CONFIG_CRYPTO_ARC4 is not set
-# CONFIG_CRYPTO_BLOWFISH is not set
-# CONFIG_CRYPTO_CAMELLIA is not set
-# CONFIG_CRYPTO_CAST5 is not set
-# CONFIG_CRYPTO_CAST6 is not set
-CONFIG_CRYPTO_DES=y
-# CONFIG_CRYPTO_FCRYPT is not set
-# CONFIG_CRYPTO_KHAZAD is not set
-# CONFIG_CRYPTO_SALSA20 is not set
-# CONFIG_CRYPTO_SEED is not set
-# CONFIG_CRYPTO_SERPENT is not set
-# CONFIG_CRYPTO_TEA is not set
-# CONFIG_CRYPTO_TWOFISH is not set
-
-#
-# Compression
-#
-CONFIG_CRYPTO_DEFLATE=m
-# CONFIG_CRYPTO_LZO is not set
-
-#
-# Random Number Generation
-#
-# CONFIG_CRYPTO_ANSI_CPRNG is not set
-# CONFIG_CRYPTO_HW is not set
-
-#
-# Library routines
-#
-CONFIG_BITREVERSE=y
-# CONFIG_CRC_CCITT is not set
-# CONFIG_CRC16 is not set
-# CONFIG_CRC_T10DIF is not set
-CONFIG_CRC_ITU_T=m
-CONFIG_CRC32=y
-# CONFIG_CRC7 is not set
-# CONFIG_LIBCRC32C is not set
-CONFIG_ZLIB_INFLATE=y
-CONFIG_ZLIB_DEFLATE=y
-CONFIG_PLIST=y
-CONFIG_HAS_IOMEM=y
-CONFIG_HAS_IOPORT=y
-CONFIG_HAS_DMA=y
-
-
-# GUC USB Drivers
-#
-CONFIG_GUC_USB_UHCI_HCD=m
-# CONFIG_GUC_USB_UHCI_MULTIPORT_1 is not set
-# CONFIG_GUC_USB_UHCI_MULTIPORT_2 is not set
-CONFIG_GUC_USB_UHCI_MULTIPORT_4=y
-# CONFIG_USB_GADGET_MUSB_HDRC is not set
diff --git a/meta-facebook/meta-wedge/recipes-kernel/linux/linux-aspeed_2.6%.bbappend b/meta-facebook/meta-wedge/recipes-kernel/linux/linux-aspeed_2.6%.bbappend
deleted file mode 100644
index 4ff7eac..0000000
--- a/meta-facebook/meta-wedge/recipes-kernel/linux/linux-aspeed_2.6%.bbappend
+++ /dev/null
@@ -1,8 +0,0 @@
-LINUX_VERSION_EXTENSION = "-wedge"
-
-COMPATIBLE_MACHINE = "wedge"
-
-FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
-
-SRC_URI += "file://defconfig \
- "
diff --git a/meta-facebook/meta-wedge/recipes-wedge/bmc-log/bmc-log_0.1.bb b/meta-facebook/meta-wedge/recipes-wedge/bmc-log/bmc-log_0.1.bb
deleted file mode 100644
index 2788a36..0000000
--- a/meta-facebook/meta-wedge/recipes-wedge/bmc-log/bmc-log_0.1.bb
+++ /dev/null
@@ -1,50 +0,0 @@
-# Copyright 2014-present Facebook. All Rights Reserved.
-#
-# This program file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program in a file named COPYING; if not, write to the
-# Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor,
-# Boston, MA 02110-1301 USA
-#
-
-SUMMARY = "Logging Utility"
-DESCRIPTION = "Util for logging"
-SECTION = "base"
-PR = "r1"
-LICENSE = "GPLv2"
-LIC_FILES_CHKSUM = "file://bmc-log.c;beginline=4;endline=16;md5=da35978751a9d71b73679307c4d296ec"
-
-SRC_URI = "file://bmc-log.c \
- file://bmc-log.h \
- file://Makefile \
- file://bmc-log-config \
- file://bmc-log.sh \
- "
-
-S = "${WORKDIR}"
-
-do_install() {
- install -d ${D}${sbindir}
- install -m 755 bmc-log ${D}${sbindir}/bmc-log
- install -d ${D}${sysconfdir}/default
- install -m 755 bmc-log-config ${D}${sysconfdir}/default/bmc-log
- install -d ${D}${sysconfdir}/init.d
- install -m 755 bmc-log.sh ${D}${sysconfdir}/init.d/bmc-log.sh
- update-rc.d -r ${D} bmc-log.sh start 92 S .
-}
-
-FILES_${PN} = "${sbindir} ${sysconfdir} "
-
-# Inhibit complaints about .debug directories
-
-INHIBIT_PACKAGE_DEBUG_SPLIT = "1"
-INHIBIT_PACKAGE_STRIP = "1"
diff --git a/meta-facebook/meta-wedge/recipes-wedge/bmc-log/files/Makefile b/meta-facebook/meta-wedge/recipes-wedge/bmc-log/files/Makefile
deleted file mode 100644
index 5004556..0000000
--- a/meta-facebook/meta-wedge/recipes-wedge/bmc-log/files/Makefile
+++ /dev/null
@@ -1,24 +0,0 @@
-# Copyright 2014-present Facebook. All Rights Reserved.
-#
-# This program file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program in a file named COPYING; if not, write to the
-# Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor,
-# Boston, MA 02110-1301 USA
-
-LIBS = -lutil
-
-all:
- ${CC} ${CFLAGS} -o bmc-log bmc-log.c ${LIBS}
-
-clean:
- rm -rf *.o bmc-log
diff --git a/meta-facebook/meta-wedge/recipes-wedge/bmc-log/files/bmc-log-config b/meta-facebook/meta-wedge/recipes-wedge/bmc-log/files/bmc-log-config
deleted file mode 100644
index 529adf2..0000000
--- a/meta-facebook/meta-wedge/recipes-wedge/bmc-log/files/bmc-log-config
+++ /dev/null
@@ -1,16 +0,0 @@
-# Configuration used by bmc-log script
-
-#Serial port connected to the micro-server
-US_TTY=""
-
-#IP version of the log collecting server
-LOG_SERVER_IP_VERSION=""
-
-#Host name of the log collecting server
-LOG_SERVER_NAME=""
-
-#Port number of the log collecting server
-LOG_SERVER_PORT=""
-
-#Baud rate to set for the US_TTY
-TTY_BAUD_RATE=""
diff --git a/meta-facebook/meta-wedge/recipes-wedge/bmc-log/files/bmc-log.c b/meta-facebook/meta-wedge/recipes-wedge/bmc-log/files/bmc-log.c
deleted file mode 100644
index 078db7b..0000000
--- a/meta-facebook/meta-wedge/recipes-wedge/bmc-log/files/bmc-log.c
+++ /dev/null
@@ -1,559 +0,0 @@
-/*
- * Copyright 2014-present Facebook. All Rights Reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-
-#include <fcntl.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <stdarg.h>
-#include <stdbool.h>
-#include <unistd.h>
-#include <string.h>
-#include <linux/serial.h>
-#include <sys/socket.h>
-#include <sys/types.h>
-#include <sys/param.h>
-#include <time.h>
-#include <arpa/inet.h>
-#include <sys/stat.h>
-#include <pty.h>
-#include <errno.h>
-#include <signal.h>
-#include <netinet/in.h>
-#include <netdb.h>
-#include "bmc-log.h"
-
-FILE *error_file = NULL;
-
-bool kill_received = false; // To check if a killing interrupt is received
-
-speed_t baud_rate = B57600; // Default baud rate - change if user inputs a different one
-
-int fd_tty = -1, fd_soc = -1;
-
-/* Hostname and port of the server */
-char *hostname;
-int port;
-
-struct termios orig_tty_state;
-
-char *get_time()
-{
- static char mytime[TIME_FORMAT_SIZE];
- memset(mytime, 0, sizeof(mytime));
- time_t this_time;
- struct tm *this_tm;
- this_time = time(NULL);
- this_tm = localtime(&this_time);
-
- snprintf(mytime, sizeof(mytime), "%04d-%02d-%02d %02d:%02d:%02d",
- 1900 + this_tm->tm_year, this_tm->tm_mon + 1,
- this_tm->tm_mday, this_tm->tm_hour,
- this_tm->tm_min, this_tm->tm_sec);
- return mytime;
-}
-
-void errlog(char *frmt, ...)
-{
- va_list args;
- va_start(args, frmt);
- struct stat st;
-
- char *time_now = get_time();
-
- fprintf(stderr, "[%s] ", time_now);
- vfprintf(stderr, frmt, args);
-
- if (error_file) {
- stat(error_log_file, &st);
- if (st.st_size >= MAX_LOG_FILE_SIZE) {
- truncate(error_log_file, 0);
- }
- fprintf(error_file, "[%s] ", time_now);
- vfprintf(error_file, frmt, args);
- fflush(error_file);
- }
-}
-
-/* Get the address info of netcons server */
-struct addrinfo *get_addr_info(int ip_version)
-{
- int ip_family = (ip_version == IPV4) ? AF_INET : AF_INET6;
- struct addrinfo hints;
-
- struct addrinfo *result;
- result = malloc(sizeof(*result));
- if (!result) {
- errlog("Error: Unable to allocate memory - %m\n");
- return NULL;
- }
-
- memset(&hints, 0, sizeof(struct addrinfo));
- hints.ai_family = ip_family; /* Allow IPv4 or IPv6 */
- hints.ai_socktype = SOCK_DGRAM; /* Datagram socket */
- hints.ai_flags = AI_PASSIVE; /* For wildcard IP address */
- hints.ai_protocol = 0; /* Any protocol */
- hints.ai_canonname = NULL;
- hints.ai_addr = NULL;
- hints.ai_next = NULL;
-
- if (getaddrinfo(hostname, NULL, &hints, &result)) {
- errlog("Error: getaddrinfo failed - %m\n");
- return NULL;
- }
-
- return result;
-}
-
-/* Prepare Ipv4 Socket */
-bool prepare_sock(struct sockaddr_in * tgt_addr)
-{
- struct addrinfo *addr_info;
- memset(tgt_addr, 0, sizeof(*tgt_addr));
-
- if ((addr_info = get_addr_info(IPV4)) == NULL) {
- errlog("Error: Unable to get address info\n");
- return false;
- }
-
- tgt_addr->sin_addr = ((struct sockaddr_in *)addr_info->ai_addr)->sin_addr;
- tgt_addr->sin_port = htons(port);
- tgt_addr->sin_family = AF_INET;
-
- return true;
-}
-
-/* Prepare Ipv6 Socket */
-bool prepare_sock6(struct sockaddr_in6 * tgt_addr6)
-{
- struct addrinfo *addr_info;
- memset(tgt_addr6, 0, sizeof(*tgt_addr6));
-
- if ((addr_info = get_addr_info(IPV6)) == NULL) {
- errlog("Erorr: Unable to get address info\n");
- return false;
- }
-
- tgt_addr6->sin6_addr = ((struct sockaddr_in6 *)addr_info->ai_addr)->sin6_addr;
- tgt_addr6->sin6_port = htons(port);
- tgt_addr6->sin6_family = AF_INET6;
-
- return true;
-}
-
-/* Set TTY to raw mode */
-bool set_tty(int fd)
-{
- struct termios tty_state;
-
- if (tcgetattr(fd, &tty_state) < 0) {
- return false;
- }
-
- if (tcgetattr(fd, &orig_tty_state) < 0) // Save original settings
- {
- return false;
- }
-
- if (cfsetspeed(&tty_state, baud_rate) == -1) {
- errlog("Error: Baud Rate not set - %m\n");
- return false;
- }
-
- tty_state.c_lflag &= ~(ICANON | IEXTEN | ISIG | ECHO);
- tty_state.c_iflag &= ~(IGNCR | ICRNL | INPCK | ISTRIP | IXON | BRKINT);
- tty_state.c_iflag |= (IGNCR | ICRNL);
- tty_state.c_oflag &= ~OPOST;
- tty_state.c_cflag |= CS8;
-
- tty_state.c_cc[VMIN] = 1;
- tty_state.c_cc[VTIME] = 0;
-
- if (tcsetattr(fd, TCSAFLUSH, &tty_state) < 0) {
- return false;
- }
-
- return true;
-}
-
-/* Create a pseudo terminal for other process to use (as this program is using up the actual TTY) */
-int create_pseudo_tty()
-{
- int amaster, aslave;
- int flags;
-
- if (openpty(&amaster, &aslave, NULL, NULL, NULL) == -1) {
- errlog("Error: Openpty failed - %m\n");
- return -1;
- }
-
- /* Set to non blocking mode */
- flags = fcntl(amaster, F_GETFL);
- flags |= O_NONBLOCK;
- fcntl(amaster, F_SETFL, flags);
-
- FILE *pseudo_save_file = fopen(pseudo_tty_save_file, "w+");
- if (!pseudo_save_file) {
- errlog("Error: Unable to open the pseudo info file - %m\n");
- return -1;
- }
- /* Save the name of the created pseudo tty in a text file for other processes to use */
- if (fprintf(pseudo_save_file, "%s\n", ttyname(aslave)) == -1) {
- errlog("Error writing to the pseudo info file\n");
- fclose(pseudo_save_file);
- return -1;
- }
- fclose(pseudo_save_file);
-
- if (set_tty(aslave) == -1) {
- errlog("Error: Slave TTY not set properly\n");
- return -1;
- }
-
- return amaster;
-}
-
-/* Prepare logs from the read_buf and send them to the server */
-bool prepare_log_send(char *read_buf, int max_read, int fd_socket)
-{
- size_t buff_index = 0; // Index for the read_buf string
-
- static char line[LINE_LEN] = { 0 };
- static size_t line_index = 0; // Index for the line string
-
- char msg[MSG_LEN] = { 0 }; // Message to be sent to the server
-
- /* Kernel Version */
- static char kernel_version[KERNEL_VERSION_LEN] = "dummy_kernel";
- static int kernel_search_pos = 0;
-
- while (buff_index < max_read && read_buf[buff_index] != '\0') {
- if (read_buf[buff_index] == 'L') // Check if there is a possibility of new kernel version
- {
- kernel_search_pos = line_index;
- }
-
- /* Send the log when a line is read */
- if (read_buf[buff_index] == '\n') {
- if (kernel_search_pos > 0) {
- if (strncmp(line + kernel_search_pos, "Linux version ", kernel_search_len) == 0) {
- sscanf(line + kernel_search_pos + kernel_search_len, "%s", kernel_version);
- }
- kernel_search_pos = 0;
- }
-
- /* Prepare the message */
- memset(msg, 0, sizeof(msg));
- if (snprintf(msg, sizeof(msg), "%s %s %s %s", "kernel:", kernel_version, "- msg", line) < 0) {
- errlog("Error copying the message - %m\n");
- return false;
- }
-
- /* Send message to the server */
- if (write(fd_socket, msg, strlen(msg)) < 0) {
- errlog("Error: Write to socket failed - %m\n");
- return false;
- }
-
- /* Reset the line buffer */
- line_index = 0;
- memset(line, 0, sizeof(line));
-
- buff_index++;
- continue;
- }
-
- /* If line is too big, send only the first few bytes and discard others. */
- if (line_index >= sizeof(line)) {
- line[line_index - 1] = 0;
- buff_index++;
- continue;
- }
-
- line[line_index++] = read_buf[buff_index++];
- }
-
- return true;
-}
-
-/* Read text from the TTY and send to send as logs */
-bool read_send(int fd_tty, int fd_socket)
-{
- char read_buf[LINE_LEN] = { 0 }; // Buffer to be read into.
- int read_size = 0;
- fd_set readset;
- int sel;
- int fdmax;
-
- int pseudo_tty = create_pseudo_tty();
-
- if (pseudo_tty == -1) {
- errlog("Error: Cannot create a psuedo terminal\n");
- return false;
- }
-
- fdmax = MAX(fd_tty, pseudo_tty);
-
- while (!kill_received) {
- do {
- FD_ZERO(&readset);
- FD_SET(fd_tty, &readset);
- FD_SET(pseudo_tty, &readset);
-
- sel = select(fdmax + 1, &readset, NULL, NULL, NULL);
- }
- while (sel == -1 && errno == EINTR && !kill_received);
-
- memset(read_buf, 0, sizeof(read_buf));
- if (FD_ISSET(fd_tty, &readset)) {
- read_size = read(fd_tty, read_buf, sizeof(read_buf) - 1);
-
- if (read_size == 0) {
- continue;
- }
- if (read_size < 0) {
- if (errno == EAGAIN) {
- continue;
- }
- errlog("Error: Read from tty failed - %m\n");
- return false;
- }
-
- /* Send the read data to the pseudo terminal */
- if (write(pseudo_tty, read_buf, read_size) < 0) {
- if (errno == EAGAIN) // Output buffer full - flush it.
- {
- tcflush(pseudo_tty, TCIOFLUSH);
- continue;
- }
-
- errlog("Error: Write to pseudo tty failed - %m\n");
- return false;
- }
-
- /* Prepare log message and send to the server */
- if (!prepare_log_send(read_buf, sizeof(read_buf), fd_socket)) {
- errlog("Error: Sending log failed - %m\n");
- return false;
- }
- }
- /*if (FD_ISSET(fd_tty, &readset)) */
- if (kill_received) {
- break;
- }
-
- /* Check if there is an data in the pseudo terminal's buffer */
- if (FD_ISSET(pseudo_tty, &readset)) {
- read_size = read(pseudo_tty, read_buf, sizeof(read_buf) - 1);
-
- if (read_size == 0) {
- continue;
- }
- if (read_size < 0) {
- if (errno == EAGAIN) {
- continue;
- }
- errlog("Error: Read from pseudo tty failed - %m\n");
- return false;
- }
-
- if (write(fd_tty, read_buf, read_size) < 0) {
- if (errno == EAGAIN) // Output buffer full - flush it.
- {
- tcflush(fd_tty, TCIOFLUSH);
- continue;
- }
-
- errlog("Error: Write to tty failed - %m\n");
- return false;
- }
- } /*if (FD_ISSET(pseudo_tty,&readset)) */
- } /*while (!kill_received) */
-
- return true;
-}
-
-void cleanup()
-{
- remove(pseudo_tty_save_file);
- tcsetattr(fd_tty, TCSAFLUSH, &orig_tty_state); //Restore original settings
- close(fd_tty);
- close(fd_soc);
- fclose(error_file);
-}
-
-void sig_kill(int signum)
-{
- kill_received = true;
-}
-
-void register_kill()
-{
- struct sigaction sigact;
- sigset_t sigset;
-
- sigemptyset(&sigset);
- memset(&sigact, 0, sizeof sigact);
- sigact.sa_handler = sig_kill;
- sigact.sa_mask = sigset;
-
- sigaction(SIGHUP, &sigact, NULL);
- sigaction(SIGINT, &sigact, NULL);
- sigaction(SIGQUIT, &sigact, NULL);
- sigaction(SIGPIPE, &sigact, NULL);
- sigaction(SIGTERM, &sigact, NULL);
- sigaction(SIGKILL, &sigact, NULL);
- sigaction(SIGABRT, &sigact, NULL);
-}
-
-void usage(char *prog_name)
-{
- printf("Usage:\n");
- printf("\t%s TTY ip_version(4 or 6) hostname port [baud rate (like 57600)]\n", prog_name);
- printf("\t%s -h : For this help\n", prog_name);
- printf("Example:\n\t./bmc-log /dev/ttyS1 4 netcons.any.facebook.com 1514\n");
- printf("\tOR\n\t./bmc-log /dev/ttyS1 6 netcons6.any.facebook.com 1514 57600\n");
-}
-
-bool parse_user_input(int nargs, char **args, char *read_tty, int read_tty_size, int *ip_version)
-{
- if (nargs < 5) {
- if ((nargs > 1) && ((strcmp(args[1], "-h") == 0) || (strcmp(args[1], "--help") == 0))) {
- usage(args[0]);
- return false; // Not an error but returning -1 for the main function to return
- }
- fprintf(stderr, "Error: Invalid number of arguments\n");
- usage(args[0]);
- return false;
- }
-
- if (strlen(args[1]) > read_tty_size) {
- fprintf(stderr, "Error: TTY too long\n");
- usage(args[0]);
- return false;
- }
-
- /* TTT to read the logs from */
- strncpy(read_tty, args[1], read_tty_size);
-
- /* IP Version, IP Address and Port of the netcons server */
- *ip_version = atoi(args[2]);
- if (*ip_version != IPV4 && *ip_version != IPV6) {
- fprintf(stderr, "Error: Invalid IP Version input\n");
- usage(args[0]);
- return false;
- }
-
- hostname = args[3];
- port = atoi(args[4]);
-
- baud_rate = B57600;
- if (nargs == 6)
- baud_rate = atoi(args[5]);
-
- return true;
-}
-
-int main(int argc, char **argv)
-{
- char read_tty[TTY_LEN] = { 0 };
- int ip_version;
- int socket_domain = AF_UNSPEC;
- char cmd[COMMAND_LEN] = { 0 };
-
- /* Open the error log file */
- error_file = fopen(error_log_file, "a+");
- if (!error_file) {
- printf("Error: Unable to open log file - %m\n");
- return 1;
- }
-
- /* Register actions upon interrupts */
- register_kill();
-
- /* Parse the user input */
- if (!parse_user_input(argc, argv, read_tty, sizeof(read_tty), &ip_version)) {
- return 2;
- }
-
- snprintf(cmd, sizeof(cmd), "%s %s", uS_console, "connect");
- if (system(cmd) == -1) {
- errlog("Error: Unable to connect to the micro-server\n");
- return 3;
- }
-
- /* Create a socket to communicate with the netcons server */
- socket_domain = (ip_version == IPV4) ? AF_INET : AF_INET6;
- fd_soc = socket(socket_domain, SOCK_DGRAM, 0);
- if (fd_soc == -1) {
- errlog("Error: Socket creation failed - %m\n");
- return 4;
- }
-
- if (ip_version == IPV4) { /* IPv4 */
- struct sockaddr_in tgt_addr;
- if (!prepare_sock(&tgt_addr)) {
- close(fd_soc);
- errlog("Error: Socket not valid\n");
- return 5;
- }
-
- if (connect(fd_soc, (struct sockaddr *)&tgt_addr, sizeof(tgt_addr)) == -1) {
- close(fd_soc);
- errlog("Error: Socket connection failed - %m\n");
- return 6;
- }
-
- } else { /* IPv6 */
-
- struct sockaddr_in6 tgt_addr6;
- if (!prepare_sock6(&tgt_addr6)) {
- close(fd_soc);
- errlog("Error: Socket not valid\n");
- return 5;
- }
-
- if (connect(fd_soc, (struct sockaddr *)&tgt_addr6, sizeof(tgt_addr6)) == -1) {
- close(fd_soc);
- errlog("Error: Socket connection failed - %m\n");
- return 6;
- }
- }
-
- /* TTY Operations */
- if ((fd_tty = open(read_tty, O_RDWR | O_NOCTTY | O_NDELAY | O_NONBLOCK)) == -1) {
- close(fd_soc);
- errlog("Error: Serial Port %s open failed - %m\n", read_tty);
- return 7;
- }
-
- if (!set_tty(fd_tty)) {
- errlog("Error: tty not set properly\n");
- cleanup();
- return 8;
- }
-
- /* Read, prepare and send the logs */
- if (!read_send(fd_tty, fd_soc)) {
- errlog("Error: Sending logs failed\n");
- cleanup();
- return 9;
- }
-
- cleanup();
- return 0;
-}
diff --git a/meta-facebook/meta-wedge/recipes-wedge/bmc-log/files/bmc-log.h b/meta-facebook/meta-wedge/recipes-wedge/bmc-log/files/bmc-log.h
deleted file mode 100644
index 5795e6a..0000000
--- a/meta-facebook/meta-wedge/recipes-wedge/bmc-log/files/bmc-log.h
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Copyright 2014-present Facebook. All Rights Reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-
-#ifndef BMC_LOG_H_
-#define BMC_LOG_H_
-
-/* IP Version */
-#define IPV4 (4)
-#define IPV6 (6)
-
-/* Search string for the kernel version */
-#define KERNEL_SEARCH_STR "Linux version "
-
-/* Size constants */
-#define TIME_FORMAT_SIZE (100)
-#define MAX_LOG_FILE_SIZE (1024*1024*5) //5MB
-#define TTY_LEN (50)
-#define LINE_LEN (257)
-#define MSG_LEN (1025)
-#define COMMAND_LEN (100)
-#define KERNEL_VERSION_LEN (100)
-
-static char *uS_console = "/usr/local/fbpackages/utils/us_console.sh";
-
-static char *error_log_file = "/var/log/bmc-log";
-
-static char *pseudo_tty_save_file = "/etc/us_pseudo_tty";
-
-static int kernel_search_len = sizeof(KERNEL_SEARCH_STR) - 1;
-
-#endif
diff --git a/meta-facebook/meta-wedge/recipes-wedge/bmc-log/files/bmc-log.sh b/meta-facebook/meta-wedge/recipes-wedge/bmc-log/files/bmc-log.sh
deleted file mode 100755
index 00bf63c..0000000
--- a/meta-facebook/meta-wedge/recipes-wedge/bmc-log/files/bmc-log.sh
+++ /dev/null
@@ -1,77 +0,0 @@
-#!/bin/sh
-#
-# Copyright 2014-present Facebook. All Rights Reserved.
-#
-# This program file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program in a file named COPYING; if not, write to the
-# Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor,
-# Boston, MA 02110-1301 USA
-#
-
-### BEGIN INIT INFO
-# Provides: bmc-log
-# Required-Start:
-# Required-Stop:
-# Default-Start: S
-# Default-Stop:
-# Short-Description: Collect micro-server kernel logs through serial port
-### END INIT INFO
-
-. /etc/default/bmc-log
-. /etc/init.d/functions
-
-DAEMON=/usr/sbin/bmc-log
-NAME=bmc-log
-DESC="Micro-Server log collection"
-
-TTY=${US_TTY:-/dev/ttyS1}
-IP=${LOG_SERVER_IP_VERSION:-4}
-LOG_SERVER=${LOG_SERVER_NAME:-}
-PORT=${LOG_SERVER_PORT:-}
-BAUD_RATE=${TTY_BAUD_RATE:-}
-
-if [ -z "$LOG_SERVER" ] || [ -z "$PORT" ]
-then
- echo "Error: Server and/or port not set"
- exit 0
-fi
-
-
-ACTION="$1"
-
-case "$ACTION" in
- start)
- echo -e "Starting $DESC"
- $DAEMON $TTY $IP $LOG_SERVER $PORT $BAUD_RATE
- ;;
- stop)
- echo -e "Stopping $DESC: "
- start-stop-daemon --stop --quiet --exec $DAEMON
- ;;
- restart|force-reload)
- echo -e "Restarting $DESC: "
- start-stop-daemon --stop --quiet --exec $DAEMON
- sleep 1
- $DAEMON $TTY $IP $LOG_SERVER $PORT $BAUD_RATE
- ;;
- status)
- stat $DAEMON
- exit $?
- ;;
- *)
- N=${0##*/}
- N=${N#[SK]??}
- echo "Usage: $N {start|stop|status|restart|force-reload}" >&2
- exit 1
- ;;
-esac
diff --git a/meta-facebook/meta-wedge/recipes-wedge/fan-ctrl/fan-ctrl/get_fan_speed.sh b/meta-facebook/meta-wedge/recipes-wedge/fan-ctrl/fan-ctrl/get_fan_speed.sh
deleted file mode 100755
index 4e36a7c..0000000
--- a/meta-facebook/meta-wedge/recipes-wedge/fan-ctrl/fan-ctrl/get_fan_speed.sh
+++ /dev/null
@@ -1,59 +0,0 @@
-#!/bin/sh
-#
-# Copyright 2004-present Facebook. All Rights Reserved.
-#
-# This program file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program in a file named COPYING; if not, write to the
-# Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor,
-# Boston, MA 02110-1301 USA
-#
-usage() {
- echo "Usage: $0 [Fan Unit (0..3)]" >&2
-}
-
-PWM_DIR=/sys/devices/platform/ast_pwm_tacho.0
-set -e
-
-# refer to the comments in init_pwn.sh regarding
-# the fan unit and tacho mapping
-if [ "$#" -eq 0 ]; then
- TACHOS="0:3 1:2 2:0 3:1"
-elif [ "$#" -eq 1 ]; then
- case "$1" in
- "0")
- TACHOS="0:3"
- ;;
- "1")
- TACHOS="1:2"
- ;;
- "2")
- TACHOS="2:0"
- ;;
- "3")
- TACHOS="3:1"
- ;;
- *)
- usage
- exit 1
- ;;
- esac
-else
- usage
- exit 1
-fi
-
-for fan_tacho in $TACHOS; do
- fan=${fan_tacho%%:*}
- tacho=${fan_tacho##*:}
- echo "Fan $fan RPMs: $(cat $PWM_DIR/tacho${tacho}_rpm), $(cat $PWM_DIR/tacho$((tacho+4))_rpm)"
-done
diff --git a/meta-facebook/meta-wedge/recipes-wedge/fan-ctrl/fan-ctrl/init_pwm.sh b/meta-facebook/meta-wedge/recipes-wedge/fan-ctrl/fan-ctrl/init_pwm.sh
deleted file mode 100755
index cf545be..0000000
--- a/meta-facebook/meta-wedge/recipes-wedge/fan-ctrl/fan-ctrl/init_pwm.sh
+++ /dev/null
@@ -1,71 +0,0 @@
-#!/bin/sh
-#
-# Copyright 2004-present Facebook. All Rights Reserved.
-#
-# This program file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program in a file named COPYING; if not, write to the
-# Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor,
-# Boston, MA 02110-1301 USA
-#
-PWM_DIR=/sys/devices/platform/ast_pwm_tacho.0
-
-set -e
-
-# The PWM frequency is
-
-# clk_source / ((2 ^ division_) * (2 * division_l) * (unit + 1))
-#
-# Our clk_source is 24Mhz. 4-pin fans are generally supposed to be driven with
-# a 25Khz PWM control signal. Therefore we want the divisor to equal 960.
-#
-# We also want the unit to be as large as possible, since this controls the
-# granularity with which we can modulate the PWM signal. The following
-# settings allow us to set the fan from 0 to 100% in increments of 1/96th.
-#
-# The AST chip supports 3 different PWM clock configurations, but we only use
-# type M for now.
-echo 0 > $PWM_DIR/pwm_type_m_division_h
-echo 5 > $PWM_DIR/pwm_type_m_division_l
-echo 95 > $PWM_DIR/pwm_type_m_unit
-
-# On wedge, there are 4 fans connected.
-# Each fan has one PWM input and 2 tacho outputs.
-# Here is the mapping between the fan and PWN/Tacho,
-# staring from the one from the edge
-# Fan 0: PWM 7, Tacho3, Tacho7
-# Fan 1: PWM 6, Tacho2, Tacho6
-# Fan 2: PWM 0, Tacho0, Tacho4
-# Fan 3: PWM 1, Tacho1, Tacho5
-
-# For each fan, setting the type, and 100% initially
-for pwm in 0 1 6 7; do
- echo 0 > $PWM_DIR/pwm${pwm}_type
- echo 0 > $PWM_DIR/pwm${pwm}_rising
- echo 0 > $PWM_DIR/pwm${pwm}_falling
- echo 1 > $PWM_DIR/pwm${pwm}_en
-done
-
-# Enable Tach 0..7
-echo 0 > $PWM_DIR/tacho0_source
-echo 0 > $PWM_DIR/tacho4_source
-echo 1 > $PWM_DIR/tacho1_source
-echo 1 > $PWM_DIR/tacho5_source
-echo 6 > $PWM_DIR/tacho2_source
-echo 6 > $PWM_DIR/tacho6_source
-echo 7 > $PWM_DIR/tacho3_source
-echo 7 > $PWM_DIR/tacho7_source
-t=0
-while [ $t -le 7 ]; do
- echo 1 > $PWM_DIR/tacho${t}_en
- t=$((t+1))
-done
diff --git a/meta-facebook/meta-wedge/recipes-wedge/fan-ctrl/fan-ctrl/set_fan_speed.sh b/meta-facebook/meta-wedge/recipes-wedge/fan-ctrl/fan-ctrl/set_fan_speed.sh
deleted file mode 100755
index a71850f..0000000
--- a/meta-facebook/meta-wedge/recipes-wedge/fan-ctrl/fan-ctrl/set_fan_speed.sh
+++ /dev/null
@@ -1,85 +0,0 @@
-#!/bin/sh
-#
-# Copyright 2004-present Facebook. All Rights Reserved.
-#
-# This program file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program in a file named COPYING; if not, write to the
-# Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor,
-# Boston, MA 02110-1301 USA
-#
-usage() {
- echo "Usage: $0 <PERCENT (0..100)> <Fan Unit (0..3)> " >&2
-}
-
-PWM_DIR=/sys/devices/platform/ast_pwm_tacho.0
-
-# The maximum unit setting.
-# This should be the value in pwm_type_m_unit plus 1
-PWM_UNIT_MAX=96
-
-set -e
-
-if [ "$#" -ne 2 ] && [ "$#" -ne 1 ]; then
- usage
- exit 1
-fi
-
-# refer to the comments in init_pwn.sh regarding
-# the fan unit and PWM mapping
-if [ "$#" -eq 1 ]; then
- PWMS="0:7 1:6 2:0 3:1"
-else
- case "$2" in
- "0")
- PWMS="0:7"
- ;;
- "1")
- PWMS="1:6"
- ;;
- "2")
- PWMS="2:0"
- ;;
- "3")
- PWMS="3:1"
- ;;
- *)
- usage
- exit 1
- ;;
- esac
-fi
-
-# Convert the percentage to our 1/96th unit.
-unit=$(( ( $1 * $PWM_UNIT_MAX ) / 100 ))
-
-for FAN_PWM in $PWMS; do
- FAN_N=${FAN_PWM%%:*}
- PWM_N=${FAN_PWM##*:}
- if [ "$unit" -eq 0 ]; then
- # For 0%, turn off the PWM entirely
- echo 0 > $PWM_DIR/pwm${PWM_N}_en
- else
- if [ "$unit" -eq $PWM_UNIT_MAX ]; then
- # For 100%, set falling and rising to the same value
- unit=0
- fi
-
- # always use type M. refer to the comments in init_pwm.sh
- echo 0 > $PWM_DIR/pwm${PWM_N}_type
- echo 0 > $PWM_DIR/pwm${PWM_N}_rising
- echo "$unit" > $PWM_DIR/pwm${PWM_N}_falling
- echo 1 > $PWM_DIR/pwm${PWM_N}_en
- fi
-
- echo "Successfully set fan ${FAN_N} (PWM: $PWM_N) speed to $1%"
-done
diff --git a/meta-facebook/meta-wedge/recipes-wedge/fan-ctrl/fan-ctrl/setup-fan.sh b/meta-facebook/meta-wedge/recipes-wedge/fan-ctrl/fan-ctrl/setup-fan.sh
deleted file mode 100644
index 146a787..0000000
--- a/meta-facebook/meta-wedge/recipes-wedge/fan-ctrl/fan-ctrl/setup-fan.sh
+++ /dev/null
@@ -1,39 +0,0 @@
-#!/bin/sh
-#
-# Copyright 2014-present Facebook. All Rights Reserved.
-#
-# This program file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program in a file named COPYING; if not, write to the
-# Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor,
-# Boston, MA 02110-1301 USA
-#
-
-### BEGIN INIT INFO
-# Provides: setup-fan
-# Required-Start: board-id
-# Required-Stop:
-# Default-Start: S
-# Default-Stop:
-# Short-Description: Set fan speed
-### END INIT INFO
-
-. /usr/local/bin/openbmc-utils.sh
-
-# Enable the isolation buffer
-wedge_iso_buf_enable
-
-echo -n "Setup fan speed... "
-/usr/local/bin/init_pwm.sh
-/usr/local/bin/set_fan_speed.sh 50
-/usr/local/bin/fand
-echo "done."
diff --git a/meta-facebook/meta-wedge/recipes-wedge/fan-ctrl/fan-ctrl_0.1.bbappend b/meta-facebook/meta-wedge/recipes-wedge/fan-ctrl/fan-ctrl_0.1.bbappend
deleted file mode 100644
index ef2932e..0000000
--- a/meta-facebook/meta-wedge/recipes-wedge/fan-ctrl/fan-ctrl_0.1.bbappend
+++ /dev/null
@@ -1,64 +0,0 @@
-# Copyright 2014-present Facebook. All Rights Reserved.
-#
-# This program file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program in a file named COPYING; if not, write to the
-# Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor,
-# Boston, MA 02110-1301 USA
-
-DEPENDS_append = "libwedge-eeprom update-rc.d-native"
-
-FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
-SRC_URI += "file://get_fan_speed.sh \
- file://init_pwm.sh \
- file://set_fan_speed.sh \
- file://setup-fan.sh \
- "
-
-S = "${WORKDIR}"
-
-binfiles += "get_fan_speed.sh \
- init_pwm.sh \
- set_fan_speed.sh \
- "
-
-LDFLAGS_append = " -lwedge_eeprom"
-CXXFLAGS_prepend = "-DCONFIG_WEDGE "
-
-pkgdir = "fan_ctrl"
-
-do_install() {
- dst="${D}/usr/local/fbpackages/${pkgdir}"
- bin="${D}/usr/local/bin"
- install -d $dst
- install -d $bin
- for f in ${binfiles}; do
- install -m 755 $f ${dst}/$f
- ln -snf ../fbpackages/${pkgdir}/$f ${bin}/$f
- done
- for f in ${otherfiles}; do
- install -m 644 $f ${dst}/$f
- done
- install -d ${D}${sysconfdir}/init.d
- install -d ${D}${sysconfdir}/rcS.d
- install -m 755 setup-fan.sh ${D}${sysconfdir}/init.d/setup-fan.sh
- update-rc.d -r ${D} setup-fan.sh start 91 S .
-}
-
-FBPACKAGEDIR = "${prefix}/local/fbpackages"
-
-FILES_${PN} = "${FBPACKAGEDIR}/fan_ctrl ${prefix}/local/bin ${sysconfdir} "
-
-# Inhibit complaints about .debug directories for the fand binary:
-
-INHIBIT_PACKAGE_DEBUG_SPLIT = "1"
-INHIBIT_PACKAGE_STRIP = "1"
diff --git a/meta-facebook/meta-wedge/recipes-wedge/fblibs/files/alert_control/Makefile b/meta-facebook/meta-wedge/recipes-wedge/fblibs/files/alert_control/Makefile
deleted file mode 100644
index 2f27a8c..0000000
--- a/meta-facebook/meta-wedge/recipes-wedge/fblibs/files/alert_control/Makefile
+++ /dev/null
@@ -1,27 +0,0 @@
-# Copyright 2014-present Facebook. All Rights Reserved.
-#
-# This program file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program in a file named COPYING; if not, write to the
-# Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor,
-# Boston, MA 02110-1301 USA
-
-lib: libalert_control.so
-
-libalert_control.so: alert_control.c
- $(CC) $(CFLAGS) -fPIC -c -o alert_control.o alert_control.c
- $(CC) -shared -o libalert_control.so alert_control.o -lc
-
-.PHONY: clean
-
-clean:
- rm -rf *.o libalert_control.so
diff --git a/meta-facebook/meta-wedge/recipes-wedge/fblibs/files/alert_control/alert_control.c b/meta-facebook/meta-wedge/recipes-wedge/fblibs/files/alert_control/alert_control.c
deleted file mode 100644
index 81b0329..0000000
--- a/meta-facebook/meta-wedge/recipes-wedge/fblibs/files/alert_control/alert_control.c
+++ /dev/null
@@ -1,117 +0,0 @@
-/*
- *
- * Copyright 2014-present Facebook. All Rights Reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <errno.h>
-#include <syslog.h>
-#include "alert_control.h"
-
-#define PATH_ALERT_STATUS "/sys/bus/i2c/drivers/panther_plus/4-0040/alert_status"
-#define PATH_ALERT_CONTROL "/sys/bus/i2c/drivers/panther_plus/4-0040/alert_control"
-
-#define MASK_ALERT_SMS_KCS 0x01
-
-/*
- * Function to enable/disable alert signal generation for a given Function Block
- */
-int
-alert_control(e_fbid_t id, e_flag_t cflag) {
- FILE *fp;
- unsigned char rbuf[5] = {0};
- unsigned char tbuf[3] = {0};
- int count = 0;
-
- fp = fopen(PATH_ALERT_CONTROL, "r+");
- if (!fp) {
- return -1;
- }
-
- count = fread(rbuf, sizeof(unsigned char), sizeof(rbuf), fp);
- if (count == 0x0) {
- fclose(fp);
- return -1;
- }
-
- // Size of the request
- tbuf[0] = 0x02;
-
- switch(id) {
- case FBID_SMS_KCS:
- if (cflag == FLAG_ENABLE)
- tbuf[1] = rbuf[2] | (0x01 << FBID_SMS_KCS);
- else
- tbuf[1] = rbuf[2] & (~(0x01 << FBID_SMS_KCS));
-
- tbuf[2] = rbuf[3];
- break;
- // TODO: Add logic for other Function Blocks here
- default:
- tbuf[0] = rbuf[2];
- tbuf[1] = rbuf[3];
- break;
- }
-
- count = fwrite(tbuf, sizeof(unsigned char), sizeof(tbuf), fp);
- if (count != sizeof(tbuf)) {
- fclose(fp);
- return (-1);
- }
-
- fclose(fp);
-
- return 0;
-}
-
-/*
- * Function to check if the alert for a given Function Block is asserted or not
- */
-bool
-is_alert_present(e_fbid_t id) {
- FILE *fp;
- unsigned char buf[5] = {0};
- int count = 0;
-
- fp = fopen(PATH_ALERT_STATUS, "r");
-
- if (!fp) {
- return false;
- }
-
- count = fread(buf, sizeof(unsigned char), sizeof(buf), fp);
- if (count == 0x0) {
- fclose(fp);
- sleep(2);
- return false;
- }
-
- fclose(fp);
-
- switch(id) {
- case FBID_SMS_KCS:
- if (buf[2] & (0x01 << FBID_SMS_KCS))
- return true;
- else
- return false;
- //TODO: Add logic for other Function Blocks here
- default:
- return false;
- }
-}
diff --git a/meta-facebook/meta-wedge/recipes-wedge/fblibs/files/alert_control/alert_control.h b/meta-facebook/meta-wedge/recipes-wedge/fblibs/files/alert_control/alert_control.h
deleted file mode 100644
index ca72591..0000000
--- a/meta-facebook/meta-wedge/recipes-wedge/fblibs/files/alert_control/alert_control.h
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- *
- * Copyright 2014-present Facebook. All Rights Reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-
-#ifndef __ALERT_CONTROL_H__
-#define __ALERT_CONTROL_H__
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <stdbool.h>
-
-typedef enum {
- FLAG_DISABLE = 0x00,
- FLAG_ENABLE,
-} e_flag_t;
-
-typedef enum {
- FBID_SMS_KCS = 0x00,
- FBID_SMM_KCS,
- FBID_COM1_DATA,
- FBID_COM2_DATA,
- FBID_COM1_STAT_CTRL,
- FBID_COM2_STAT_CTRL,
- FBID_POST,
- FBID_I2C_PROXY1_MASTER,
- FBID_I2C_PROXY1_STAT,
- FBID_I2C_PROXY2_MASTER,
- FBID_I2C_PROXY2_STAT,
- FBID_GPIO_CONFIG,
- FBID_GPIO_OUTPUT,
- FBID_GPIO_INPUT,
- FBID_GPIO_INTR,
- FBID_GPIO_EVENT,
- FBID_REG_READ,
- FBID_ALERT_CTRL = 0xFD,
- FBID_AERT_STAT = 0xFE,
- FBID_DISCOVERY = 0xFF,
-} e_fbid_t;
-
-int alert_control(e_fbid_t id, e_flag_t cflag);
-bool is_alert_present(e_fbid_t id);
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
-
-#endif /* __ALERT_CONTROL_H__ */
diff --git a/meta-facebook/meta-wedge/recipes-wedge/fblibs/files/ipmi/Makefile b/meta-facebook/meta-wedge/recipes-wedge/fblibs/files/ipmi/Makefile
deleted file mode 100644
index 369819c..0000000
--- a/meta-facebook/meta-wedge/recipes-wedge/fblibs/files/ipmi/Makefile
+++ /dev/null
@@ -1,27 +0,0 @@
-# Copyright 2014-present Facebook. All Rights Reserved.
-#
-# This program file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program in a file named COPYING; if not, write to the
-# Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor,
-# Boston, MA 02110-1301 USA
-
-lib: libipmi.so
-
-libipmi.so: ipmi.c
- $(CC) $(CFLAGS) -fPIC -c -o ipmi.o ipmi.c
- $(CC) -shared -o libipmi.so ipmi.o -lc
-
-.PHONY: clean
-
-clean:
- rm -rf *.o libipmi.so
diff --git a/meta-facebook/meta-wedge/recipes-wedge/fblibs/files/ipmi/ipmi.c b/meta-facebook/meta-wedge/recipes-wedge/fblibs/files/ipmi/ipmi.c
deleted file mode 100644
index b5a3e19..0000000
--- a/meta-facebook/meta-wedge/recipes-wedge/fblibs/files/ipmi/ipmi.c
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- *
- * Copyright 2014-present Facebook. All Rights Reserved.
- *
- * This file contains code to support IPMI2.0 Specificaton available @
- * http://www.intel.com/content/www/us/en/servers/ipmi/ipmi-specifications.html
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-
-#include "ipmi.h"
-#include <stdio.h>
-#include <stdlib.h>
-#include <errno.h>
-#include <string.h>
-#include <syslog.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <sys/un.h>
-
-#define SOCK_PATH "/tmp/ipmi_socket"
-#define MAX_IPMI_RES_LEN 100
-
-/*
- * Function to handle IPMI messages
- */
-void
-ipmi_handle(unsigned char *request, unsigned char req_len,
- unsigned char *response, unsigned char *res_len) {
-
- int s, t, len;
- struct sockaddr_un remote;
-
- // TODO: Need to update to reuse the socket instead of creating new
- if ((s = socket(AF_UNIX, SOCK_STREAM, 0)) == -1) {
- syslog(LOG_ALERT, "ipmi_handle: socket() failed\n");
- return;
- }
-
- remote.sun_family = AF_UNIX;
- strcpy(remote.sun_path, SOCK_PATH);
- len = strlen(remote.sun_path) + sizeof(remote.sun_family);
-
- if (connect(s, (struct sockaddr *)&remote, len) == -1) {
- syslog(LOG_ALERT, "ipmi_handle: connect() failed\n");
- return;
- }
-
- if (send(s, request, req_len, 0) == -1) {
- syslog(LOG_ALERT, "ipmi_handle: send() failed\n");
- return;
- }
-
- if ((t=recv(s, response, MAX_IPMI_RES_LEN, 0)) > 0) {
- *res_len = t;
- } else {
- if (t < 0) {
- syslog(LOG_ALERT, "ipmi_handle: recv() failed\n");
- } else {
- printf("Server closed connection");
- }
-
- return;
- }
-
- close(s);
-
- return;
-}
diff --git a/meta-facebook/meta-wedge/recipes-wedge/fblibs/files/ipmi/ipmi.h b/meta-facebook/meta-wedge/recipes-wedge/fblibs/files/ipmi/ipmi.h
deleted file mode 100644
index 4c6ed62..0000000
--- a/meta-facebook/meta-wedge/recipes-wedge/fblibs/files/ipmi/ipmi.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- *
- * Copyright 2014-present Facebook. All Rights Reserved.
- *
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-
-#ifndef __IPMI_H__
-#define __IPMI_H__
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void ipmi_handle(unsigned char *request, unsigned char req_len,
- unsigned char *response, unsigned char *res_len);
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
-
-#endif /* __IPMI_H__ */
diff --git a/meta-facebook/meta-wedge/recipes-wedge/fblibs/libalert-control_0.1.bb b/meta-facebook/meta-wedge/recipes-wedge/fblibs/libalert-control_0.1.bb
deleted file mode 100644
index ec02d04..0000000
--- a/meta-facebook/meta-wedge/recipes-wedge/fblibs/libalert-control_0.1.bb
+++ /dev/null
@@ -1,38 +0,0 @@
-# Copyright 2014-present Facebook. All Rights Reserved.
-#
-# This program file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program in a file named COPYING; if not, write to the
-# Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor,
-# Boston, MA 02110-1301 USA
-SUMMARY = "Wedge Alert Control Library"
-DESCRIPTION = "library for Wedge Alert Control"
-SECTION = "base"
-PR = "r1"
-LICENSE = "GPLv2"
-LIC_FILES_CHKSUM = "file://alert_control.c;beginline=5;endline=17;md5=da35978751a9d71b73679307c4d296ec"
-
-SRC_URI = "file://alert_control \
- "
-
-S = "${WORKDIR}/alert_control"
-
-do_install() {
- install -d ${D}${libdir}
- install -m 0644 libalert_control.so ${D}${libdir}/libalert_control.so
-
- install -d ${D}${includedir}/facebook
- install -m 0644 alert_control.h ${D}${includedir}/facebook/alert_control.h
-}
-
-FILES_${PN} = "${libdir}/libalert_control.so"
-FILES_${PN}-dev = "${includedir}/facebook/alert_control.h"
diff --git a/meta-facebook/meta-wedge/recipes-wedge/fblibs/libipmi_0.1.bb b/meta-facebook/meta-wedge/recipes-wedge/fblibs/libipmi_0.1.bb
deleted file mode 100644
index 83292be..0000000
--- a/meta-facebook/meta-wedge/recipes-wedge/fblibs/libipmi_0.1.bb
+++ /dev/null
@@ -1,39 +0,0 @@
-# Copyright 2014-present Facebook. All Rights Reserved.
-#
-# This program file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program in a file named COPYING; if not, write to the
-# Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor,
-# Boston, MA 02110-1301 USA
-SUMMARY = "Wedge IPMI Client Library"
-DESCRIPTION = "library for Wedge IPMI Client"
-SECTION = "base"
-PR = "r1"
-LICENSE = "GPLv2"
-LIC_FILES_CHKSUM = "file://ipmi.c;beginline=8;endline=20;md5=da35978751a9d71b73679307c4d296ec"
-
-
-SRC_URI = "file://ipmi \
- "
-
-S = "${WORKDIR}/ipmi"
-
-do_install() {
- install -d ${D}${libdir}
- install -m 0644 libipmi.so ${D}${libdir}/libipmi.so
-
- install -d ${D}${includedir}/facebook
- install -m 0644 ipmi.h ${D}${includedir}/facebook/ipmi.h
-}
-
-FILES_${PN} = "${libdir}/libipmi.so"
-FILES_${PN}-dev = "${includedir}/facebook/ipmi.h"
diff --git a/meta-facebook/meta-wedge/recipes-wedge/fbutils/files/COPYING b/meta-facebook/meta-wedge/recipes-wedge/fbutils/files/COPYING
deleted file mode 100644
index 3912109..0000000
--- a/meta-facebook/meta-wedge/recipes-wedge/fbutils/files/COPYING
+++ /dev/null
@@ -1,340 +0,0 @@
- GNU GENERAL PUBLIC LICENSE
- Version 2, June 1991
-
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.
- 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
- Preamble
-
- The licenses for most software are designed to take away your
-freedom to share and change it. By contrast, the GNU General Public
-License is intended to guarantee your freedom to share and change free
-software--to make sure the software is free for all its users. This
-General Public License applies to most of the Free Software
-Foundation's software and to any other program whose authors commit to
-using it. (Some other Free Software Foundation software is covered by
-the GNU Library General Public License instead.) You can apply it to
-your programs, too.
-
- When we speak of free software, we are referring to freedom, not
-price. Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-this service if you wish), that you receive source code or can get it
-if you want it, that you can change the software or use pieces of it
-in new free programs; and that you know you can do these things.
-
- To protect your rights, we need to make restrictions that forbid
-anyone to deny you these rights or to ask you to surrender the rights.
-These restrictions translate to certain responsibilities for you if you
-distribute copies of the software, or if you modify it.
-
- For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must give the recipients all the rights that
-you have. You must make sure that they, too, receive or can get the
-source code. And you must show them these terms so they know their
-rights.
-
- We protect your rights with two steps: (1) copyright the software, and
-(2) offer you this license which gives you legal permission to copy,
-distribute and/or modify the software.
-
- Also, for each author's protection and ours, we want to make certain
-that everyone understands that there is no warranty for this free
-software. If the software is modified by someone else and passed on, we
-want its recipients to know that what they have is not the original, so
-that any problems introduced by others will not reflect on the original
-authors' reputations.
-
- Finally, any free program is threatened constantly by software
-patents. We wish to avoid the danger that redistributors of a free
-program will individually obtain patent licenses, in effect making the
-program proprietary. To prevent this, we have made it clear that any
-patent must be licensed for everyone's free use or not licensed at all.
-
- The precise terms and conditions for copying, distribution and
-modification follow.
-
- GNU GENERAL PUBLIC LICENSE
- TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
- 0. This License applies to any program or other work which contains
-a notice placed by the copyright holder saying it may be distributed
-under the terms of this General Public License. The "Program", below,
-refers to any such program or work, and a "work based on the Program"
-means either the Program or any derivative work under copyright law:
-that is to say, a work containing the Program or a portion of it,
-either verbatim or with modifications and/or translated into another
-language. (Hereinafter, translation is included without limitation in
-the term "modification".) Each licensee is addressed as "you".
-
-Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope. The act of
-running the Program is not restricted, and the output from the Program
-is covered only if its contents constitute a work based on the
-Program (independent of having been made by running the Program).
-Whether that is true depends on what the Program does.
-
- 1. You may copy and distribute verbatim copies of the Program's
-source code as you receive it, in any medium, provided that you
-conspicuously and appropriately publish on each copy an appropriate
-copyright notice and disclaimer of warranty; keep intact all the
-notices that refer to this License and to the absence of any warranty;
-and give any other recipients of the Program a copy of this License
-along with the Program.
-
-You may charge a fee for the physical act of transferring a copy, and
-you may at your option offer warranty protection in exchange for a fee.
-
- 2. You may modify your copy or copies of the Program or any portion
-of it, thus forming a work based on the Program, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
- a) You must cause the modified files to carry prominent notices
- stating that you changed the files and the date of any change.
-
- b) You must cause any work that you distribute or publish, that in
- whole or in part contains or is derived from the Program or any
- part thereof, to be licensed as a whole at no charge to all third
- parties under the terms of this License.
-
- c) If the modified program normally reads commands interactively
- when run, you must cause it, when started running for such
- interactive use in the most ordinary way, to print or display an
- announcement including an appropriate copyright notice and a
- notice that there is no warranty (or else, saying that you provide
- a warranty) and that users may redistribute the program under
- these conditions, and telling the user how to view a copy of this
- License. (Exception: if the Program itself is interactive but
- does not normally print such an announcement, your work based on
- the Program is not required to print an announcement.)
-
-These requirements apply to the modified work as a whole. If
-identifiable sections of that work are not derived from the Program,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works. But when you
-distribute the same sections as part of a whole which is a work based
-on the Program, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Program.
-
-In addition, mere aggregation of another work not based on the Program
-with the Program (or with a work based on the Program) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
- 3. You may copy and distribute the Program (or a work based on it,
-under Section 2) in object code or executable form under the terms of
-Sections 1 and 2 above provided that you also do one of the following:
-
- a) Accompany it with the complete corresponding machine-readable
- source code, which must be distributed under the terms of Sections
- 1 and 2 above on a medium customarily used for software interchange; or,
-
- b) Accompany it with a written offer, valid for at least three
- years, to give any third party, for a charge no more than your
- cost of physically performing source distribution, a complete
- machine-readable copy of the corresponding source code, to be
- distributed under the terms of Sections 1 and 2 above on a medium
- customarily used for software interchange; or,
-
- c) Accompany it with the information you received as to the offer
- to distribute corresponding source code. (This alternative is
- allowed only for noncommercial distribution and only if you
- received the program in object code or executable form with such
- an offer, in accord with Subsection b above.)
-
-The source code for a work means the preferred form of the work for
-making modifications to it. For an executable work, complete source
-code means all the source code for all modules it contains, plus any
-associated interface definition files, plus the scripts used to
-control compilation and installation of the executable. However, as a
-special exception, the source code distributed need not include
-anything that is normally distributed (in either source or binary
-form) with the major components (compiler, kernel, and so on) of the
-operating system on which the executable runs, unless that component
-itself accompanies the executable.
-
-If distribution of executable or object code is made by offering
-access to copy from a designated place, then offering equivalent
-access to copy the source code from the same place counts as
-distribution of the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
- 4. You may not copy, modify, sublicense, or distribute the Program
-except as expressly provided under this License. Any attempt
-otherwise to copy, modify, sublicense or distribute the Program is
-void, and will automatically terminate your rights under this License.
-However, parties who have received copies, or rights, from you under
-this License will not have their licenses terminated so long as such
-parties remain in full compliance.
-
- 5. You are not required to accept this License, since you have not
-signed it. However, nothing else grants you permission to modify or
-distribute the Program or its derivative works. These actions are
-prohibited by law if you do not accept this License. Therefore, by
-modifying or distributing the Program (or any work based on the
-Program), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Program or works based on it.
-
- 6. Each time you redistribute the Program (or any work based on the
-Program), the recipient automatically receives a license from the
-original licensor to copy, distribute or modify the Program subject to
-these terms and conditions. You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties to
-this License.
-
- 7. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License. If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Program at all. For example, if a patent
-license would not permit royalty-free redistribution of the Program by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Program.
-
-If any portion of this section is held invalid or unenforceable under
-any particular circumstance, the balance of the section is intended to
-apply and the section as a whole is intended to apply in other
-circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system, which is
-implemented by public license practices. Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
- 8. If the distribution and/or use of the Program is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Program under this License
-may add an explicit geographical distribution limitation excluding
-those countries, so that distribution is permitted only in or among
-countries not thus excluded. In such case, this License incorporates
-the limitation as if written in the body of this License.
-
- 9. The Free Software Foundation may publish revised and/or new versions
-of the General Public License from time to time. Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
-Each version is given a distinguishing version number. If the Program
-specifies a version number of this License which applies to it and "any
-later version", you have the option of following the terms and conditions
-either of that version or of any later version published by the Free
-Software Foundation. If the Program does not specify a version number of
-this License, you may choose any version ever published by the Free Software
-Foundation.
-
- 10. If you wish to incorporate parts of the Program into other free
-programs whose distribution conditions are different, write to the author
-to ask for permission. For software which is copyrighted by the Free
-Software Foundation, write to the Free Software Foundation; we sometimes
-make exceptions for this. Our decision will be guided by the two goals
-of preserving the free status of all derivatives of our free software and
-of promoting the sharing and reuse of software generally.
-
- NO WARRANTY
-
- 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
-FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
-OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
-PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
-OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
-TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
-PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
-REPAIR OR CORRECTION.
-
- 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
-REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
-INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
-OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
-TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
-YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
-PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGES.
-
- END OF TERMS AND CONDITIONS
-
- How to Apply These Terms to Your New Programs
-
- If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
- To do so, attach the following notices to the program. It is safest
-to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least
-the "copyright" line and a pointer to where the full notice is found.
-
- <one line to give the program's name and a brief idea of what it does.>
- Copyright (C) <year> <name of author>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
-
-Also add information on how to contact you by electronic and paper mail.
-
-If the program is interactive, make it output a short notice like this
-when it starts in an interactive mode:
-
- Gnomovision version 69, Copyright (C) year name of author
- Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
- This is free software, and you are welcome to redistribute it
- under certain conditions; type `show c' for details.
-
-The hypothetical commands `show w' and `show c' should show the appropriate
-parts of the General Public License. Of course, the commands you use may
-be called something other than `show w' and `show c'; they could even be
-mouse-clicks or menu items--whatever suits your program.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the program, if
-necessary. Here is a sample; alter the names:
-
- Yoyodyne, Inc., hereby disclaims all copyright interest in the program
- `Gnomovision' (which makes passes at compilers) written by James Hacker.
-
- <signature of Ty Coon>, 1 April 1989
- Ty Coon, President of Vice
-
-This General Public License does not permit incorporating your program into
-proprietary programs. If your program is a subroutine library, you may
-consider it more useful to permit linking proprietary applications with the
-library. If this is what you want to do, use the GNU Library General
-Public License instead of this License.
diff --git a/meta-facebook/meta-wedge/recipes-wedge/fbutils/files/at93cx6.py b/meta-facebook/meta-wedge/recipes-wedge/fbutils/files/at93cx6.py
deleted file mode 100644
index 514a06b..0000000
--- a/meta-facebook/meta-wedge/recipes-wedge/fbutils/files/at93cx6.py
+++ /dev/null
@@ -1,318 +0,0 @@
-# Copyright 2004-present Facebook. All rights reserved.
-#
-# This program file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program in a file named COPYING; if not, write to the
-# Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor,
-# Boston, MA 02110-1301 USA
-#
-
-import subprocess
-import struct
-import sys
-
-
-AT93C46 = 'at93c46'
-AT93C56 = 'at93c56'
-AT93C66 = 'at93c66'
-AT93C86 = 'at93c86'
-
-
-class VerboseLogger:
- def __init__(self, verbose=False):
- self.verbose = verbose
-
- def _verbose_print(self, caption, bytestream=None):
- '''
- Print a bytestream to stdout if verbose is enabled.
- '''
- if self.verbose:
- if bytestream is not None:
- sys.stderr.write(
- "{}: {}\n" .format(
- caption, " ".join(['{:02X}'.format(ord(x))
- for x in bytestream])))
- else:
- sys.stderr.write("{}\n".format(caption))
-
-
-class AT93CX6SPI(VerboseLogger):
- '''The class to access AT93CX6 through SPI intf'''
- SPI_CMD = 'spi-bb'
-
- def __init__(self, bus_width, gpio_cs, gpio_ck, gpio_do, gpio_di,
- model, verbose=False):
- addr_bits_map = {
- AT93C46 : 6,
- AT93C56 : 8,
- AT93C66 : 8,
- AT93C86 : 10,
- }
- if bus_width != 8 and bus_width != 16:
- raise Exception("Invalid bus width for AT93CX6!")
- if model not in addr_bits_map:
- raise Exception("Invalid model '%s'" % model)
-
- self.bus_width = bus_width
- self.gpio_cs = gpio_cs
- self.gpio_ck = gpio_ck
- self.gpio_do = gpio_do
- self.gpio_di = gpio_di
- self.verbose = verbose
-
- self.addr_bits = addr_bits_map[model] \
- + (0 if self.bus_width == 16 else 1)
- self.addr_mask = (1 << self.addr_bits) - 1
-
- def __shift(self, bytestream, value):
- '''
- Shift an entire byte stream by value bits.
- '''
- binary = "".join(['{:08b}'.format(ord(x)) for x in bytestream])
- if value > 0:
- binary = binary[value:] + '0' * value
- else:
- binary = '0' * (-value) + binary[:value]
- return "".join([chr(int(binary[x:x+8],2))
- for x in range(0, len(binary), 8)])
-
- def __io(self, op, addr, data=None):
- '''
- Perform an IO operation against the EEPROM
- '''
- write_bits = self.addr_bits + 3
- if data is not None:
- # If giving data, we are doing a write command so
- # no need to read any data.
- write_bits = write_bits + self.bus_width
- read_bits = 0
- else:
- # If not giving data, we are doing either a read
- # command or a set command, so read the result.
- # We pad with an extra bit due to a dummy bit introduced
- # by a delay for address decoding on chip.
- read_bits = self.addr_bits + 4 + self.bus_width
-
- # Format the command itself
- instruction = addr & self.addr_mask
- instruction = instruction | ((0x4 | (op & 0x3)) << self.addr_bits)
- if data is not None:
- if self.bus_width == 16:
- write_data = struct.pack(">HH", instruction, data & 0xFFFF)
- else:
- write_data = struct.pack(">HB", instruction, data & 0xFF)
- else:
- write_data = struct.pack(">H", instruction)
- write_data = self.__shift(write_data, 16 - (self.addr_bits + 3))
-
- self._verbose_print("Write data", write_data)
-
- # Run the command with the bitbang driver
- if read_bits > 0:
- data_portion = "-r {} -w {}".format(read_bits, write_bits)
- else:
- data_portion = "-w {}".format(write_bits)
-
- cmd = "{} -s {} -c {} -o {} -i {} -b {}".format(
- self.SPI_CMD, self.gpio_cs, self.gpio_ck, self.gpio_do,
- self.gpio_di, data_portion
- )
-
- self._verbose_print("Command: {}".format(cmd))
-
- out = subprocess.Popen(cmd.split(),
- stdout=subprocess.PIPE,
- stdin = subprocess.PIPE)\
- .communicate(input=write_data)
-
- # Format the response
- read_data = self.__shift(out[0], self.addr_bits + 4)
- if self.bus_width == 16:
- read_data = read_data[:2]
- self._verbose_print("Read data", read_data)
- return struct.unpack(">H", read_data)[0]
- else:
- read_data = read_data[:1]
- self._verbose_print("Read data", read_data)
- return struct.unpack(">B", read_data)[0]
-
- def read(self, addr):
- return self.__io(0x2, addr)
-
- def ewen(self):
- self.__io(0x0, 0x3 << (self.addr_bits - 2))
-
- def erase(self, addr):
- self.__io(0x3, addr)
-
- def write(self, addr, data):
- self.__io(0x1, addr, data)
-
- def eral(self):
- self.__io(0x0, 0x2 << (self.addr_bits - 2))
-
- def wral(self, data):
- self.__io(0x0, 0x1 << (self.addr_bits - 2), data)
-
- def ewds(self):
- self.__io(0x0, 0x0)
-
-
-class AT93CX6(VerboseLogger):
- '''
- The class which handles accessing memory on the AT93CX6 chip.
- '''
-
- def __init__(self, bus_width, gpio_cs, gpio_ck, gpio_do, gpio_di,
- byte_swap, model=AT93C46, verbose=False):
- mem_size_map = {
- # in bytes
- AT93C46 : 128,
- AT93C56 : 256,
- AT93C66 : 512,
- AT93C86 : 2048,
- }
- self.bus_width = bus_width
- self.verbose = verbose
- self.byte_swap = byte_swap
- self.model = model
- self.memory_size = mem_size_map[model]
-
- self.spi = AT93CX6SPI(bus_width=bus_width, gpio_cs=gpio_cs,
- gpio_ck=gpio_ck, gpio_do=gpio_do,
- gpio_di=gpio_di, model=model,
- verbose=verbose)
-
- def __swap(self, value):
- '''
- Swap bytes for a 16-bit integer if instructed to do so.
- '''
- if self.bus_width == 16:
- if self.byte_swap:
- return ((value >> 8) & 0xFF) | ((value << 8) & 0xFF00)
- else:
- return value
- else:
- return value
-
- def get_memory_size(self):
- return self.memory_size
-
- def erase(self, offset=None, limit=None):
- '''
- Erase the chip.
- '''
- if offset is None:
- offset = 0
- if limit is None:
- limit = self.memory_size
-
- if offset < 0 or offset + limit > self.memory_size:
- raise Exception("Erase would be out of bounds!")
- if self.bus_width == 16 and \
- ((offset & 1) != 0 or ((offset + limit) & 1) != 0):
- raise Exception("Erase can't start or end on odd boundary in "
- "16-bit mode!")
-
- if offset == 0 and limit == self.memory_size:
- # Special case when we are erasing the entire chip
- self.spi.ewen()
- self.spi.eral()
- self.spi.ewds()
-
- self._verbose_print("Erased entire chip")
- else:
- # Regular case
- if self.bus_width == 16:
- real_offset = offset / 2
- real_limit = limit / 2
- else:
- real_offset = offset
- real_limit = limit
-
- self.spi.ewen()
- for addr in range(real_offset, real_offset + real_limit):
- self.spi.erase(addr)
- self.spi.ewds()
-
- self._verbose_print("Erased {} bytes from offset {}"
- .format(limit, offset))
-
- def read(self, offset=None, limit=None):
- '''
- Read the chip into a memory buffer.
- '''
- if offset is None:
- offset = 0
- if limit is None:
- limit = self.memory_size
-
- if offset < 0 or offset + limit > self.memory_size:
- raise Exception("Read would be out of bounds!")
- if self.bus_width == 16 and \
- ((offset & 1) != 0 or ((offset + limit) & 1) != 0):
- raise Exception("Read can't start or end on odd boundary in 16-bit "
- "mode!")
-
- output = ""
- if self.bus_width == 16:
- real_offset = offset / 2
- real_limit = limit / 2
- pack_instruction = "=H"
- else:
- real_offset = offset
- real_offset
- pack_instruction = "=B"
-
- for addr in range(real_offset, real_offset + real_limit):
- output = output + struct.pack(pack_instruction,
- self.__swap(self.spi.read(addr)))
-
- self._verbose_print("Read {} bytes from offset {}".format(limit, offset)
- , output)
-
- return output
-
- def write(self, data, offset=None):
- '''
- Write a memory buffer to the chip.
- '''
- if offset is None:
- offset = 0
-
- if offset < 0 or offset + len(data) > self.memory_size:
- raise Exception("Write would be out of bounds!")
- if self.bus_width == 16 and \
- ((offset & 1) != 0 or ((offset + len(data)) & 1) != 0):
- raise Exception("Write can't start or end on odd boundary in "
- "16-bit mode!")
-
- if self.bus_width == 16:
- offset_divisor = 2
- pack_instruction = "=H"
- else:
- offset_divisor = 1
- pack_instruction = "=B"
-
- self.spi.ewen()
- for addr in range(offset, offset + len(data), offset_divisor):
- actual_addr = addr / offset_divisor
- value = self.__swap(struct.unpack(
- pack_instruction, data[(addr - offset):(addr - offset)
- + offset_divisor])[0])
-
- self.spi.erase(actual_addr)
- self.spi.write(actual_addr, value)
- self.spi.ewds()
-
- self._verbose_print("Wrote {} bytes from offset {}"
- .format(len(data), offset), data)
diff --git a/meta-facebook/meta-wedge/recipes-wedge/fbutils/files/at93cx6_util.py b/meta-facebook/meta-wedge/recipes-wedge/fbutils/files/at93cx6_util.py
deleted file mode 100755
index 8ae7664..0000000
--- a/meta-facebook/meta-wedge/recipes-wedge/fbutils/files/at93cx6_util.py
+++ /dev/null
@@ -1,223 +0,0 @@
-#!/usr/bin/python -S
-# Copyright 2004-present Facebook. All rights reserved.
-#
-# This program file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program in a file named COPYING; if not, write to the
-# Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor,
-# Boston, MA 02110-1301 USA
-#
-
-
-from argparse import ArgumentParser
-import at93cx6
-import sys
-
-
-def get_raw(args):
- return at93cx6.AT93CX6SPI(
- args.bus_width, args.cs, args.clk, args.mosi, args.miso,
- args.model, args.verbose)
-
-def get_chip(args):
- return at93cx6.AT93CX6(
- args.bus_width, args.cs, args.clk, args.mosi, args.miso,
- args.byte_swap if hasattr(args, 'byte_swap') else None,
- args.model, args.verbose)
-
-def model_parser(ap):
- # Default, based on currenct HW configuration
- MODEL_DEFAULT = at93cx6.AT93C46
-
- ap.add_argument('--model', default=at93cx6.AT93C46,
- choices=[at93cx6.AT93C46, at93cx6.AT93C56,
- at93cx6.AT93C66, at93cx6.AT93C86],
- help='The chip model (default: %(default)s)')
-
-def access_parser(ap):
- # Default, based on currenct HW configuration
- SPI_CS_DEFAULT = 68
- SPI_CLK_DEFAULT = 69
- SPI_MOSI_DEFAULT = 70
- SPI_MISO_DEFAULT = 71
-
- spi_group = ap.add_argument_group('SPI Access')
- spi_group.add_argument('--cs', type=int, default=SPI_CS_DEFAULT,
- help='The GPIO number for SPI CS pin '
- '(default: %(default)s)')
- spi_group.add_argument('--clk', type=int, default=SPI_CLK_DEFAULT,
- help='The GPIO number for SPI CLK pin '
- '(default: %(default)s)')
- spi_group.add_argument('--mosi', type=int, default=SPI_MOSI_DEFAULT,
- help='The GPIO number for SPI MOSI pin '
- '(default: %(default)s)')
- spi_group.add_argument('--miso', type=int, default=SPI_MISO_DEFAULT,
- help='The GPIO number for SPI MISO pin '
- '(default: %(default)s)')
-
-def bus_width_parser(ap):
- # Default, based on currenct HW configuration
- AT83C46_BUS_WIDTH = 16
-
- bus_group = ap.add_argument_group('Bus Width')
- bus_group.add_argument('--bus-width', type=int, default=AT83C46_BUS_WIDTH,
- help='The configured bus width '
- '(default: %(default)s)')
-
-def read_raw(args):
- raw = get_raw(args)
- val = raw.read(args.address)
-
- if args.int:
- print "{}".format(val)
- else:
- if args.bus_width == 16:
- print "0x{:04X}".format(val)
- else:
- print "0x{:02X}".format(val)
-
-def write_raw(args):
- if args.value[:2] == "0x":
- value = int(args.value, 16)
- else:
- value = int(args.value)
-
- raw = get_raw(args)
- raw.ewen()
- raw.erase(args.address)
- raw.write(args.address, value)
- raw.ewds()
-
-def erase_raw(args):
- raw = get_raw(args)
- raw.ewen()
- raw.erase(args.address)
- raw.ewds()
-
-def raw_subparser(subparsers):
- raw_parser = subparsers.add_parser(
- 'raw', help='Raw memory access')
- raw_sub = raw_parser.add_subparsers()
-
- read_parser = raw_sub.add_parser(
- 'read', help='Read a single memory address')
- read_parser.add_argument(
- 'address', type=int, help='The memory address')
- read_parser.add_argument('--int', action='store_true',
- help='Display output as an integer')
- read_parser.set_defaults(func=read_raw)
-
- write_parser = raw_sub.add_parser(
- 'write', help='Write a single memory address')
- write_parser.add_argument(
- 'address', type=int, help='The memory address')
- write_parser.add_argument(
- 'value', type=str, help='The value to write, either integer or hex')
- write_parser.set_defaults(func=write_raw)
-
- erase_parser = raw_sub.add_parser(
- 'erase', help='Erase a single memory address')
- erase_parser.add_argument('address', type=int, help='The memory address')
- erase_parser.set_defaults(func=erase_raw)
-
-def read_chip(args):
- chip = get_chip(args)
- data = chip.read(args.start, args.length)
-
- if args.file is None:
- sys.stdout.write(data)
- else:
- with open(args.file, "wb") as fp:
- fp.write(data)
-
-def write_chip(args):
- chip = get_chip(args)
-
- # Either way, limit reads to the size of the chip
- if args.file is None:
- data = sys.stdin.read(chip.get_memory_size())
- else:
- with open(args.file, "rb") as fp:
- data = fp.read(chip.get_memory_size())
-
- if args.length is not None:
- # Make sure length is correct
- if len(data) < args.length:
- data = data + '\x00' * (args.length - len(data))
- if len(data) > args.length:
- data = data[:args.length]
-
- chip.write(data, args.start)
-
-def erase_chip(args):
- chip = get_chip(args)
- chip.erase(args.start, args.length)
-
-def chip_subparser(subparsers):
- chip_parser = subparsers.add_parser('chip', help='Chip-level access')
- chip_sub = chip_parser.add_subparsers()
-
- read_parser = chip_sub.add_parser('read', help='Read from the chip')
- read_parser.add_argument('--start', type=int,
- help='The memory address to start at (default: 0)')
- read_parser.add_argument('--length', type=int,
- help='The number of bytes to read '
- '(default: whole chip)')
- read_parser.add_argument('--file', type=str,
- help='File to operate on (default: stdout)')
- read_parser.add_argument('--byte-swap', default=False, action='store_true',
- help='Byte swap values for 16-bit reads/writes '
- '(default: %(default)s)')
- read_parser.set_defaults(func=read_chip)
-
- write_parser = chip_sub.add_parser('write', help='Write to the chip')
- write_parser.add_argument('--start', type=int,
- help='The memory address to start at '
- '(default: 0)')
- write_parser.add_argument('--length', type=int,
- help='The number of bytes to write '
- '(default: file length)')
- write_parser.add_argument('--file', type=str,
- help='File to operate on (default: stdin)')
- write_parser.add_argument('--byte-swap', default=False, action='store_true',
- help='Byte swap values for 16-bit reads/writes '
- '(default: %(default)s)')
- write_parser.set_defaults(func=write_chip)
-
- erase_parser = chip_sub.add_parser('erase', help='Erase the chip')
- erase_parser.add_argument('--start', type=int,
- help='The memory address to start at '
- '(default: 0)')
- erase_parser.add_argument('--length', type=int,
- help='The number of bytes to erase '
- '(default: whole chip)')
- erase_parser.set_defaults(func=erase_chip)
-
-if __name__ == "__main__":
- # General arguments
- ap = ArgumentParser()
- ap.add_argument('--verbose', action='store_true',
- help='Print verbose debugging information')
-
- # Model, SPI, and bus width arguments
- model_parser(ap)
- access_parser(ap)
- bus_width_parser(ap)
-
- # Functionality
- subparsers = ap.add_subparsers()
- raw_subparser(subparsers)
- chip_subparser(subparsers)
-
- # Command runner
- args = ap.parse_args()
- args.func(args)
diff --git a/meta-facebook/meta-wedge/recipes-wedge/fbutils/files/bcm5396.py b/meta-facebook/meta-wedge/recipes-wedge/fbutils/files/bcm5396.py
deleted file mode 100644
index 91d9a85..0000000
--- a/meta-facebook/meta-wedge/recipes-wedge/fbutils/files/bcm5396.py
+++ /dev/null
@@ -1,467 +0,0 @@
-#
-# Copyright 2004-present Facebook. All rights reserved.
-#
-# This program file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program in a file named COPYING; if not, write to the
-# Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor,
-# Boston, MA 02110-1301 USA
-#
-from __future__ import print_function
-
-
-import subprocess
-import time
-
-
-class Bcm5396MDIO:
- '''The class to access BCM5396 through MDIO intf'''
- MDIO_CMD = 'mdio-bb'
-
- PHYADDR = 0x1E
-
- ACCESS_CTRL_REG = 16
- IO_CTRL_REG = 17
- STATUS_REG = 18
- DATA0_REG = 24
- DATA1_REG = 25
- DATA2_REG = 26
- DATA3_REG = 27
-
- def __init__(self, mdc, mdio):
- self.mdc = mdc
- self.mdio = mdio
- self.page = -1
-
- def __io(self, op, reg, val=0):
- cmd = '%s -p -c %s -d %s %s %s %s' \
- % (self.MDIO_CMD, self.mdc, self.mdio, op, str(self.PHYADDR),
- str(reg))
- if op == 'write':
- cmd += ' %s' % val
- out = subprocess.Popen(cmd.split(), stdout=subprocess.PIPE)\
- .communicate()[0]
- if op == 'write':
- return val
- # need to parse the result for read
- rc = 0
- for line in out.split('\n'):
- if not line.startswith('Read:'):
- continue
- rc = int(line.split(':')[1], 0)
- return rc
-
- def __read_mdio(self, reg):
- return self.__io('read', reg)
-
- def __write_mdio(self, reg, val):
- return self.__io('write', reg, val)
-
- def __set_page(self, page):
- if self.page == page:
- return
- # Write MII register ACCESS_CTRL_REG:
- # set bit 0 as "1" to enable MDIO access
- # set "page number to bit 15:8
- val = 0x1 | ((page & 0xff) << 8)
- self.__write_mdio(self.ACCESS_CTRL_REG, val)
- self.page = page
-
- def __wait_for_done(self):
- # Read MII register IO_CTRL_REG:
- # Check op_code = "00"
- while (self.__read_mdio(self.IO_CTRL_REG) & 0x3):
- time.sleep(0.010) # 10ms
-
- def read(self, page, reg, n_bytes):
- self.__set_page(page)
- # Write MII register IO_CTRL_REG:
- # set "Operation Code as "00"
- # set "Register Address" to bit 15:8
- val = 0x00 | ((reg & 0xff) << 8)
- self.__write_mdio(self.IO_CTRL_REG, val)
- # Write MII register IO_CTRL_REG:
- # set "Operation Code as "10"
- # set "Register Address" to bit 15:8
- val = 0x2 | ((reg & 0xff) << 8)
- self.__write_mdio(self.IO_CTRL_REG, val)
- self.__wait_for_done()
- # Read MII register DATA0_REG for bit 15:0
- val = long(self.__read_mdio(self.DATA0_REG))
- # Read MII register DATA1_REG for bit 31:16
- val |= self.__read_mdio(self.DATA1_REG) << 16
- # Read MII register DATA2_REG for bit 47:32
- val |= self.__read_mdio(self.DATA2_REG) << 32
- # Read MII register DATA3_REG for bit 63:48
- val |= self.__read_mdio(self.DATA3_REG) << 48
- return val
-
- def write(self, page, reg, val, n_bytes):
- self.__set_page(page)
- # Write MII register DATA0_REG for bit 15:0
- self.__write_mdio(self.DATA0_REG, val & 0xFFFF)
- # Write MII register DATA1_REG for bit 31:16
- self.__write_mdio(self.DATA1_REG, (val >> 16) & 0xFFFF)
- # Write MII register DATA2_REG for bit 47:32
- self.__write_mdio(self.DATA2_REG, (val >> 32) & 0xFFFF)
- # Write MII register DATA3_REG for bit 63:48
- self.__write_mdio(self.DATA3_REG, (val >> 48) & 0xFFFF)
- # Write MII register IO_CTRL_REG:
- # set "Operation Code as "00"
- # set "Register Address" to bit 15:8
- val = 0x00 | ((reg & 0xff) << 8)
- self.__write_mdio(self.IO_CTRL_REG, val)
- # Write MII register IO_CTRL_REG:
- # set "Operation Code as "01"
- # set "Register Address" to bit 15:8
- val = 0x1 | ((reg & 0xff) << 8)
- self.__write_mdio(self.IO_CTRL_REG, val)
- self.__wait_for_done()
-
-
-class Bcm5396SPI:
- '''The class to access BCM5396 through SPI interface'''
- SPI_CMD = 'spi-bb'
-
- READ_CMD = 0x60
- WRITE_CMD = 0x61
-
- SPI_STS_DIO = 0xF0
- SPI_STS_REG = 0xFE
- SPI_STS_REG_RACK = 0x1 << 5
- SPI_STS_REG_SPIF = 0x1 << 7
- PAGE_REG = 0xFF
-
- def __init__(self, cs, clk, mosi, miso):
- self.cs = cs
- self.clk = clk
- self.mosi = mosi
- self.miso = miso
- self.page = -1
-
- def __bytes2val(self, values):
- # LSB first, MSB last
- pos = 0
- result = 0L
- for byte in values:
- if type(byte) is str:
- byte = int(byte, 16)
- if byte > 255:
- raise Exception('%s is not a byte in the list %s'\
- % (byte, values))
- result |= byte << pos
- pos += 8
- return result
-
- def __val2bytes(self, value, n):
- result = []
- for _ in range(n):
- result.append(value & 0xFF)
- value >>= 8
- if value > 0:
- raise Exception('Value, %s, is too large for %s bytes'
- % (value, n))
- return result
-
- def __io(self, bytes_to_write, to_read=0):
- # TODO: check parameters
- cmd = '%s -s %s -S low -c %s -o %s -i %s '\
- % (self.SPI_CMD, self.cs, self.clk, self.mosi, self.miso)
- if len(bytes_to_write):
- write_cmd = '-w %s %s '\
- % (len(bytes_to_write) * 8,
- ' '.join([str(byte) for byte in bytes_to_write]))
- else:
- write_cmd = ''
- if to_read:
- # spi-bb will first return the exact number of bits used for
- # writing. So, total number of bits to read should also include
- # the number of bits written.
- cmd += '-r %s ' % str((len(bytes_to_write) + to_read) * 8)
- cmd += write_cmd
- rc = 0L
- out = subprocess.Popen(cmd.split(), stdout=subprocess.PIPE)\
- .communicate()[0]
- if to_read:
- # need to parse the result
- for line in out.split('\n'):
- if not line.startswith('Read'):
- continue
- res = line.split(':')[1]
- rc = self.__bytes2val(res.split()[len(bytes_to_write):])
- break
- return rc
-
- def __set_page(self, page):
- page &= 0xff
- if self.page == page:
- return
- self.__io([self.WRITE_CMD, self.PAGE_REG, page])
- self.page = page
-
- def __read_spi_reg(self, reg):
- reg &= 0xFF
- return self.__io([self.READ_CMD, reg], 1)
-
- def __read_spi_sts(self):
- return self.__read_spi_reg(self.SPI_STS_REG)
-
- def __read_spi_dio(self):
- return self.__read_spi_reg(self.SPI_STS_DIO)
-
- def read(self, page, reg, n_bytes):
- '''Read a register value from a page.'''
- if n_bytes > 8:
- print('TODO to support reading more than 8 bytes')
- return 0
- if page > 0xff or reg > 0xff:
- print('Page and register must be <= 255')
- return 0
- try:
- self.__set_page(page)
- self.__io([self.READ_CMD, reg], 1)
- while True:
- # check sts
- sts = self.__read_spi_sts()
- if sts & self.SPI_STS_REG_RACK:
- break
- bytes = []
- for _ in range(n_bytes):
- bytes.append(self.__read_spi_dio())
- except Exception as e:
- print(e)
- return self.__bytes2val(bytes)
-
- def write(self, page, reg, val, n_bytes):
- '''Write a value as n bytes to a register on a page.'''
- if page > 0xff or reg > 0xff:
- print('Page and register must be <= 255')
- return
- bytes = self.__val2bytes(val, n_bytes)
- if len(bytes) > 8:
- print('TODO to support writing more than 8 bytes')
- return
- bytes = [self.WRITE_CMD, reg] + bytes
- try:
- self.__set_page(page)
- self.__io(bytes)
- except Exception as e:
- print(e)
-
-
-class Bcm5396:
- '''The class for BCM5396 Switch'''
-
- MDIO_ACCESS = 0
- SPI_ACCESS = 1
-
- def __init__(self, access, verbose=False, **kwargs):
- self.verbose = verbose
- if access == self.MDIO_ACCESS:
- self.access = Bcm5396MDIO(**kwargs)
- else:
- self.access = Bcm5396SPI(**kwargs)
-
- def write(self, page, reg, value, n_bytes):
- if self.verbose:
- print('WRITE {:2x} {:2x} {:2x} '.format(page, reg, n_bytes), end='')
- bytes = '{:2x}'.format(value)
- print([bytes[i:i+2] for i in range(0, len(bytes), 2)][-n_bytes:])
- return self.access.write(page, reg, value, n_bytes)
-
- def read(self, page, reg, n_bytes):
- if self.verbose:
- print('READ {:2x} {:2x} {:2x} '.format(page, reg, n_bytes), end='')
- result = self.access.read(page, reg, n_bytes)
- if self.verbose:
- bytes = '{:2x}'.format(result)
- print([bytes[i:i+2] for i in range(0, len(bytes), 2)][-n_bytes:])
- return result
-
- def __add_remove_vlan(self, add, vid, untag, fwd, spt):
- VLAN_PAGE = 0x5
- CTRL_ADDR = 0x60
- CTRL_START_DONE = (0x1 << 7)
- VID_ADDR = 0x61
- ENTRY_ADDR = 0x63
-
- fwd_map = self.__ports2portmap(fwd)
- untag_map = self.__ports2portmap(untag)
-
- # mark it as write and stop the previous action
- ctrl = 0
- self.write(VLAN_PAGE, CTRL_ADDR, ctrl, 1)
- # write entry
- if (add):
- entry = 0x1L | ((spt & 0x1F) << 1) \
- | (fwd_map << 6) | (untag_map << 23)
- else:
- entry = 0x0L
- self.write(VLAN_PAGE, ENTRY_ADDR, entry, 8)
- # write vid as the index
- self.write(VLAN_PAGE, VID_ADDR, vid & 0xFFF, 2)
- # start the write
- ctrl = CTRL_START_DONE
- self.write(VLAN_PAGE, CTRL_ADDR, ctrl, 1)
- while True:
- ctrl = self.read(VLAN_PAGE, CTRL_ADDR, 1)
- if not (ctrl & CTRL_START_DONE):
- # done
- break
- time.sleep(0.010) # 10ms
-
- def add_vlan(self, vid, untag, fwd, spt=0):
- return self.__add_remove_vlan(True, vid, untag, fwd, spt)
-
- def remove_vlan(self, vid):
- return self.__add_remove_vlan(False, vid, [], [], 0)
-
- def get_vlan(self, vid):
- VLAN_PAGE = 0x5
- CTRL_ADDR = 0x60
- CTRL_START_DONE = (0x1 << 7)
- CTRL_READ = 0x1
- VID_ADDR = 0x61
- ENTRY_ADDR = 0x63
-
- # mark it as read and stop the previous action
- ctrl = CTRL_READ
- self.write(VLAN_PAGE, CTRL_ADDR, ctrl, 1)
- # write the vid as the index
- self.write(VLAN_PAGE, VID_ADDR, vid & 0xFFF, 2)
- # start the read
- ctrl = CTRL_READ|CTRL_START_DONE
- self.write(VLAN_PAGE, CTRL_ADDR, ctrl, 1)
- while True:
- ctrl = self.read(VLAN_PAGE, CTRL_ADDR, 1)
- if not (ctrl & CTRL_START_DONE):
- # done
- break
- time.sleep(0.010) # 10ms
- entry = self.read(VLAN_PAGE, ENTRY_ADDR, 8)
- res = {}
- res['valid'] = True if entry & 0x1 else False
- res['spt'] = (entry >> 1) & 0x1f
- res['fwd'] = self.__portmap2ports((entry >> 6) & 0x1ffff)
- res['untag'] = self.__portmap2ports((entry >> 23) & 0x1ffff)
- return res
-
- def __portmap2ports(self, port_map):
- return list(set([port if port_map & (0x1 << port) else None
- for port in range (0, 17)])
- - set([None]))
-
- def __ports2portmap(self, ports):
- port_map = 0
- for port in ports:
- port_map |= (0x1 << port)
- return port_map & 0x1FFFF
-
- def __parse_arl_result(self, vid, result):
- is_bitset = lambda bit: True if result & (0x1 << bit) else False
- if not is_bitset(3):
- return None
- res = {}
- # parse vid first
- res['vid'] = (vid >> 48) & 0xfff
- mac_val = vid & 0xffffffffffffL
- mac_list = []
- for pos in range(5, -1, -1):
- mac_list.append('{:02x}'.format((mac_val >> (pos * 8)) & 0xff))
- res['mac'] = ':'.join(mac_list)
- if mac_val & (0x1 << 40):
- res['ports'] = self.__portmap2ports((result >> 6) & 0xffff)
- else:
- res['ports'] = [(result >> 6) & 0xf]
- res['static'] = is_bitset(5)
- res['age'] = is_bitset(4)
- res['valid'] = is_bitset(3)
- res['priority'] = result & 0x7
- return res
-
- def get_all_arls(self):
- ARL_PAGE = 0x5
- SEARCH_CTRL_ADDR = 0x30
- SEARCH_CTRL_START_DONE = (0x1 << 7)
- SEARCH_CTRL_SR_VALID = (0x1)
-
- VID0_ADDR = 0x33
- RESULT0_ADDR = 0x3B
- VID1_ADDR = 0x40
- RESULT1_ADDR = 0x48
-
- all = []
- # write START to search control
- ctrl = SEARCH_CTRL_START_DONE
- self.write(ARL_PAGE, SEARCH_CTRL_ADDR, ctrl, 1)
- while True:
- ctrl = self.read(ARL_PAGE, SEARCH_CTRL_ADDR, 1)
- if not (ctrl & SEARCH_CTRL_START_DONE):
- # Done
- break
- if not (ctrl & SEARCH_CTRL_SR_VALID):
- # result is not ready, sleep and retry
- time.sleep(0.010) # 10ms
- continue
- for vid_addr, result_addr in [[VID1_ADDR, RESULT1_ADDR],
- [VID0_ADDR, RESULT0_ADDR]]:
- vid = self.read(ARL_PAGE, vid_addr, 8)
- result = self.read(ARL_PAGE, result_addr, 4)
- one = self.__parse_arl_result(vid, result)
- if one:
- all.append(one)
- return all
-
- def vlan_ctrl(self, enable):
- VLAN_CTRL_PAGE = 0x34
- VLAN_CTRL0_REG = 0x0
- VLAN_CTRL0_B_EN_1QVLAN = 0x1 << 7
-
- ctrl = self.read(VLAN_CTRL_PAGE, VLAN_CTRL0_REG, 1)
- need_write = False
- if enable:
- if not ctrl & VLAN_CTRL0_B_EN_1QVLAN:
- need_write = True;
- ctrl |= VLAN_CTRL0_B_EN_1QVLAN
- else:
- if ctrl & VLAN_CTRL0_B_EN_1QVLAN:
- need_write = True;
- ctrl &= (~VLAN_CTRL0_B_EN_1QVLAN) & 0xFF
- if need_write:
- self.write(VLAN_CTRL_PAGE, VLAN_CTRL0_REG, ctrl, 1)
-
- def vlan_set_port_default(self, port, vid, pri=0):
- VLAN_PORT_PAGE = 0x34
- VLAN_PORT_REG_BASE = 0x10
-
- if port < 0 or port > 16:
- raise Exception('Invalid port number %s' % port)
- if pri < 0 or pri > 7:
- raise Exception('Invalid priority %s' % pri)
- if vid < 0 or vid > 0xFFF:
- raise Exception('Invalid VLAN %s' % vid)
- reg = VLAN_PORT_REG_BASE + port * 2
- ctrl = (pri << 13) | vid
- self.write(VLAN_PORT_PAGE, reg, ctrl, 2)
-
- def vlan_get_port_default(self, port):
- VLAN_PORT_PAGE = 0x34
- VLAN_PORT_REG_BASE = 0x10
-
- if port < 0 or port > 16:
- raise Exception('Invalid port number %s' % port)
- reg = VLAN_PORT_REG_BASE + port * 2
- val = self.read(VLAN_PORT_PAGE, reg, 2)
- res = {}
- res['priority'] = (val >> 13) & 0x7
- res['vid'] = val & 0xFFF
- return res
diff --git a/meta-facebook/meta-wedge/recipes-wedge/fbutils/files/bcm5396_util.py b/meta-facebook/meta-wedge/recipes-wedge/fbutils/files/bcm5396_util.py
deleted file mode 100644
index 0759b08..0000000
--- a/meta-facebook/meta-wedge/recipes-wedge/fbutils/files/bcm5396_util.py
+++ /dev/null
@@ -1,266 +0,0 @@
-#!/usr/bin/python -tt
-# Copyright 2004-present Facebook. All rights reserved.
-#
-# This program file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program in a file named COPYING; if not, write to the
-# Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor,
-# Boston, MA 02110-1301 USA
-#
-
-from argparse import ArgumentParser
-from bcm5396 import Bcm5396
-
-def auto_long(x):
- return long(x, 0)
-
-def auto_int(x):
- return int(x, 0)
-
-def get_bcm(args):
- if args.spi:
- return Bcm5396(Bcm5396.SPI_ACCESS, cs=args.cs, clk=args.clk,
- mosi=args.mosi, miso=args.miso,
- verbose=args.verbose)
- else:
- return Bcm5396(Bcm5396.MDIO_ACCESS, mdc=args.mdc, mdio=args.mdio,
- verbose=args.verbose)
-
-
-def read_register(args):
- bcm = get_bcm(args)
- val = bcm.read(args.page, args.register, args.size)
- print('Read from BCM5396 ({}:{}.{}): {}'
- .format(hex(args.page), hex(args.register), args.size, hex(val)))
-
-def write_register(args):
- bcm = get_bcm(args)
- val = bcm.write(args.page, args.register, args.value, args.size)
- print('Write to BCM5396 ({}.{}): {}'
- .format(hex(args.page), hex(args.register), hex(args.value)))
-
-def register_parser(subparser):
- reg_parser = subparser.add_parser('register', help='Register IO')
- reg_sub = reg_parser.add_subparsers()
-
- read_parser = reg_sub.add_parser('read', help='read switch register')
- read_parser.set_defaults(func=read_register)
- read_parser.add_argument('page', type=auto_int,
- help='The page of the register')
- read_parser.add_argument('register', type=auto_int,
- help='The register to read from')
- read_parser.add_argument('size', type=auto_int,
- help='Number of bytes',
- choices=range(1, 9))
-
- write_parser = reg_sub.add_parser('write', help='write switch register')
- write_parser.set_defaults(func=write_register)
- write_parser.add_argument('page', type=auto_int,
- help='The page oof the register')
- write_parser.add_argument('register', type=auto_int,
- help='The register to write to')
- write_parser.add_argument('value', type=auto_long,
- help='The value to write')
- write_parser.add_argument('size', type=auto_int,
- help='Number of bytes',
- choices=range(1, 9))
-
-
-def dump_arl(args):
- bcm = get_bcm(args)
- arls = bcm.get_all_arls()
- print('All ARLs are:')
- for entry in arls:
- print(entry)
-
-def arl_parser(subparser):
- dump_parser = subparser.add_parser('arl', help='dump all ARL entries')
- dump_parser.set_defaults(func=dump_arl)
-
-
-def __parse_port_list(parm):
- '''Parse the port numbers to a list'''
- if len(parm) == 0:
- return []
- ports=[]
- for port in parm.split(','):
- idx = port.find('-')
- if idx == -1:
- p = int(port)
- if p < 0 or p > 15:
- raise Exception('Invalid port number %s' % p)
- # just one port
- ports.append(p)
- else:
- start = int(port[:idx])
- end = int(port[idx+1:])
- if start > end or start < 0 or end > 15:
- raise Exception('Invalid port range %s-%s' % (start, end))
- ports.extend(range(start, end + 1))
- return ports
-
-def enable_vlan(args):
- bcm = get_bcm(args)
- bcm.vlan_ctrl(True)
- print('VLAN function is enabled.')
-
-def disable_vlan(args):
- bcm = get_bcm(args)
- bcm.vlan_ctrl(False)
- print('VLAN function is disabled.')
-
-def add_vlan(args):
- bcm = get_bcm(args)
- vid = args.vid
- fwd = sorted(__parse_port_list(args.fwd))
- untag = sorted(__parse_port_list(args.untag))
- spt = args.spt
- # make sure untag is subset of fwd
- if not set(untag).issubset(set(fwd)):
- raise Exception('Some untagged ports, %s, are not part of forward ports'
- % (set(untag) - set(fwd)))
- bcm.add_vlan(vid, untag, fwd, spt)
- print('Added VLAN: %s' % vid)
- print('Ports in VLAN: %s' % sorted(fwd))
- print('Ports without VLAN tag: %s' % sorted(untag))
-
-def remove_vlan(args):
- bcm = get_bcm(args)
- vid = args.vid
- bcm.remove_vlan(vid)
- print('Removed VLAN: %s' % vid)
-
-def show_vlan(args):
- bcm = get_bcm(args)
- vid = args.vid
- vlan = bcm.get_vlan(vid)
- if not vlan['valid']:
- print('VLAN %s does not exist' % vid)
- else:
- print('VLAN: %s' % vid)
- print('Spanning tree index: %s' % vlan['spt'])
- print('Ports in VLAN: %s' % sorted(vlan['fwd']))
- print('Untagged ports in VLAN: %s' % sorted(vlan['untag']))
-
-def set_port_vlan(args):
- bcm = get_bcm(args)
- bcm.vlan_set_port_default(args.port, args.vid, args.pri)
- print('Set VLAN default for port: %s' % args.port)
- print('Default VLAN: %s' % args.vid)
- print('Default priority %s' % args.pri)
-
-def get_port_vlan(args):
- bcm = get_bcm(args)
- port = bcm.vlan_get_port_default(args.port)
- print('Get VLAN default for port: %s' % args.port)
- print('Default VLAN: %s' % port['vid'])
- print('Default priority: %s' % port['priority'])
-
-def vlan_parser(subparser):
- UNTAG_DEFAULT = ''
- SPT_DEFAULT = 0
- PRI_DEFAULT = 0
-
- vlan_parser = subparser.add_parser('vlan', help='Manage vlan function')
- vlan_sub = vlan_parser.add_subparsers()
-
- add_parser = vlan_sub.add_parser('add', help='Add or modify a VLAN entry')
- add_parser.add_argument('vid', type=int, help='The VLAN ID')
- add_parser.add_argument('fwd', type=str,
- help='Ports belonging to this VLAN. i.e. 1,4,5-8')
- add_parser.add_argument('untag', type=str, default=UNTAG_DEFAULT, nargs='?',
- help='Ports that do not add VLAN tag. i.e. 1,4,5-8'
- ' (default: all ports are tagged)')
- add_parser.add_argument('spt', type=int, default=SPT_DEFAULT, nargs='?',
- help='Spanning tree index (default: %s)'
- % SPT_DEFAULT)
- add_parser.set_defaults(func=add_vlan)
-
- remove_parser = vlan_sub.add_parser('remove', help='Remove a VLAN entry')
- remove_parser.add_argument('vid', type=int, help='The VLAN ID')
- remove_parser.set_defaults(func=remove_vlan)
-
- show_parser = vlan_sub.add_parser('show', help='Show a VLAN entry')
- show_parser.add_argument('vid', type=int, help='The VLAN ID')
- show_parser.set_defaults(func=show_vlan)
-
- enable_parser = vlan_sub.add_parser('enable', help='Enable VLAN function')
- enable_parser.set_defaults(func=enable_vlan)
-
- disable_parser = vlan_sub.add_parser('disable', help='Enable VLAN function')
- disable_parser.set_defaults(func=disable_vlan)
-
- port_parser = vlan_sub.add_parser('port',
- help='Set/Get VLAN default for a port')
- port_sub = port_parser.add_subparsers()
- set_port = port_sub.add_parser('set', help='Set VLAN default for a port')
- set_port.add_argument('port', type=int, help='The port number (0..16)')
- set_port.add_argument('vid', type=int,
- help='The default VLAN for this port')
- set_port.add_argument('pri', type=int, default=PRI_DEFAULT, nargs='?',
- help='The default priority for this port '
- '(default: %s)' % PRI_DEFAULT)
- set_port.set_defaults(func=set_port_vlan)
-
- get_port = port_sub.add_parser('get', help='Get VLAN default for a port')
- get_port.add_argument('port', type=int, help='The port number (0..16)')
- get_port.set_defaults(func=get_port_vlan)
-
-def access_parser(ap):
- SPI_CS_DEFAULT = 68
- SPI_CLK_DEFAULT = 69
- SPI_MOSI_DEFAULT = 70
- SPI_MISO_DEFAULT = 71
-
- MDIO_MDC_DEFAULT = 6
- MDIO_MDIO_DEFAULT = 7
-
- spi_group = ap.add_argument_group('SPI Access')
- spi_group.add_argument('--spi', action='store_true',
- help='Access through SPI.')
- spi_group.add_argument('--cs', type=int, default=SPI_CS_DEFAULT,
- help='The GPIO number for SPI CS pin (default: %s)'
- % SPI_CS_DEFAULT)
- spi_group.add_argument('--clk', type=int, default=SPI_CLK_DEFAULT,
- help='The GPIO number for SPI CLK pin (default: %s)'
- % SPI_CLK_DEFAULT)
- spi_group.add_argument('--mosi', type=int, default=SPI_MOSI_DEFAULT,
- help='The GPIO number for SPI MOSI pin (default: %s)'
- % SPI_MOSI_DEFAULT)
- spi_group.add_argument('--miso', type=int, default=SPI_MISO_DEFAULT,
- help='The GPIO number for SPI MISO pin (default: %s)'
- % SPI_MISO_DEFAULT)
- mdio_group = ap.add_argument_group('MDIO Access (default)')
- mdio_group.add_argument('--mdc', type=int, default=MDIO_MDC_DEFAULT,
- help='The GPIO number for MDC pin (default: %s)'
- % MDIO_MDC_DEFAULT)
- mdio_group.add_argument('--mdio', type=int, default=MDIO_MDIO_DEFAULT,
- help='The GPIO number for MDIO pin (default: %s)'
- % MDIO_MDIO_DEFAULT)
- return ap
-
-
-if __name__ == '__main__':
- ap = ArgumentParser()
- ap.add_argument('-v', '--verbose', action='store_true',
- help='Dump the switch page, register, and value '
- 'for each operation')
-
- access_parser(ap)
-
- subparsers = ap.add_subparsers()
- register_parser(subparsers)
- arl_parser(subparsers)
- vlan_parser(subparsers)
- args = ap.parse_args()
-
- args.func(args)
diff --git a/meta-facebook/meta-wedge/recipes-wedge/fbutils/files/board-utils.sh b/meta-facebook/meta-wedge/recipes-wedge/fbutils/files/board-utils.sh
deleted file mode 100644
index e4d34aa..0000000
--- a/meta-facebook/meta-wedge/recipes-wedge/fbutils/files/board-utils.sh
+++ /dev/null
@@ -1,163 +0,0 @@
-# Copyright 2014-present Facebook. All Rights Reserved.
-wedge_iso_buf_enable() {
- # GPIOC2 (18) to low, SCU90[0] and SCU90[24] must be 0
- devmem_clear_bit $(scu_addr 90) 0
- devmem_clear_bit $(scu_addr 90) 24
- gpio_set 18 0
-}
-
-wedge_iso_buf_disable() {
- # GPIOC2 (18) to low, SCU90[0] and SCU90[24] must be 0
- devmem_clear_bit $(scu_addr 90) 0
- devmem_clear_bit $(scu_addr 90) 24
- gpio_set 18 1
-}
-
-wedge_is_us_on() {
- local val n retries prog
- if [ $# -gt 0 ]; then
- retries="$1"
- else
- retries=1
- fi
- if [ $# -gt 1 ]; then
- prog="$2"
- else
- prog=""
- fi
- if [ $# -gt 2 ]; then
- default=$3 # value 0 means defaul is 'ON'
- else
- default=1
- fi
- n=1
- while true; do
- val=$(cat /sys/class/i2c-adapter/i2c-4/4-0040/gpio_inputs 2>/dev/null)
- if [ -n "$val" ]; then
- break
- fi
- n=$((n+1))
- if [ $n -gt $retries ]; then
- echo -n " failed to read GPIO. "
- return $default
- break
- fi
- echo -n "$prog"
- sleep 1
- done
- if [ "$((val & (0x1 << 14)))" != "0" ]; then
- # powered on already
- return 0
- else
- return 1
- fi
-}
-
-
-# Return the board type, 'LC', 'FC-LEFT', 'FC-RIGHT', or, 'WEDGE'
-wedge_board_type() {
- local pn
- pn=$(/usr/bin/weutil 2> /dev/null | grep -i '^Location on Fabric:')
- case "$pn" in
- *LEFT*)
- echo 'FC-LEFT'
- ;;
- *RIGHT*)
- echo 'FC-RIGHT'
- ;;
- *LC*)
- echo 'LC'
- ;;
- *)
- echo 'WEDGE'
- ;;
- esac
-}
-
-# On FC,
-# board rev < 2:
-# FAB_SLOT_ID (GPIOU0), low == FC0; high == FC1
-# else:
-# FAB_SLOT_ID (GPIOU6), low == FC0; high == FC1
-## On LC, Wedge,
-# board rev < 3:
-# GPIOU0(ID0), GPIOU1(ID1), GPIOU2(ID2), GPIOU3(ID3)
-# else:
-# GPIOU6(ID0), GPIOU7(ID1), GPIOV0(ID2), GPIOV1(ID3)
-#
-# ID[2:0] ID3 Slot#
-# 000 0 1
-# 000 1 2
-# 001 0 3
-# 001 1 4
-# 010 0 5
-# 010 1 6
-# 011 0 7
-# 011 1 8
-
-wedge_slot_id() {
- local type slot id3 id2 id1 id0 FC_CARD_BASE board_rev
- FC_CARD_BASE=65
- # need to check the board rev
- board_rev=$(wedge_board_rev)
- case "$1" in
- FC-LEFT|FC-RIGHT)
- # On FC
- if [ $board_rev -lt 2 ]; then
- slot=$(gpio_get U0)
- else
- slot=$(gpio_get U6)
- fi
- if [ "$1" = "FC-LEFT" ]; then
- # fabric card left
- slot=$((FC_CARD_BASE + slot * 2))
- else
- # fabric card right
- slot=$((FC_CARD_BASE + slot * 2 + 1))
- fi
- ;;
- *)
- # either edge or LC
- if [ $board_rev -lt 3 ]; then
- id0=$(gpio_get U0)
- id1=$(gpio_get U1)
- id2=$(gpio_get U2)
- id3=$(gpio_get U3)
- else
- id0=$(gpio_get U6)
- id1=$(gpio_get U7)
- id2=$(gpio_get V0)
- id3=$(gpio_get V1)
- fi
- slot=$(((id2 * 4 + id1 * 2 + id0) * 2 + id3 + 1))
- esac
- echo "$slot"
-}
-
-# wedge_board_rev() is only valid after GPIO Y0, Y1, and Y2 are enabled
-wedge_board_rev() {
- local val0 val1 val2
- val0=$(cat /sys/class/gpio/gpio192/value 2>/dev/null)
- val1=$(cat /sys/class/gpio/gpio193/value 2>/dev/null)
- val2=$(cat /sys/class/gpio/gpio194/value 2>/dev/null)
- echo $((val0 | (val1 << 1) | (val2 << 2)))
-}
-
-# Should we enable OOB interface or not
-wedge_should_enable_oob() {
- board_rev=$(wedge_board_rev)
- board_type=$(wedge_board_type)
- case "$board_type" in
- FC-LEFT|FC-RIGHT)
- if [ $board_rev -lt 2 ]; then
- return 0
- fi
- ;;
- *)
- if [ $board_rev -lt 3 ]; then
- return 0
- fi
- ;;
- esac
- return -1
-}
diff --git a/meta-facebook/meta-wedge/recipes-wedge/fbutils/files/create_vlan_intf b/meta-facebook/meta-wedge/recipes-wedge/fbutils/files/create_vlan_intf
deleted file mode 100644
index 8c7e74b..0000000
--- a/meta-facebook/meta-wedge/recipes-wedge/fbutils/files/create_vlan_intf
+++ /dev/null
@@ -1,37 +0,0 @@
-#!/bin/bash
-#
-# Copyright 2014-present Facebook. All Rights Reserved.
-#
-# This program file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program in a file named COPYING; if not, write to the
-# Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor,
-# Boston, MA 02110-1301 USA
-#
-
-# only care about 'eth0' and 'oob' intf
-[ "$IFACE" != "eth0" ] && [ "$IFACE" != "oob" ] && exit 0
-
-. /usr/local/bin/openbmc-utils.sh
-
-board=$(wedge_board_type)
-
-[ "$board" = "WEDGE" ] && exit 0
-
-vlan=4088
-intf="${IFACE}.${vlan}"
-slot=$(wedge_slot_id $board)
-
-vconfig add $IFACE $vlan
-ifconfig $intf up "fe80::$(printf "%x" $slot):1/64"
-
-exit 0
diff --git a/meta-facebook/meta-wedge/recipes-wedge/fbutils/files/eth0_mac_fixup.sh b/meta-facebook/meta-wedge/recipes-wedge/fbutils/files/eth0_mac_fixup.sh
deleted file mode 100644
index f244bd0..0000000
--- a/meta-facebook/meta-wedge/recipes-wedge/fbutils/files/eth0_mac_fixup.sh
+++ /dev/null
@@ -1,55 +0,0 @@
-#!/bin/bash
-#
-# Copyright 2014-present Facebook. All Rights Reserved.
-#
-# This program file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program in a file named COPYING; if not, write to the
-# Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor,
-# Boston, MA 02110-1301 USA
-#
-
-### BEGIN INIT INFO
-# Provides: eth0_mac_fixup.sh
-# Required-Start:
-# Required-Stop:
-# Default-Start: S
-# Default-Stop:
-# Short-Description: Fixup the MAC address for eth0 based on wedge EEPROM
-### END INIT INFO
-
-PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin
-
-# get the MAC from EEPROM
-mac=$(weutil 2>/dev/null | grep '^Local MAC' 2>/dev/null | cut -d' ' -f3 2>/dev/null)
-
-# get the MAC from u-boot environment
-ethaddr=$(fw_printenv ethaddr 2>/dev/null | cut -d'=' -f2 2>/dev/null)
-
-if [ -z "$mac" ] && [ -n "$ethaddr" ]; then
- # no MAC from EEPROM, use the one from u-boot environment
- mac="$ethaddr"
-fi
-
-if [ -n "$mac" ]; then
- ifconfig eth0 hw ether $mac
-else
- # no MAC from either EEPROM or u-boot environment
- mac=$(ifconfig eth0 2>/dev/null |grep HWaddr 2>/dev/null |awk '{ print $5 }')
-
-fi
-
-if [ "$ethaddr" != "$mac" ]; then
- # set the MAC from EEPROM or ifconfig back to u-boot environment so that u-boot
- # can use it
- fw_setenv "ethaddr" "$mac"
-fi
diff --git a/meta-facebook/meta-wedge/recipes-wedge/fbutils/files/mdio.py b/meta-facebook/meta-wedge/recipes-wedge/fbutils/files/mdio.py
deleted file mode 100755
index aa7d4bf..0000000
--- a/meta-facebook/meta-wedge/recipes-wedge/fbutils/files/mdio.py
+++ /dev/null
@@ -1,124 +0,0 @@
-#!/usr/bin/python
-#
-# Copyright 2014-present Facebook. All Rights Reserved.
-#
-# This program file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program in a file named COPYING; if not, write to the
-# Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor,
-# Boston, MA 02110-1301 USA
-#
-
-from argparse import ArgumentParser
-import subprocess
-import time
-
-IO_BASE = [ 0x1e660000, 0x1e680000 ]
-PHYCR_REG_OFFSET = 0x60
-PHYCR_READ_BIT = 0x1 << 26
-PHYCR_WRITE_BIT = 0x1 << 27
-phycr_reg = lambda mac: IO_BASE[mac - 1] + PHYCR_REG_OFFSET
-PHYDATA_REG_OFFSET = 0x64
-phydata_reg = lambda mac: IO_BASE[mac - 1] + PHYDATA_REG_OFFSET
-
-
-devmem_read_cmd = lambda reg: [ 'devmem', hex(reg) ]
-devmem_write_cmd = lambda reg, val: [ 'devmem', hex(reg), '32', hex(val)]
-
-
-def devmem_read(reg):
- cmd = devmem_read_cmd(reg)
- #print('Cmd: {}'.format(cmd))
- out = subprocess.Popen(cmd, stdout=subprocess.PIPE).communicate()[0]
- return int(out, 0)
-
-
-def devmem_write(reg, val):
- cmd = devmem_write_cmd(reg, val)
- #print('Cmd: {}'.format(cmd))
- subprocess.Popen(cmd, stdout=subprocess.PIPE).communicate()[0]
-
-
-def wait_for_mdio_done(args):
- reg = phycr_reg(args.mac)
- while devmem_read(reg) & (PHYCR_READ_BIT|PHYCR_WRITE_BIT):
- time.sleep(0.010) # 10ms
-
-
-def read_mdio(args):
- reg = phycr_reg(args.mac)
- ctrl = devmem_read(reg)
- ctrl &= 0x3000003f
- ctrl |= (args.phy & 0x1F) << 16
- ctrl |= (args.register & 0x1F) << 21
- ctrl |= PHYCR_READ_BIT
- devmem_write(reg, ctrl)
- wait_for_mdio_done(args)
- val = devmem_read(phydata_reg(args.mac)) >> 16
- print('Read from PHY ({}.{}): {}'
- .format(hex(args.phy), hex(args.register), hex(val)))
-
-
-def write_mdio(args):
- ctrl_reg = phycr_reg(args.mac)
- ctrl = devmem_read(ctrl_reg)
- ctrl &= 0x3000003f
- ctrl |= (args.phy & 0x1F) << 16
- ctrl |= (args.register & 0x1F) << 21
- ctrl |= PHYCR_WRITE_BIT
- data_reg = phydata_reg(args.mac)
- # write data first
- devmem_write(data_reg, args.value)
- # then ctrl
- devmem_write(ctrl_reg, ctrl)
- wait_for_mdio_done(args)
- print('Write to PHY ({}.{}): {}'
- .format(hex(args.phy), hex(args.register), hex(args.value)))
-
-
-def auto_int(x):
- return int(x, 0)
-
-if __name__ == '__main__':
- ap = ArgumentParser()
- ap.add_argument('--mac', '-m', type=int, default=2,
- help='The MAC')
- ap.add_argument('--phy', '-p', type=auto_int, default=0x1f,
- help='The PHY address')
-
- subparsers = ap.add_subparsers()
-
- read_parser = subparsers.add_parser('read',
- help='read MDIO')
- read_parser.set_defaults(func=read_mdio)
- read_parser.add_argument('register', type=auto_int,
- help='The register to read from')
-
- write_parser = subparsers.add_parser('write',
- help='write MDIO')
- write_parser.set_defaults(func=write_mdio)
- write_parser.add_argument('register', type=auto_int,
- help='The register to write to')
- write_parser.add_argument('value', type=auto_int,
- help='The value to write to')
-
- args = ap.parse_args()
-
- if args.mac != 2 and args.mac != 1:
- print("MAC can only be either 1 or 2.")
- exit(-1)
-
- if args.phy > 0x1f:
- printf("PHY address must be smaller than 0x1f.")
- exit(-2)
-
- args.func(args)
diff --git a/meta-facebook/meta-wedge/recipes-wedge/fbutils/files/mount_data0.sh b/meta-facebook/meta-wedge/recipes-wedge/fbutils/files/mount_data0.sh
deleted file mode 100755
index 6986be5..0000000
--- a/meta-facebook/meta-wedge/recipes-wedge/fbutils/files/mount_data0.sh
+++ /dev/null
@@ -1,61 +0,0 @@
-#!/bin/sh
-#
-# Copyright 2014-present Facebook. All Rights Reserved.
-#
-# This program file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program in a file named COPYING; if not, write to the
-# Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor,
-# Boston, MA 02110-1301 USA
-#
-
-### BEGIN INIT INFO
-# Provides: mount_data0
-# Required-Start: mountvirtfs
-# Required-Stop:
-# Default-Start: S
-# Default-Stop:
-# Short-Description: Mount data0 partition from flash chip.
-# Description:
-### END INIT INFO
-
-. /etc/default/rcS
-
-# Find out which device maps to 'data0' on mtd
-# Note: /proc/mtd lists partitions using mtdX, where X is a number,
-# but we mount using /dev/mtdblockX. We'll do some magic here
-# to get the mtdX (char device) and mtdblockX (block device)
-# names.
-MOUNT_POINT="/mnt/data"
-DATA_CHAR_DEV=$(cat /proc/mtd | awk '{ if ($4 == "\"data0\"") print $1 }' |
- cut -d ':' -f 1 | awk '{ print "/dev/" $1 }')
-if [ -z "$DATA_CHAR_DEV" ]
-then
- echo "No data0 partition found. Not mounting anything to $MOUNT_POINT."
-else
- DEVICE_ID=$(echo $DATA_CHAR_DEV | tail -c 2)
- DATA_BLOCK_DEV=${DATA_CHAR_DEV/mtd/mtdblock}
-
- echo "data0 partition found on $DATA_BLOCK_DEV; mounting to $MOUNT_POINT."
- mount -t jffs2 $DATA_BLOCK_DEV $MOUNT_POINT
-
- # if the mount failed, format the partition and remount
- if [ $? -ne 0 ]
- then
- echo "Mount failed; formatting $DATA_BLOCK_DEV and remounting."
- flash_eraseall $DATA_CHAR_DEV
- mount -t jffs2 $DATA_BLOCK_DEV $MOUNT_POINT
- fi
-fi
-
-: exit 0
-
diff --git a/meta-facebook/meta-wedge/recipes-wedge/fbutils/files/post_led.sh b/meta-facebook/meta-wedge/recipes-wedge/fbutils/files/post_led.sh
deleted file mode 100644
index b653cb3..0000000
--- a/meta-facebook/meta-wedge/recipes-wedge/fbutils/files/post_led.sh
+++ /dev/null
@@ -1,105 +0,0 @@
-#!/bin/sh
-#
-# Copyright 2004-present Facebook. All rights reserved.
-#
-# This program file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program in a file named COPYING; if not, write to the
-# Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor,
-# Boston, MA 02110-1301 USA
-#
-
-usage() {
- echo "Displays values onto the debug header LEDs."
- echo "Hex and decimal accepted."
- echo "Usage: $0 <value>"
-}
-
-. /usr/local/bin/openbmc-utils.sh
-
-# Function to set the less significant hex digit
-display_lower() {
- local bit0=$(expr $1 % 2)
- local bit1=$(expr $1 / 2 % 2)
- local bit2=$(expr $1 / 4 % 2)
- local bit3=$(expr $1 / 8 % 2)
-
- # Set the pins to the correct operating mode.
- # The relevant pins are GPIOG[0...3].
- # For GPIO bank G, SCU84[0..3] must be 0.
- devmem_clear_bit $(scu_addr 84) 0
- devmem_clear_bit $(scu_addr 84) 1
- devmem_clear_bit $(scu_addr 84) 2
- devmem_clear_bit $(scu_addr 84) 3
-
- # Now set the GPIOs to the right binary values
- gpio_set 48 $bit0
- gpio_set 49 $bit1
- gpio_set 50 $bit2
- gpio_set 51 $bit3
-}
-
-# Function to set the more significant hex digit
-display_upper() {
- local bit0=$(expr $1 % 2)
- local bit1=$(expr $1 / 2 % 2)
- local bit2=$(expr $1 / 4 % 2)
- local bit3=$(expr $1 / 8 % 2)
-
- # Set the pins to the correct operating mode.
- # The relevant pins are GPIOB[4...7].
- # GPIOB4: SCU80[12] = 0 and Strap[14] = 0
- # GPIOB5: SCU80[13] = 0
- # GPIOB6: SCU80[14] = 0
- # GPIOB7: SCU80[15] = 0
- devmem_clear_bit $(scu_addr 70) 14
- devmem_clear_bit $(scu_addr 80) 12
- devmem_clear_bit $(scu_addr 80) 13
- devmem_clear_bit $(scu_addr 80) 14
- devmem_clear_bit $(scu_addr 80) 15
-
- gpio_set 12 $bit0
- gpio_set 13 $bit1
- gpio_set 14 $bit2
- gpio_set 15 $bit3
-}
-
-# Check number of parameters
-if [ $# -ne 1 ]
-then
- usage
- exit 1
-fi
-
-# Make sure input is actually numeric
-DEC_VALUE=$(printf "%d" $1 2>/dev/null)
-if [ $? -eq 1 ]
-then
- echo "Unable to parse input as numeric value."
- exit 1
-fi
-
-# Make sure input is within proper range
-if [ $DEC_VALUE -lt 0 ] || [ $DEC_VALUE -gt 255 ]
-then
- echo "Value $DEC_VALUE is outside of displayable range 0 - 0xff (255)."
- exit 1
-fi
-
-# Get upper/lower decimal values
-LOWER_DEC_VALUE=$(expr $DEC_VALUE % 16)
-UPPER_DEC_VALUE=$(expr $DEC_VALUE / 16)
-
-# Display the results
-display_lower $LOWER_DEC_VALUE
-display_upper $UPPER_DEC_VALUE
-
diff --git a/meta-facebook/meta-wedge/recipes-wedge/fbutils/files/power-on.sh b/meta-facebook/meta-wedge/recipes-wedge/fbutils/files/power-on.sh
deleted file mode 100644
index ace3c6a..0000000
--- a/meta-facebook/meta-wedge/recipes-wedge/fbutils/files/power-on.sh
+++ /dev/null
@@ -1,72 +0,0 @@
-#!/bin/sh
-#
-# Copyright 2014-present Facebook. All Rights Reserved.
-#
-# This program file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program in a file named COPYING; if not, write to the
-# Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor,
-# Boston, MA 02110-1301 USA
-
-### BEGIN INIT INFO
-# Provides: power-on
-# Required-Start:
-# Required-Stop:
-# Default-Start: S
-# Default-Stop:
-# Short-Description: Power on micro-server
-### END INIT INFO
-. /usr/local/bin/openbmc-utils.sh
-
-PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin
-
-echo -n "Checking microserver power status ... "
-if wedge_is_us_on 10 "."; then
- echo "on"
- on=1
-else
- echo "off"
- on=0
-fi
-
-if [ $on -eq 0 ]; then
- # Reset USB hub
- /usr/local/bin/reset_usb.sh
- # Set up ROV
- /usr/local/bin/setup_rov.sh
- # Configure the management switch on LEFT side of FC.
- # Must do so after setup_rov.sh, as setup_rov.sh might reset
- # T2, which also resets the switch.
- if [ "$(wedge_board_type)" = "FC-LEFT" ]; then
- echo -n "Configure management switch ... "
- if [ $(wedge_board_rev) -gt 1 ]; then
- echo "skip. Need new switch setup script!!!"
- else
- # configure MDIO as GPIO output
- gpio_set A6 1
- gpio_set A7 1
- # set the switch to be configured by CPU
- gpio_set E2 1
- # set the switch to be configured by CPU, then reset the switch,
- # which also cause T2 reset in the current board
- gpio_set E2 1
- gpio_set C0 0
- sleep 1
- gpio_set C0 1
- # configure the switch
- setup_switch.py
- echo "done"
- fi
- fi
- # Power on now
- wedge_power.sh on -f
-fi
diff --git a/meta-facebook/meta-wedge/recipes-wedge/fbutils/files/power_led.sh b/meta-facebook/meta-wedge/recipes-wedge/fbutils/files/power_led.sh
deleted file mode 100755
index 066646e..0000000
--- a/meta-facebook/meta-wedge/recipes-wedge/fbutils/files/power_led.sh
+++ /dev/null
@@ -1,49 +0,0 @@
-#!/bin/bash
-#
-# Copyright 2014-present Facebook. All Rights Reserved.
-#
-# This program file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program in a file named COPYING; if not, write to the
-# Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor,
-# Boston, MA 02110-1301 USA
-#
-
-usage() {
- echo "Usage: $1 <on | off>"
- exit -1
-}
-
-. /usr/local/bin/openbmc-utils.sh
-
-PATH=/sbin:/bin:/usr/sbin:/usr/bin
-
-set -e
-
-if [ $# != 1 ]; then
- usage $0
-fi
-
-if [ $1 = "on" ]; then
- val=1
-elif [ $1 = "off" ]; then
- val=0
-else
- usage $0
-fi
-
-# To use GPIOE5 (37), SCU80[21], SCU8C[14], and SCU70[22] must be 0
-devmem_clear_bit $(scu_addr 80) 21
-devmem_clear_bit $(scu_addr 8C) 14
-devmem_clear_bit $(scu_addr 70) 22
-
-gpio_set 37 $val
diff --git a/meta-facebook/meta-wedge/recipes-wedge/fbutils/files/rc.early b/meta-facebook/meta-wedge/recipes-wedge/fbutils/files/rc.early
deleted file mode 100644
index 0f47c72..0000000
--- a/meta-facebook/meta-wedge/recipes-wedge/fbutils/files/rc.early
+++ /dev/null
@@ -1,25 +0,0 @@
-#!/bin/sh
-#
-# Copyright 2014-present Facebook. All Rights Reserved.
-#
-# This program file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program in a file named COPYING; if not, write to the
-# Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor,
-# Boston, MA 02110-1301 USA
-#
-# This script will be executed at rcS S04 level, which is right after mount /mnt/data
-# and before almost anything else.
-
-if [ -x /mnt/data/etc/rc.early ]; then
- /mnt/data/etc/rc.early
-fi
diff --git a/meta-facebook/meta-wedge/recipes-wedge/fbutils/files/rc.local b/meta-facebook/meta-wedge/recipes-wedge/fbutils/files/rc.local
deleted file mode 100644
index 36fa0f1..0000000
--- a/meta-facebook/meta-wedge/recipes-wedge/fbutils/files/rc.local
+++ /dev/null
@@ -1,26 +0,0 @@
-#!/bin/sh
-#
-# Copyright 2014-present Facebook. All Rights Reserved.
-#
-# This program file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program in a file named COPYING; if not, write to the
-# Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor,
-# Boston, MA 02110-1301 USA
-#
-
-#
-# This script will be executed *after* all the other init scripts.
-
-if [ -x /mnt/data/etc/rc.local ]; then
- /mnt/data/etc/rc.local
-fi
diff --git a/meta-facebook/meta-wedge/recipes-wedge/fbutils/files/reset_usb.sh b/meta-facebook/meta-wedge/recipes-wedge/fbutils/files/reset_usb.sh
deleted file mode 100644
index c63ed10..0000000
--- a/meta-facebook/meta-wedge/recipes-wedge/fbutils/files/reset_usb.sh
+++ /dev/null
@@ -1,36 +0,0 @@
-#!/bin/sh
-#
-# Copyright 2014-present Facebook. All Rights Reserved.
-#
-# This program file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program in a file named COPYING; if not, write to the
-# Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor,
-# Boston, MA 02110-1301 USA
-#
-
-. /usr/local/bin/openbmc-utils.sh
-
-echo -n "Reset USB Switch ... "
-
-# To use GPIOD7 (31), SCU90[1], SCU8C[11], and SCU70[21] must be 0
-devmem_clear_bit $(scu_addr 8C) 11
-devmem_clear_bit $(scu_addr 70) 21
-devmem_clear_bit $(scu_addr 90) 1
-
-gpio_set 31 1
-sleep 1
-gpio_set 31 0
-sleep 1
-gpio_set 31 1
-
-echo "Done"
diff --git a/meta-facebook/meta-wedge/recipes-wedge/fbutils/files/setup-gpio.sh b/meta-facebook/meta-wedge/recipes-wedge/fbutils/files/setup-gpio.sh
deleted file mode 100755
index 717bcd8..0000000
--- a/meta-facebook/meta-wedge/recipes-wedge/fbutils/files/setup-gpio.sh
+++ /dev/null
@@ -1,457 +0,0 @@
-#!/bin/bash
-#
-# Copyright 2014-present Facebook. All Rights Reserved.
-#
-# This program file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program in a file named COPYING; if not, write to the
-# Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor,
-# Boston, MA 02110-1301 USA
-#
-
-### BEGIN INIT INFO
-# Provides: gpio-setup
-# Required-Start:
-# Required-Stop:
-# Default-Start: S
-# Default-Stop:
-# Short-Description: Set up GPIO pins as appropriate
-### END INIT INFO
-
-# This file contains definitions for the GPIO pins that were not otherwise
-# defined in other files. We should probably move some more of the
-# definitions to this file at some point.
-
-# The commented-out sections are generally already defined elsewhere,
-# and defining them twice generates errors.
-
-# The exception to this is the definition of the GPIO H0, H1, and H2
-# pins, which seem to adversely affect the rebooting of the system.
-# When defined, the system doesn't reboot cleanly. We're still
-# investigating this.
-
-. /usr/local/bin/openbmc-utils.sh
-
-# Set up to read the board revision pins, Y0, Y1, Y2
-devmem_set_bit $(scu_addr 70) 19
-devmem_clear_bit $(scu_addr a4) 8
-devmem_clear_bit $(scu_addr a4) 9
-devmem_clear_bit $(scu_addr a4) 10
-echo 192 > /sys/class/gpio/export
-echo 193 > /sys/class/gpio/export
-echo 194 > /sys/class/gpio/export
-
-# enabled Y0, Y1, Y2, we can use wedge_board_rev() now
-board_rev=$(wedge_board_rev)
-
-# Set up ISO_SVR_ID[0-3], GPION[2-5]
-# On wedge, these 4 GPIOs are not connected. And the corresponding
-# 4 pins from uS are strapped to low.
-# On fabic, these 4 pins are connected to uS SVR_ID pins,
-# which are used to set the uS FPGA i2c address.
-# Force all pins to low to have the same uS FPGA i2c address on wedge
-# and fabric
-# To use GPION[2-5], SCU90[4:5] must be 0, and SCU88[2-5] must be 0 also
-devmem_clear_bit $(scu_addr 90) 4
-devmem_clear_bit $(scu_addr 90) 5
-devmem_clear_bit $(scu_addr 88) 2
-devmem_clear_bit $(scu_addr 88) 3
-devmem_clear_bit $(scu_addr 88) 4
-devmem_clear_bit $(scu_addr 88) 5
-gpio_set 106 0
-gpio_set 107 0
-gpio_set 108 0
-gpio_set 109 0
-
-## CARD_EN, GPIO C3
-#devmem_clear_bit $(scu_addr 90) 0
-#devmem_clear_bit $(scu_addr 90) 24
-#echo 18 > /sys/class/gpio/export
-
-# T2_RESET_N, RESET_SEQ0, RESET_SEQ1, on GPIO C0, F2, and F3
-devmem_clear_bit $(scu_addr 90) 0
-devmem_clear_bit $(scu_addr 90) 23
-devmem_clear_bit $(scu_addr 80) 26
-devmem_clear_bit $(scu_addr a4) 13
-devmem_clear_bit $(scu_addr 80) 27
-devmem_clear_bit $(scu_addr a4) 14
-devmem_set_bit $(scu_addr 70) 19
-echo 16 > /sys/class/gpio/export
-echo 42 > /sys/class/gpio/export
-echo 43 > /sys/class/gpio/export
-# output
-
-# PANTHER_PRSNT_N, uServer presence, on GPIO E4
-devmem_clear_bit $(scu_addr 80) 20
-devmem_clear_bit $(scu_addr 8c) 14
-devmem_clear_bit $(scu_addr 70) 22
-echo 36 > /sys/class/gpio/export
-
-# MRSRVR_SYS_RST, reset the uServer, on GPIO C1
-devmem_clear_bit $(scu_addr 90) 0
-devmem_clear_bit $(scu_addr 90) 23
-echo 17 > /sys/class/gpio/export
-# output
-
-# BMC_PWR_BTN_IN_N, uServer power button in, on GPIO D0
-# BMC_PWR_BTN_OUT_N, uServer power button out, on GPIO D1
-devmem_clear_bit $(scu_addr 90) 1
-devmem_clear_bit $(scu_addr 8c) 8
-devmem_clear_bit $(scu_addr 70) 21
-echo 24 > /sys/class/gpio/export
-# we have to ensure that BMC_PWR_BTN_OUT_N is high so that
-# when we enable the isolation buffer, uS will not be powered down
-gpio_set 25 1
-
-## BMC_READY_IN, BMC signal that it's up, on GPIO P7
-# To use GPIOP7 (127), SCU88[23] must be 0
-devmem_clear_bit $(scu_addr 88) 23
-# Put GPIOP7 (127) to low so that we can control uS power now
-# This must be after 'gpio_set 25 1'
-gpio_set 127 0
-
-# PANTHER_I2C_ALERT_N, alert for uServer I2C, GPIO B0
-devmem_clear_bit $(scu_addr 80) 8
-echo 8 > /sys/class/gpio/export
-
-# MNSERV_NIC_SMBUS_ALRT, alert for uServer NIC, GPIO B1
-devmem_clear_bit $(scu_addr 80) 9
-echo 9 > /sys/class/gpio/export
-
-# LED_PWR_BLUE, blue power light, GPIO E5
-devmem_clear_bit $(scu_addr 80) 21
-devmem_clear_bit $(scu_addr 8c) 14
-devmem_clear_bit $(scu_addr 70) 22
-echo 37 > /sys/class/gpio/export
-# output
-
-# BMC_HEARTBEAT_N, heartbeat LED, GPIO Q7
-devmem_clear_bit $(scu_addr 90) 28
-echo 135 > /sys/class/gpio/export
-# output
-
-# XXX: setting those causes the system to lock up on reboot
-## T2 ROV1, ROV2, ROV3 -- voltage reading, GPIOs H0, H1, and H2
-#devmem_clear_bit $(scu_addr 90) 6
-#devmem_clear_bit $(scu_addr 90) 7
-#devmem_clear_bit $(scu_addr 70) 4
-## Do I need to set 70:1 and 70:0 to 1?
-echo 56 > /sys/class/gpio/export
-echo 57 > /sys/class/gpio/export
-echo 58 > /sys/class/gpio/export
-
-# HOTSWAP_PG, hotswap issues, GPIO L3
-devmem_clear_bit $(scu_addr 90) 5
-devmem_clear_bit $(scu_addr 90) 4
-devmem_clear_bit $(scu_addr 84) 19
-echo 99 > /sys/class/gpio/export
-
-# XXX: These interfere with i2c bus 11 (on Linux, it's 12 on the hardware)
-# which we need to talk to the power supplies on certain hardware.
-## Hardware presence pins C4 and C5
-#devmem_clear_bit $(scu_addr 90) 0
-#devmem_clear_bit $(scu_addr 90) 24
-#echo 20 > /sys/class/gpio/export
-#echo 21 > /sys/class/gpio/export
-
-# FAB_GE_SEL, uServer GE connection, GPIO A0
-devmem_clear_bit $(scu_addr 80) 0
-echo 0 > /sys/class/gpio/export
-# output
-
-# USB_OCS_N1, resettable fuse tripped, GPIO Q6
-devmem_clear_bit $(scu_addr 90) 28
-echo 136 > /sys/class/gpio/export
-
-# RX loss signal?
-
-# System SPI
-# Strap 12 must be 0 and Strape 13 must be 1
-devmem_clear_bit $(scu_addr 70) 12
-devmem_set_bit $(scu_addr 70) 13
-# GPIOQ4 is ISO_FLASH_WP, must be 1 to avoid write protection
-# GPIOQ5 is ISO_FLASH_HOLD, must be 1 to be out of reset
-# To use GPIOQ4 and GPIOQ5, SCU90[27] must be 0
-devmem_clear_bit $(scu_addr 90) 27
-gpio_set Q4 1
-gpio_set Q5 1
-# GPIOD6 is ISO_FL_PRG_SEL, set it to 0 so that BMC does not have control
-# on the EEPROM by default.
-# To use GPIOD6, SCU90[1] must be 0, SCU8C[21] must be 0, and Strap[21] must be 0
-devmem_clear_bit $(scu_addr 90) 1
-devmem_clear_bit $(scu_addr 8c) 8
-devmem_clear_bit $(scu_addr 70) 21
-gpio_set 30 0
-
-# DEBUG_RST_BTN_N, Debug Reset button on front panel, GPIO R2
-devmem_clear_bit $(scu_addr 88) 26
-echo 138 > /sys/class/gpio/export
-
-# DEBUG_PORT_UART_SEL_N, Debug Select button, GPIO B2
-devmem_clear_bit $(scu_addr 80) 10
-echo 10 > /sys/class/gpio/export
-
-# DEBUG_UART_SEL_0, select uServer UART to the debug header, GPIO E0
-devmem_clear_bit $(scu_addr 80) 16
-devmem_clear_bit $(scu_addr 8c) 12
-devmem_clear_bit $(scu_addr 70) 22
-echo 32 > /sys/class/gpio/export
-# output
-
-# RS485 transceiver TX/RX toggle (RTS) pin, GPIOF5
-devmem_clear_bit $(scu_addr 80) 29
-echo 45 > /sys/class/gpio/export
-gpio_set 45 0
-
-# Bloodhound GPIOs, P0-6, G4, J1-3, Y3
-# Make sure GPIOP0,1,2,3,6 are enabled.
-for i in {16..19} 22; do
- devmem_clear_bit $(scu_addr 88) $i
-done
-# Enable GPIOY3
-devmem_clear_bit $(scu_addr a4) 11
-# GPIOG4
-devmem_clear_bit $(scu_addr 2c) 1
-# GPIOJ1
-devmem_clear_bit $(scu_addr 84) 9
-# GPIOJ2
-devmem_clear_bit $(scu_addr 84) 10
-# GPIOJ11
-devmem_clear_bit $(scu_addr 84) 11
-
-# Export all the GPIOs
-for i in {120..126} 52 {73..75} 195; do
- echo $i > /sys/class/gpio/export
-done
-
-# Enable the isolation buffer
-wedge_iso_buf_enable
-
-# Get the board type by parsing the EEPROM.
-# This must be after enabling isolation buffer as the i2c bus
-# is isolated by the buffer
-board_type=$(wedge_board_type)
-
-case "$board_type" in
- FC-LEFT|FC-RIGHT)
- # On FC
- if [ $board_rev -lt 2 ]; then
- # EVT board
- # FAB_SLOT_ID is GPIOU0
- # PEER_FAB_PRSNT is GPIOU1
- devmem_set_bit $(scu_addr a0) 8
- devmem_set_bit $(scu_addr a0) 9
- gpio_export U0
- gpio_export U1
- # T2_POWER_UP is GPIOT6
- devmem_set_bit $(scu_addr a0) 6
- gpio_export T6 T2_POWER_UP
- # HS_FAULT_N is GPIOT7
- devmem_set_bit $(scu_addr a0) 7
- gpio_export T7
- if [ "$board_type" = "FC-LEFT" ]; then
- # GPIOE2 is CPU_EEPROM_SEL, on FC-LEFT
- devmem_clear_bit $(scu_addr 80) 18
- devmem_clear_bit $(scu_addr 8c) 13
- devmem_clear_bit $(scu_addr 70) 22
- gpio_export E2
- # GPIOA6 and GPIOA7 are MAC2 MDIO pins, we use them as
- # GPIO for bitbang driver
- devmem_clear_bit $(scu_addr 90) 2
- devmem_clear_bit $(scu_addr 80) 6
- devmem_clear_bit $(scu_addr 80) 7
- gpio_export A6
- gpio_export A7
- fi
- else
- # DVT board
- if [ "$board_type" = "FC-LEFT" ]; then # Left FC
- # BMC_SW_RST is GPIOL0, 16p switch
- # SCU84[16] must be 0
- devmem_clear_bit $(scu_addr 84) 16
- gpio_set L0 1
-
- # MDC|MDIO_CONT are GPIOR6 and GPIOR7, 16p switch
- # SCU88[30:31] must be 0
- devmem_clear_bit $(scu_addr 88) 30
- devmem_clear_bit $(scu_addr 88) 31
- gpio_set R6 1
- gpio_set R7 1
-
- # SWITCH_EEPROM1_WRT is GPIOE2, 16p switch EEPROM (U61)
- # SCU80[18], SCU8C[13], and SCU70[22] must be 0
- devmem_clear_bit $(scu_addr 80) 18
- devmem_clear_bit $(scu_addr 8C) 13
- devmem_clear_bit $(scu_addr 70) 22
- gpio_export E2
-
- # SPI bus to 16p switch EEPROM
- # GPIOI4 <--> BMC_EEPROM1_SPI_SS
- # GPIOI5 <--> BMC_EEPROM1_SPI_SCK
- # GPIOI6 <--> BMC_EEPROM1_SPI_MOSI
- # GPIOI7 <--> BMC_EEPROM1_SPI_MISO
- # The EEPROM SPI clk does not match with the BMC SPI master.
- # Have to configure these pins as GPIO to use with
- # SPI bitbang driver.
- # SCU70[13:12,5] must be 0
- devmem_clear_bit $(scu_addr 70) 5
- devmem_clear_bit $(scu_addr 70) 12
- devmem_clear_bit $(scu_addr 70) 13
- gpio_export I4
- gpio_export I5
- gpio_export I6
- gpio_export I7
-
- # BMC_PHY_RST is GPIOT0, Front Panel Port PHY on the 16p switch
- # SCUA0[0] must be 1
- devmem_set_bit $(scu_addr a0) 0
- gpio_set T0 1
-
- # BMC_5PORTSW_RST is GPIOT1, 5p switch
- # SCUA0[1] must be 1
- devmem_set_bit $(scu_addr a0) 1
- gpio_set T1 1
-
- # ISO_SWITCH1_MDC|MDIO are GPIOT4 and GPIOT5, 5p switch
- # SCUA0[4:5] must be 1
- devmem_set_bit $(scu_addr a0) 4
- devmem_set_bit $(scu_addr a0) 5
- gpio_set T4 1
- gpio_set T5 1
-
- # ISO_SWITCH_EEPROM2_WRT is GPIOV0, 5p switch EEPROM (U114)
- # SCUA0[16] must be 1
- devmem_set_bit $(scu_addr a0) 16
- gpio_export V0
-
- # SPI bus to 5p switch EEPROM (U114)
- # GPIOI0 <--> ISO_BMC_EEPROM2_SPI_SS
- # GPIOI1 <--> ISO_BMC_EEPROM2_SPI_SCK
- # GPIOI2 <--> ISO_BMC_EEPROM2_SPI_MOSI
- # GPIOI3 <--> ISO_BMC_EEPROM2_SPI_MISO
- # The EEPROM SPI clk does not match with the BMC SPI master.
- # Have to configure these pins as GPIO to use with
- # SPI bitbang driver.
- # SCU70[13] must be 0, has already been set when
- # preparing for GPIOI4-GPIOI7
- gpio_export I0
- gpio_export I1
- gpio_export I2
- gpio_export I3
-
- # BMC_PHYL_RST is GPIOF0, Left BMC PHY
- # SCU80[24] must be 0
- devmem_clear_bit $(scu_addr 80) 24
- gpio_set F0 1
- else # Right FC
- # BMC_PHYR_RST is GPIOL1, Right BMC PHY
- # SCU84[17] must be 0
- devmem_clear_bit $(scu_addr 84) 17
- gpio_set L1 1
- fi
- # T2_POWER_UP is GPIOU4
- # SCUA0[12] must be 1
- devmem_set_bit $(scu_addr a0) 12
- gpio_export U4 T2_POWER_UP
-
- # HS_FAULT_N is GPIOU5
- # SCUA0[13] must be 1
- devmem_set_bit $(scu_addr a0) 13
- gpio_export U5
-
- # FAB_SLOT_ID is GPIOU6
- # SCUA0[14] must be 1
- devmem_set_bit $(scu_addr a0) 14
- gpio_export U6
-
- # PEER_FAB_PRSNT is GPIOU7
- # SCUA0[15] must be 1
- devmem_set_bit $(scu_addr a0) 15
- gpio_export U7
- fi
- ;;
- *)
- # Set up to watch for FC presence, and switch between interfaces.
- # GPIOC0..C7, interested in C4, C5
- devmem_clear_bit $(scu_addr 90) 0
- devmem_clear_bit $(scu_addr 90) 25
- if [ $board_rev -lt 3 ]; then
- # Prior to DVTC
- # BP_SLOT_ID GPIO pins are U0, U1, U2, U3
- devmem_set_bit $(scu_addr a0) 8
- devmem_set_bit $(scu_addr a0) 9
- devmem_set_bit $(scu_addr a0) 10
- devmem_set_bit $(scu_addr a0) 11
- gpio_export U0
- gpio_export U1
- gpio_export U2
- gpio_export U3
- # T2_POWER_UP is GPIOT6
- devmem_set_bit $(scu_addr a0) 6
- gpio_export T6 T2_POWER_UP
- # HS_FAULT_N is GPIOT7
- devmem_set_bit $(scu_addr a0) 7
- gpio_export T7
- else
- # Starting from DVTC
- # BP_SLOT_ID GPIO pins are U6, U7, V0, V1
- devmem_set_bit $(scu_addr 70) 6
- devmem_set_bit $(scu_addr a0) 14
- devmem_set_bit $(scu_addr a0) 15
- devmem_set_bit $(scu_addr a0) 16
- devmem_set_bit $(scu_addr a0) 17
- gpio_export U6
- gpio_export U7
- gpio_export V0
- gpio_export V1
- # T2_POWER_UP is GPIOU4
- devmem_set_bit $(scu_addr a0) 12
- gpio_export U4 T2_POWER_UP
- # HS_FAULT_N is GPIOU5
- devmem_set_bit $(scu_addr a0) 13
- gpio_export U5
- fi
- ;;
-esac
-
-# Make it possible to turn off T2 if fand sees overheating via GPIOF1
-# Do not change the GPIO direction here as the default value of this GPIO
-# is low, which causes a Non-maskable interrupt to the uS.
-devmem_clear_bit $(scu_addr 80) 25
-devmem_clear_bit $(scu_addr a4) 12
-echo 41 > /sys/class/gpio/export
-
-# Allow us to set the fan LEDs boards.
-# This is GPIO G5, G6, G7, and J0
-
-devmem_clear_bit $(scu_addr 70) 23
-devmem_clear_bit $(scu_addr 84) 5
-devmem_clear_bit $(scu_addr 84) 6
-devmem_clear_bit $(scu_addr 84) 7
-devmem_clear_bit $(scu_addr 84) 8
-
-echo 53 > /sys/class/gpio/export
-echo 54 > /sys/class/gpio/export
-echo 55 > /sys/class/gpio/export
-echo 72 > /sys/class/gpio/export
-echo "out" > /sys/class/gpio/gpio53/direction
-echo "out" > /sys/class/gpio/gpio54/direction
-echo "out" > /sys/class/gpio/gpio55/direction
-echo "out" > /sys/class/gpio/gpio72/direction
-
-# Once we set "out", output values will be random unless we set them
-# to something
-
-echo "0" > /sys/class/gpio/gpio53/value
-echo "0" > /sys/class/gpio/gpio54/value
-echo "0" > /sys/class/gpio/gpio55/value
-echo "0" > /sys/class/gpio/gpio72/value
diff --git a/meta-facebook/meta-wedge/recipes-wedge/fbutils/files/setup_rov.sh b/meta-facebook/meta-wedge/recipes-wedge/fbutils/files/setup_rov.sh
deleted file mode 100755
index 4ff6f24..0000000
--- a/meta-facebook/meta-wedge/recipes-wedge/fbutils/files/setup_rov.sh
+++ /dev/null
@@ -1,106 +0,0 @@
-#!/bin/bash
-#
-# Copyright 2014-present Facebook. All Rights Reserved.
-#
-# This program file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program in a file named COPYING; if not, write to the
-# Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor,
-# Boston, MA 02110-1301 USA
-#
-
-# The T2 chip can prefer different input voltages, depending, presumably
-# of manufacturing variations. We need to determine whether it wants
-# 0.95V or 1.025V, reset the T2 to reduce total power usage, set the
-# outgoing voltage on the first buck converter, and bring T2 up out of
-# reset.
-
-. /usr/local/bin/openbmc-utils.sh
-
-# read the T2 ROV after the GPIOs are enabled
-t2_rov() {
- local val0 val1 val2
- # Note that the values are *not* read in order.
- val0=$(cat /sys/class/gpio/gpio58/value 2>/dev/null)
- val1=$(cat /sys/class/gpio/gpio56/value 2>/dev/null)
- val2=$(cat /sys/class/gpio/gpio57/value 2>/dev/null)
- echo $((val0 | (val1 << 1) | (val2 << 2)))
-}
-
-rov=$(t2_rov)
-
-# target_volts come from the data sheet and 18mV of loss and
-# some fudging based on actual measurements to get either 1.025V
-# or 0.95V at T2
-if [ $rov -eq 1 ]; then
- target_volts=0x5a
-elif [ $rov -eq 2 ]; then
- target_volts=0x65
-else
- echo "Unrecognized T2 ROV value $rov, setting failed."
- exit 1
-fi
-target_volts=$(( $target_volts * 1 )) # normalize to decimal
-
-# We shouldn't have to rmmod pmbus, because it hasn't been loaded yet,
-# but if the script is rerun after the system is up, it may be necessary.
-rmmod pmbus
-reload=$?
-
-# Get current voltage value.
-# The device here is NCP4200. It turns out the first i2c transaction to this
-# device always fails. The spec does not mention anything about NCP4200 i2c
-# engine start delay. However, each time, when the isolation buffer between the
-# BMC i2c controller and NCP4200 is disabled and re-enabled, the first i2c
-# transaction to NCP4200 always fails.
-# To workaround this issue, we are doing the first read twice.
-cur_volts=$(i2cget -y 1 0x60 0x8b w 2> /dev/null)
-cur_volts=$(i2cget -y 1 0x60 0x8b w)
-cur_volts=$(( $cur_volts * 1 )) # normalize to decimal
-
-# Only bounce the T2 if we actually need to modify the voltage
-if [ $cur_volts -ne $target_volts ]; then
- # Set values before turning out output; we're using "PCIE, then MCS"
- echo 1 > /sys/class/gpio/gpio42/value
- echo 1 > /sys/class/gpio/gpio43/value
- echo out > /sys/class/gpio/gpio42/direction
- echo out > /sys/class/gpio/gpio43/direction
- echo 0 > /sys/class/gpio/gpio16/value
- echo out > /sys/class/gpio/gpio16/direction
- # T2 is in reset; note that this may cause NMI messages on the uServer,
- # which shouldn't be up anyway when this is first run.
-
- # Set the requested value to the current value to avoid rapid shifts
- i2cset -y 1 0x60 0x21 $cur_volts w
- # Enable the requested voltage
- i2cset -y 1 0x60 0xd2 0x5a
- i2cset -y 1 0x60 0xd3 0x5a
- sleep 1
-
- # Set the target voltage
- i2cset -y 1 0x60 0x21 $target_volts w
-
- sleep 1
-
- # Let T2 come out of reset
- echo 1 > /sys/class/gpio/gpio16/value
- echo "T2 ROV value set based on $rov."
- sleep 2
- echo 0 > /sys/class/gpio/gpio42/value
- echo 0 > /sys/class/gpio/gpio43/value
-else
- echo "T2 ROV already correctly set."
-fi
-# Bring back pmbus if necessary
-if [ $reload -eq 0 ]; then
- modprobe pmbus
-fi
diff --git a/meta-facebook/meta-wedge/recipes-wedge/fbutils/files/setup_switch.py b/meta-facebook/meta-wedge/recipes-wedge/fbutils/files/setup_switch.py
deleted file mode 100644
index 995cec8..0000000
--- a/meta-facebook/meta-wedge/recipes-wedge/fbutils/files/setup_switch.py
+++ /dev/null
@@ -1,49 +0,0 @@
-#!/usr/bin/python
-#
-# Copyright 2004-present Facebook. All rights reserved.
-#
-# This program file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program in a file named COPYING; if not, write to the
-# Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor,
-# Boston, MA 02110-1301 USA
-#
-# This script combines multiple switch configuration into one python script.
-# All such configuration can be done directly through bcm5396_util.py.
-# But, it turns out it took several seconds to just start the python script.
-# Involking the script 16 times (2 to create vlan, 13 to set port vlan default,
-# and 1 to enable vlan function) contributes 1 minute delay.
-
-from bcm5396 import Bcm5396
-
-MDC_GPIO = 6
-MDIO_GPIO = 7
-
-INTERNAL_VLAN = 4088
-DEFAULT_VLAN=4090
-
-INTERNAL_PORTS = [3, 10, 1, 11, 0, 8, 2, 9, 4, 12, 14, 13]
-FRONT_PORT=5
-
-if __name__ == '__main__':
- bcm = Bcm5396(Bcm5396.MDIO_ACCESS, mdc=MDC_GPIO, mdio=MDIO_GPIO)
- # create default VLAN including internal ports and front panel
- # port (un-tagged)
- bcm.add_vlan(DEFAULT_VLAN, INTERNAL_PORTS + [FRONT_PORT],
- INTERNAL_PORTS + [FRONT_PORT], 0)
- # set ingress vlan for internal ports and front panel port to default vlan
- for port in INTERNAL_PORTS + [FRONT_PORT]:
- bcm.vlan_set_port_default(port, DEFAULT_VLAN, 0)
- # create internal vlan including internal ports only (tagged)
- bcm.add_vlan(INTERNAL_VLAN, [], INTERNAL_PORTS, 0)
- # enable vlan
- bcm.vlan_ctrl(True)
diff --git a/meta-facebook/meta-wedge/recipes-wedge/fbutils/files/sol.sh b/meta-facebook/meta-wedge/recipes-wedge/fbutils/files/sol.sh
deleted file mode 100755
index 2998c81..0000000
--- a/meta-facebook/meta-wedge/recipes-wedge/fbutils/files/sol.sh
+++ /dev/null
@@ -1,44 +0,0 @@
-#!/bin/sh
-#
-# Copyright 2014-present Facebook. All Rights Reserved.
-#
-# This program file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program in a file named COPYING; if not, write to the
-# Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor,
-# Boston, MA 02110-1301 USA
-#
-
-CONSOLE_SH=/usr/local/bin/us_console.sh
-FILE=/etc/us_pseudo_tty
-TTY=/dev/ttyS1
-
-if [ -a $FILE ]
- then
- read -r TTY<$FILE
-fi
-
-$CONSOLE_SH connect
-
-echo "You are in SOL session."
-echo "Use ctrl-x to quit."
-echo "-----------------------"
-echo
-
-trap '"$CONSOLE_SH" disconnect' INT TERM QUIT EXIT
-
-/usr/bin/microcom -s 57600 $TTY
-
-echo
-echo
-echo "-----------------------"
-echo "Exit from SOL session."
diff --git a/meta-facebook/meta-wedge/recipes-wedge/fbutils/files/src/include/i2c-dev.h b/meta-facebook/meta-wedge/recipes-wedge/fbutils/files/src/include/i2c-dev.h
deleted file mode 100644
index eefb6e4..0000000
--- a/meta-facebook/meta-wedge/recipes-wedge/fbutils/files/src/include/i2c-dev.h
+++ /dev/null
@@ -1,362 +0,0 @@
-/*
- i2c-dev.h - i2c-bus driver, char device interface
-
- Copyright (C) 1995-97 Simon G. Vogl
- Copyright (C) 1998-99 Frodo Looijaard <frodol@dds.nl>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- MA 02110-1301 USA.
-*/
-
-#ifndef _LINUX_I2C_DEV_H
-#define _LINUX_I2C_DEV_H
-
-#include <linux/types.h>
-#include <sys/ioctl.h>
-#include <stddef.h>
-#include <string.h>
-
-
-/* -- i2c.h -- */
-
-#define _I2C_MIN(a, b) (((a) <= (b)) ? (a) : (b))
-
-/*
- * I2C Message - used for pure i2c transaction, also from /dev interface
- */
-struct i2c_msg {
- __u16 addr; /* slave address */
- unsigned short flags;
-#define I2C_CLIENT_PEC 0x04 /* Use Packet Error Checking */
-#define I2C_M_TEN 0x0010 /* this is a ten bit chip address */
-#define I2C_M_RD 0x0001 /* read data, from slave to master */
-#define I2C_M_NOSTART 0x4000 /* if I2C_FUNC_PROTOCOL_MANGLING */
-#define I2C_M_REV_DIR_ADDR 0x2000 /* if I2C_FUNC_PROTOCOL_MANGLING */
-#define I2C_M_IGNORE_NAK 0x1000 /* if I2C_FUNC_PROTOCOL_MANGLING */
-#define I2C_M_NO_RD_ACK 0x0800 /* if I2C_FUNC_PROTOCOL_MANGLING */
-#define I2C_M_RECV_LEN 0x0400 /* length will be first received byte */
- short len; /* msg length */
- char *buf; /* pointer to msg data */
-};
-
-/* To determine what functionality is present */
-
-#define I2C_FUNC_I2C 0x00000001
-#define I2C_FUNC_10BIT_ADDR 0x00000002
-#define I2C_FUNC_PROTOCOL_MANGLING 0x00000004 /* I2C_M_{REV_DIR_ADDR,NOSTART,..} */
-#define I2C_FUNC_SMBUS_PEC 0x00000008
-#define I2C_FUNC_SMBUS_BLOCK_PROC_CALL 0x00008000 /* SMBus 2.0 */
-#define I2C_FUNC_SMBUS_QUICK 0x00010000
-#define I2C_FUNC_SMBUS_READ_BYTE 0x00020000
-#define I2C_FUNC_SMBUS_WRITE_BYTE 0x00040000
-#define I2C_FUNC_SMBUS_READ_BYTE_DATA 0x00080000
-#define I2C_FUNC_SMBUS_WRITE_BYTE_DATA 0x00100000
-#define I2C_FUNC_SMBUS_READ_WORD_DATA 0x00200000
-#define I2C_FUNC_SMBUS_WRITE_WORD_DATA 0x00400000
-#define I2C_FUNC_SMBUS_PROC_CALL 0x00800000
-#define I2C_FUNC_SMBUS_READ_BLOCK_DATA 0x01000000
-#define I2C_FUNC_SMBUS_WRITE_BLOCK_DATA 0x02000000
-#define I2C_FUNC_SMBUS_READ_I2C_BLOCK 0x04000000 /* I2C-like block xfer */
-#define I2C_FUNC_SMBUS_WRITE_I2C_BLOCK 0x08000000 /* w/ 1-byte reg. addr. */
-
-#define I2C_FUNC_SMBUS_BYTE (I2C_FUNC_SMBUS_READ_BYTE | \
- I2C_FUNC_SMBUS_WRITE_BYTE)
-#define I2C_FUNC_SMBUS_BYTE_DATA (I2C_FUNC_SMBUS_READ_BYTE_DATA | \
- I2C_FUNC_SMBUS_WRITE_BYTE_DATA)
-#define I2C_FUNC_SMBUS_WORD_DATA (I2C_FUNC_SMBUS_READ_WORD_DATA | \
- I2C_FUNC_SMBUS_WRITE_WORD_DATA)
-#define I2C_FUNC_SMBUS_BLOCK_DATA (I2C_FUNC_SMBUS_READ_BLOCK_DATA | \
- I2C_FUNC_SMBUS_WRITE_BLOCK_DATA)
-#define I2C_FUNC_SMBUS_I2C_BLOCK (I2C_FUNC_SMBUS_READ_I2C_BLOCK | \
- I2C_FUNC_SMBUS_WRITE_I2C_BLOCK)
-
-/* Old name, for compatibility */
-#define I2C_FUNC_SMBUS_HWPEC_CALC I2C_FUNC_SMBUS_PEC
-
-/*
- * Data for SMBus Messages
- */
-#define I2C_SMBUS_BLOCK_MAX 32 /* As specified in SMBus standard */
-#define I2C_SMBUS_I2C_BLOCK_MAX 32 /* Not specified but we use same structure */
-union i2c_smbus_data {
- __u8 byte;
- __u16 word;
- __u8 block[I2C_SMBUS_BLOCK_MAX + 2]; /* block[0] is used for length */
- /* and one more for PEC */
-};
-
-#define I2C_SMBUS_BLOCK_LARGE_MAX 240
-union i2c_smbus_large_data {
- union i2c_smbus_data data;
- __u8 block[I2C_SMBUS_BLOCK_LARGE_MAX + 2]; /* block[0] is used for length */
- /* and one more for PEC */
-};
-
-/* smbus_access read or write markers */
-#define I2C_SMBUS_READ 1
-#define I2C_SMBUS_WRITE 0
-
-/* SMBus transaction types (size parameter in the above functions)
- Note: these no longer correspond to the (arbitrary) PIIX4 internal codes! */
-#define I2C_SMBUS_QUICK 0
-#define I2C_SMBUS_BYTE 1
-#define I2C_SMBUS_BYTE_DATA 2
-#define I2C_SMBUS_WORD_DATA 3
-#define I2C_SMBUS_PROC_CALL 4
-#define I2C_SMBUS_BLOCK_DATA 5
-#define I2C_SMBUS_I2C_BLOCK_BROKEN 6
-#define I2C_SMBUS_BLOCK_PROC_CALL 7 /* SMBus 2.0 */
-#define I2C_SMBUS_I2C_BLOCK_DATA 8
-#define I2C_SMBUS_BLOCK_LARGE_DATA 9
-
-
-/* /dev/i2c-X ioctl commands. The ioctl's parameter is always an
- * unsigned long, except for:
- * - I2C_FUNCS, takes pointer to an unsigned long
- * - I2C_RDWR, takes pointer to struct i2c_rdwr_ioctl_data
- * - I2C_SMBUS, takes pointer to struct i2c_smbus_ioctl_data
- */
-#define I2C_RETRIES 0x0701 /* number of times a device address should
- be polled when not acknowledging */
-#define I2C_TIMEOUT 0x0702 /* set timeout in units of 10 ms */
-
-/* NOTE: Slave address is 7 or 10 bits, but 10-bit addresses
- * are NOT supported! (due to code brokenness)
- */
-#define I2C_SLAVE 0x0703 /* Use this slave address */
-#define I2C_SLAVE_FORCE 0x0706 /* Use this slave address, even if it
- is already in use by a driver! */
-#define I2C_TENBIT 0x0704 /* 0 for 7 bit addrs, != 0 for 10 bit */
-
-#define I2C_FUNCS 0x0705 /* Get the adapter functionality mask */
-
-#define I2C_RDWR 0x0707 /* Combined R/W transfer (one STOP only) */
-
-#define I2C_PEC 0x0708 /* != 0 to use PEC with SMBus */
-#define I2C_SMBUS 0x0720 /* SMBus transfer */
-
-
-/* This is the structure as used in the I2C_SMBUS ioctl call */
-struct i2c_smbus_ioctl_data {
- __u8 read_write;
- __u8 command;
- __u32 size;
- union i2c_smbus_data *data;
-};
-
-/* This is the structure as used in the I2C_RDWR ioctl call */
-struct i2c_rdwr_ioctl_data {
- struct i2c_msg *msgs; /* pointers to i2c_msgs */
- __u32 nmsgs; /* number of i2c_msgs */
-};
-
-#define I2C_RDRW_IOCTL_MAX_MSGS 42
-
-
-static inline __s32 i2c_smbus_access(int file, char read_write, __u8 command,
- int size, union i2c_smbus_data *data)
-{
- struct i2c_smbus_ioctl_data args;
-
- args.read_write = read_write;
- args.command = command;
- args.size = size;
- args.data = data;
- return ioctl(file,I2C_SMBUS,&args);
-}
-
-
-static inline __s32 i2c_smbus_write_quick(int file, __u8 value)
-{
- return i2c_smbus_access(file,value,0,I2C_SMBUS_QUICK,NULL);
-}
-
-static inline __s32 i2c_smbus_read_byte(int file)
-{
- union i2c_smbus_data data;
- if (i2c_smbus_access(file,I2C_SMBUS_READ,0,I2C_SMBUS_BYTE,&data))
- return -1;
- else
- return 0x0FF & data.byte;
-}
-
-static inline __s32 i2c_smbus_write_byte(int file, __u8 value)
-{
- return i2c_smbus_access(file,I2C_SMBUS_WRITE,value,
- I2C_SMBUS_BYTE,NULL);
-}
-
-static inline __s32 i2c_smbus_read_byte_data(int file, __u8 command)
-{
- union i2c_smbus_data data;
- if (i2c_smbus_access(file,I2C_SMBUS_READ,command,
- I2C_SMBUS_BYTE_DATA,&data))
- return -1;
- else
- return 0x0FF & data.byte;
-}
-
-static inline __s32 i2c_smbus_write_byte_data(int file, __u8 command,
- __u8 value)
-{
- union i2c_smbus_data data;
- data.byte = value;
- return i2c_smbus_access(file,I2C_SMBUS_WRITE,command,
- I2C_SMBUS_BYTE_DATA, &data);
-}
-
-static inline __s32 i2c_smbus_read_word_data(int file, __u8 command)
-{
- union i2c_smbus_data data;
- if (i2c_smbus_access(file,I2C_SMBUS_READ,command,
- I2C_SMBUS_WORD_DATA,&data))
- return -1;
- else
- return 0x0FFFF & data.word;
-}
-
-static inline __s32 i2c_smbus_write_word_data(int file, __u8 command,
- __u16 value)
-{
- union i2c_smbus_data data;
- data.word = value;
- return i2c_smbus_access(file,I2C_SMBUS_WRITE,command,
- I2C_SMBUS_WORD_DATA, &data);
-}
-
-static inline __s32 i2c_smbus_process_call(int file, __u8 command, __u16 value)
-{
- union i2c_smbus_data data;
- data.word = value;
- if (i2c_smbus_access(file,I2C_SMBUS_WRITE,command,
- I2C_SMBUS_PROC_CALL,&data))
- return -1;
- else
- return 0x0FFFF & data.word;
-}
-
-
-/* Returns the number of read bytes */
-static inline __s32 i2c_smbus_read_block_data(int file, __u8 command,
- __u8 *values)
-{
- union i2c_smbus_data data;
- if (i2c_smbus_access(file,I2C_SMBUS_READ,command,
- I2C_SMBUS_BLOCK_DATA,&data))
- return -1;
- else {
- memcpy(values, &data.block[1], _I2C_MIN(data.block[0], I2C_SMBUS_BLOCK_MAX));
- return data.block[0];
- }
-}
-
-static inline __s32 i2c_smbus_write_block_data(int file, __u8 command,
- __u8 length, const __u8 *values)
-{
- union i2c_smbus_data data;
- if (length > 32)
- length = 32;
- memcpy(&data.block[1], values, length);
- data.block[0] = length;
- return i2c_smbus_access(file,I2C_SMBUS_WRITE,command,
- I2C_SMBUS_BLOCK_DATA, &data);
-}
-
-static inline __s32 i2c_smbus_read_block_large_data(int file, __u8 command,
- __u8 *values)
-{
- union i2c_smbus_large_data data;
- if (i2c_smbus_access(file, I2C_SMBUS_READ, command,
- I2C_SMBUS_BLOCK_LARGE_DATA,
- (union i2c_smbus_data *)&data)) {
- return -1;
- } else {
- /* the first byte is the length which is not copied */
- memcpy(values, &data.block[1], _I2C_MIN(data.block[0], I2C_SMBUS_BLOCK_LARGE_MAX));
- return data.block[0];
- }
-}
-
-static inline __s32 i2c_smbus_write_block_large_data(int file, __u8 command,
- __u8 length,
- const __u8 *values)
-{
- union i2c_smbus_large_data data;
- if (length > I2C_SMBUS_BLOCK_LARGE_MAX) {
- length = I2C_SMBUS_BLOCK_LARGE_MAX;
- }
- data.block[0] = length;
- memcpy(&data.block[1], values, length);
- return i2c_smbus_access(file, I2C_SMBUS_WRITE, command,
- I2C_SMBUS_BLOCK_LARGE_DATA,
- (union i2c_smbus_data *)&data);
-}
-
-/* Returns the number of read bytes */
-/* Until kernel 2.6.22, the length is hardcoded to 32 bytes. If you
- ask for less than 32 bytes, your code will only work with kernels
- 2.6.23 and later. */
-static inline __s32 i2c_smbus_read_i2c_block_data(int file, __u8 command,
- __u8 length, __u8 *values)
-{
- union i2c_smbus_data data;
-
- if (length > 32)
- length = 32;
- data.block[0] = length;
- if (i2c_smbus_access(file,I2C_SMBUS_READ,command,
- length == 32 ? I2C_SMBUS_I2C_BLOCK_BROKEN :
- I2C_SMBUS_I2C_BLOCK_DATA,&data))
- return -1;
- else {
- memcpy(values, &data.block[1], _I2C_MIN(data.block[0], I2C_SMBUS_BLOCK_MAX));
- return data.block[0];
- }
-}
-
-static inline __s32 i2c_smbus_write_i2c_block_data(int file, __u8 command,
- __u8 length,
- const __u8 *values)
-{
- union i2c_smbus_data data;
- if (length > 32)
- length = 32;
- memcpy(&data.block[1], values, length);
- data.block[0] = length;
- return i2c_smbus_access(file,I2C_SMBUS_WRITE,command,
- I2C_SMBUS_I2C_BLOCK_BROKEN, &data);
-}
-
-/* Returns the number of read bytes */
-static inline __s32 i2c_smbus_block_process_call(int file, __u8 command,
- __u8 length, __u8 *values)
-{
- union i2c_smbus_data data;
- if (length > 32)
- length = 32;
- memcpy(&data.block[1], values, length);
- data.block[0] = length;
- if (i2c_smbus_access(file,I2C_SMBUS_WRITE,command,
- I2C_SMBUS_BLOCK_PROC_CALL,&data))
- return -1;
- else {
- memcpy(values, &data.block[1], _I2C_MIN(data.block[0], I2C_SMBUS_BLOCK_MAX));
- return data.block[0];
- }
-}
-
-#undef _I2C_MIN
-
-#endif /* _LINUX_I2C_DEV_H */
diff --git a/meta-facebook/meta-wedge/recipes-wedge/fbutils/files/start_us_monitor.sh b/meta-facebook/meta-wedge/recipes-wedge/fbutils/files/start_us_monitor.sh
deleted file mode 100644
index 19f3198..0000000
--- a/meta-facebook/meta-wedge/recipes-wedge/fbutils/files/start_us_monitor.sh
+++ /dev/null
@@ -1,73 +0,0 @@
-#! /bin/sh
-#
-# Copyright 2014-present Facebook. All Rights Reserved.
-#
-# This program file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program in a file named COPYING; if not, write to the
-# Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor,
-# Boston, MA 02110-1301 USA
-#
-
-### BEGIN INIT INFO
-# Provides: us-monitor
-# Required-Start:
-# Required-Stop:
-# Default-Start: S
-# Default-Stop: 0 6
-# Short-Description: Start the microserver reset monitoring script
-#
-### END INIT INFO
-
-PATH=/sbin:/bin:/usr/sbin:/usr/bin
-NAME="us_monitor"
-DESC="monitoring microserver reset"
-DAEMON="us_monitor.sh"
-
-# source function library
-. /etc/init.d/functions
-
-. /usr/local/bin/openbmc-utils.sh
-
-STOPPER=
-ACTION="$1"
-
-case "$ACTION" in
- start)
- echo -n "Starting $DESC: "
- /usr/local/bin/${DAEMON} > /dev/null 2>&1 &
- echo "$NAME."
- ;;
- stop)
- echo -n "Stopping $DESC: "
- killall ${DAEMON}
- echo "$NAME."
- ;;
- restart|force-reload)
- echo -n "Restarting $DESC: "
- killall ${DAEMON}
- /usr/local/bin/${DAEMON} > /dev/null 2>&1 &
- echo "$NAME."
- ;;
- status)
- status ${DAEMON}
- exit $?
- ;;
- *)
- N=${0##*/}
- N=${N#[SK]??}
- echo "Usage: $N {start|stop|status|restart|force-reload}" >&2
- exit 1
- ;;
-esac
-
-exit 0
diff --git a/meta-facebook/meta-wedge/recipes-wedge/fbutils/files/us_console.sh b/meta-facebook/meta-wedge/recipes-wedge/fbutils/files/us_console.sh
deleted file mode 100755
index 75bbcea..0000000
--- a/meta-facebook/meta-wedge/recipes-wedge/fbutils/files/us_console.sh
+++ /dev/null
@@ -1,47 +0,0 @@
-#!/bin/sh
-#
-# Copyright 2014-present Facebook. All Rights Reserved.
-#
-# This program file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program in a file named COPYING; if not, write to the
-# Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor,
-# Boston, MA 02110-1301 USA
-#
-
-usage() {
- echo "$0 <connect | disconnect>"
-}
-
-. /usr/local/bin/openbmc-utils.sh
-
-if [ $# -ne 1 ]; then
- usage
- exit 1
-fi
-
-if [ "$1" == "connect" ]; then
- VALUE=1
-elif [ "$1" == "disconnect" ]; then
- VALUE=0
-else
- usage
- exit 1
-fi
-
-# GPIOE0 (32) controls if uS console connects to UART1 or not.
-# To enable GPIOE0, SCU80[16], SCU8C[12], and SCU70[22] must be 0
-devmem_clear_bit $(scu_addr 80) 16
-devmem_clear_bit $(scu_addr 8C) 12
-devmem_clear_bit $(scu_addr 70) 22
-
-gpio_set 32 $VALUE
diff --git a/meta-facebook/meta-wedge/recipes-wedge/fbutils/files/us_monitor.sh b/meta-facebook/meta-wedge/recipes-wedge/fbutils/files/us_monitor.sh
deleted file mode 100644
index b7a9cb6..0000000
--- a/meta-facebook/meta-wedge/recipes-wedge/fbutils/files/us_monitor.sh
+++ /dev/null
@@ -1,56 +0,0 @@
-#!/bin/bash
-#
-# Copyright 2015-present Facebook. All Rights Reserved.
-#
-# This program file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program in a file named COPYING; if not, write to the
-# Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor,
-# Boston, MA 02110-1301 USA
-
-. /usr/local/bin/openbmc-utils.sh
-
-PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin
-
-# Because the voltage leak from uS COM pins could cause uS to struck when
-# transitting from S5 to S0, we will need to explicitely pull down uS COM
-# pins before powering off/reset and restoring COM pins after
-
-pull_down_us_com() {
- # set GPIOL6 and GPIOL7 low
- devmem_clear_bit $(scu_addr 84) 22
- devmem_clear_bit $(scu_addr 84) 23
- gpio_set 94 0
- gpio_set 95 0
- # now, connect uart from BMC to the uS
- gpio_set 32 1
-}
-
-restore_us_com() {
- devmem_set_bit $(scu_addr 84) 22
- devmem_set_bit $(scu_addr 84) 23
- # if sol.sh is running, keep uart from uS connected with BMC
- if pidof -x sol.sh > /dev/null 2>&1; then
- gpio_set 32 1
- else
- gpio_set 32 0
- fi
-}
-
-while true; do
- if ! wedge_is_us_on 1 '' 0 > /dev/null 2>&1; then
- pull_down_us_com
- else
- restore_us_com
- fi
- usleep 400000 # 400ms
-done
diff --git a/meta-facebook/meta-wedge/recipes-wedge/fbutils/files/wedge_power.sh b/meta-facebook/meta-wedge/recipes-wedge/fbutils/files/wedge_power.sh
deleted file mode 100644
index ce734ef..0000000
--- a/meta-facebook/meta-wedge/recipes-wedge/fbutils/files/wedge_power.sh
+++ /dev/null
@@ -1,190 +0,0 @@
-#!/bin/bash
-#
-# Copyright 2014-present Facebook. All Rights Reserved.
-#
-# This program file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program in a file named COPYING; if not, write to the
-# Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor,
-# Boston, MA 02110-1301 USA
-#
-
-. /usr/local/bin/openbmc-utils.sh
-
-PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin
-
-prog="$0"
-
-usage() {
- echo "Usage: $prog <command> [command options]"
- echo
- echo "Commands:"
- echo " status: Get the current microserver power status"
- echo
- echo " on: Power on microserver if not powered on already"
- echo " options:"
- echo " -f: Re-do power on sequence no matter if microserver has "
- echo " been powered on or not."
- echo
- echo " off: Power off microserver ungracefully"
- echo
- echo " reset: Power reset microserver ungracefully"
- echo " options:"
- echo " -s: Power reset whole wedge system ungracefully"
- echo
-}
-
-do_status() {
- echo -n "Microserver power is "
- if wedge_is_us_on; then
- echo "on"
- else
- echo "off"
- fi
- return 0
-}
-
-do_on() {
- local force opt pulse_us n retries
- force=0
- while getopts "f" opt; do
- case $opt in
- f)
- force=1
- ;;
- *)
- usage
- exit -1
- ;;
-
- esac
- done
- echo -n "Power on microserver ..."
- if [ $force -eq 0 ]; then
- # need to check if uS is on or not
- if wedge_is_us_on 10 "."; then
- echo " Already on. Skip!"
- return 1
- fi
- fi
- # first make sure, GPIOD1 (25) is high
- gpio_set 25 1
- sleep 1
- # then, put GPIOP7 (127) to low
- gpio_set 127 0
- pulse_us=500000 # 500ms
- retries=3
- n=1
- while true; do
- # first make sure, GPIOD1 (25) is high
- gpio_set 25 1
- usleep $pulse_us
- # generate the power on pulse
- gpio_set 25 0
- usleep $pulse_us
- gpio_set 25 1
- sleep 3
- if wedge_is_us_on 1 '' 1; then
- break
- fi
- n=$((n+1))
- if [ $n -gt $retries ]; then
- echo " Failed"
- return 1
- fi
- echo -n "..."
- done
- # Turn on the power LED (GPIOE5)
- /usr/local/bin/power_led.sh on
- echo " Done"
- return 0
-}
-
-do_off() {
- echo -n "Power off microserver ..."
- # first make sure, GPIOD1 (25) is high
- gpio_set 25 1
- # then, put GPIOP7 (127) to low
- gpio_set 127 0
- gpio_set 25 0
- sleep 5
- gpio_set 25 1
- # Turn off the power LED (GPIOE5)
- /usr/local/bin/power_led.sh off
- echo " Done"
- return 0
-}
-
-do_reset() {
- local system opt
- system=0
- while getopts "s" opt; do
- case $opt in
- s)
- system=1
- ;;
- *)
- usage
- exit -1
- ;;
- esac
- done
- if [ $system -eq 1 ]; then
- echo -n "Power reset whole system ..."
- rmmod adm1275
- i2cset -y 12 0x10 0xd9 c
- else
- if ! wedge_is_us_on; then
- echo "Power resetting microserver that is powered off has no effect."
- echo "Use '$prog on' to power the microserver on"
- return -1
- fi
- echo -n "Power reset microserver ..."
- # then, put GPIOP7 (127) to low
- gpio_set 127 0
- gpio_set 17 0
- sleep 1
- gpio_set 17 1
- sleep 1
- fi
- echo " Done"
- return 0
-}
-
-if [ $# -lt 1 ]; then
- usage
- exit -1
-fi
-
-command="$1"
-shift
-
-case "$command" in
- status)
- do_status $@
- ;;
- on)
- do_on $@
- ;;
- off)
- do_off $@
- ;;
- reset)
- do_reset $@
- ;;
- *)
- usage
- exit -1
- ;;
-esac
-
-exit $?
diff --git a/meta-facebook/meta-wedge/recipes-wedge/fbutils/files/wedge_us_mac.sh b/meta-facebook/meta-wedge/recipes-wedge/fbutils/files/wedge_us_mac.sh
deleted file mode 100644
index 34b8e59..0000000
--- a/meta-facebook/meta-wedge/recipes-wedge/fbutils/files/wedge_us_mac.sh
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/bin/bash
-#
-# Copyright 2014-present Facebook. All Rights Reserved.
-#
-# This program file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program in a file named COPYING; if not, write to the
-# Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor,
-# Boston, MA 02110-1301 USA
-#
-
-PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin
-
-mac=$(i2cdump -y 0x0 0x49 s 0xd4 | grep '^00: d4'| awk '{ print $3":"$4":"$5":"$6":"$7":"$8 }') 2>/dev/null
-
-if [ -n "$mac" ]; then
- echo $mac
-else
- echo "Cannot find out the microserver MAC" 1>&2
-fi
diff --git a/meta-facebook/meta-wedge/recipes-wedge/fbutils/openbmc-utils_%.bbappend b/meta-facebook/meta-wedge/recipes-wedge/fbutils/openbmc-utils_%.bbappend
deleted file mode 100644
index d6641c9..0000000
--- a/meta-facebook/meta-wedge/recipes-wedge/fbutils/openbmc-utils_%.bbappend
+++ /dev/null
@@ -1,95 +0,0 @@
-# Copyright 2014-present Facebook. All Rights Reserved.
-#
-# This program file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program in a file named COPYING; if not, write to the
-# Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor,
-# Boston, MA 02110-1301 USA
-
-FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
-
-SRC_URI += "file://board-utils.sh \
- file://us_console.sh \
- file://sol.sh \
- file://power_led.sh \
- file://post_led.sh \
- file://reset_usb.sh \
- file://setup-gpio.sh \
- file://setup_rov.sh \
- file://mdio.py \
- file://bcm5396.py \
- file://bcm5396_util.py \
- file://at93cx6.py \
- file://at93cx6_util.py \
- file://mount_data0.sh \
- file://eth0_mac_fixup.sh \
- file://wedge_power.sh \
- file://power-on.sh \
- file://wedge_us_mac.sh \
- file://setup_switch.py \
- file://create_vlan_intf \
- file://rc.early \
- file://rc.local \
- file://src \
- file://start_us_monitor.sh \
- file://us_monitor.sh \
- "
-
-OPENBMC_UTILS_FILES += " \
- board-utils.sh us_console.sh sol.sh power_led.sh post_led.sh \
- reset_usb.sh mdio.py setup_rov.sh wedge_power.sh wedge_us_mac.sh \
- bcm5396.py bcm5396_util.py setup_switch.py us_monitor.sh \
- at93cx6.py at93cx6_util.py \
- "
-
-DEPENDS_append = "update-rc.d-native"
-
-do_install_board() {
- # for backward compatible, create /usr/local/fbpackages/utils/ast-functions
- olddir="/usr/local/fbpackages/utils"
- install -d ${D}${olddir}
- ln -s "/usr/local/bin/openbmc-utils.sh" ${D}${olddir}/ast-functions
-
- # common lib and include files
- install -d ${D}${includedir}/facebook
- install -m 0644 src/include/i2c-dev.h ${D}${includedir}/facebook/i2c-dev.h
-
- # init
- install -d ${D}${sysconfdir}/init.d
- install -d ${D}${sysconfdir}/rcS.d
- # the script to mount /mnt/data
- install -m 0755 ${WORKDIR}/mount_data0.sh ${D}${sysconfdir}/init.d/mount_data0.sh
- update-rc.d -r ${D} mount_data0.sh start 03 S .
- install -m 0755 ${WORKDIR}/rc.early ${D}${sysconfdir}/init.d/rc.early
- update-rc.d -r ${D} rc.early start 04 S .
- install -m 755 setup-gpio.sh ${D}${sysconfdir}/init.d/setup-gpio.sh
- update-rc.d -r ${D} setup-gpio.sh start 59 S .
- # create VLAN intf automatically
- install -d ${D}/${sysconfdir}/network/if-up.d
- install -m 755 create_vlan_intf ${D}${sysconfdir}/network/if-up.d/create_vlan_intf
- # networking is done after rcS, any start level within rcS
- # for mac fixup should work
- install -m 755 eth0_mac_fixup.sh ${D}${sysconfdir}/init.d/eth0_mac_fixup.sh
- update-rc.d -r ${D} eth0_mac_fixup.sh start 70 S .
- install -m 755 start_us_monitor.sh ${D}${sysconfdir}/init.d/start_us_monitor.sh
- update-rc.d -r ${D} start_us_monitor.sh start 84 S .
- install -m 755 power-on.sh ${D}${sysconfdir}/init.d/power-on.sh
- update-rc.d -r ${D} power-on.sh start 85 S .
- install -m 0755 ${WORKDIR}/rc.local ${D}${sysconfdir}/init.d/rc.local
- update-rc.d -r ${D} rc.local start 99 2 3 4 5 .
-}
-
-do_install_append() {
- do_install_board
-}
-
-FILES_${PN} += "${sysconfdir}"
diff --git a/meta-facebook/meta-wedge/recipes-wedge/ipmid/files/Makefile b/meta-facebook/meta-wedge/recipes-wedge/ipmid/files/Makefile
deleted file mode 100644
index c21df07..0000000
--- a/meta-facebook/meta-wedge/recipes-wedge/ipmid/files/Makefile
+++ /dev/null
@@ -1,29 +0,0 @@
-# Copyright 2014-present Facebook. All Rights Reserved.
-#
-# This program file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program in a file named COPYING; if not, write to the
-# Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor,
-# Boston, MA 02110-1301 USA
-
-all: ipmid
-
-ipmid: ipmid.c \
- platform/timestamp.c platform/sel.c platform/sdr.c \
- platform/wedge/sensor.c \
- platform/wedge/fruid.c
- $(CC) -pthread -lwedge_eeprom -std=c99 -o $@ $^ $(LDFLAGS)
-
-.PHONY: clean
-
-clean:
- rm -rf *.o platform/*.o platform/wedge/*.o ipmid
diff --git a/meta-facebook/meta-wedge/recipes-wedge/ipmid/files/ipmid.c b/meta-facebook/meta-wedge/recipes-wedge/ipmid/files/ipmid.c
deleted file mode 100644
index 4771e15..0000000
--- a/meta-facebook/meta-wedge/recipes-wedge/ipmid/files/ipmid.c
+++ /dev/null
@@ -1,1490 +0,0 @@
-/*
- *
- * Copyright 2014-present Facebook. All Rights Reserved.
- *
- * This file contains code to support IPMI2.0 Specificaton available @
- * http://www.intel.com/content/www/us/en/servers/ipmi/ipmi-specifications.html
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-
-#include "platform/sdr.h"
-#include "platform/sel.h"
-#include "platform/fruid.h"
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <errno.h>
-#include <syslog.h>
-#include <string.h>
-#include <pthread.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <sys/un.h>
-
-#define SOCK_PATH "/tmp/ipmi_socket"
-
-#define MAX_NUM_DIMMS 4
-#define IPMI_SEL_VERSION 0x51
-#define IPMI_SDR_VERSION 0x51
-
-#define SIZE_AUTH_ENABLES 5
-#define SIZE_IP_ADDR 4
-#define SIZE_MAC_ADDR 6
-#define SIZE_NET_MASK 4
-#define SIZE_IP_HDR 3
-#define SIZE_RMCP_PORT 2
-#define SIZE_COMMUNITY_STR 18
-#define SIZE_DEST_TYPE 4
-#define SIZE_DEST_ADDR 18
-#define SIZE_TIME_STAMP 4
-
-#define SIZE_PROC_FREQ 2
-#define SIZE_DIMM_SPEED 2
-#define SIZE_DIMM_SIZE 2
-
-#define SIZE_SYSFW_VER 17
-#define SIZE_SYS_NAME 17
-#define SIZE_OS_NAME 17
-#define SIZE_OS_VER 17
-#define SIZE_BMC_URL 17
-#define SIZE_OS_HV_URL 17
-
-#define SIZE_SEL_REC 16
-#define SIZE_IPMI_RES_HDR 3
-
-#define MAX_IPMI_MSG_SIZE 100
-
-// IPMI request Structure (IPMI/Section 9.2)
-typedef struct
-{
- unsigned char netfn_lun;
- unsigned char cmd;
- unsigned char data[];
-} ipmi_req_t;
-
-// IPMI response Structure (IPMI/Section 9.3)
-typedef struct
-{
- unsigned char netfn_lun;
- unsigned char cmd;
- unsigned char cc;
- unsigned char data[];
-} ipmi_res_t;
-
-// LAN Configuration Structure (IPMI/Table 23.4)
-typedef struct
-{
- unsigned char set_in_prog;
- unsigned char auth_support;
- unsigned char auth_enables[SIZE_AUTH_ENABLES];
- unsigned char ip_addr[SIZE_IP_ADDR];
- unsigned char ip_src;
- unsigned char mac_addr[SIZE_MAC_ADDR];
- unsigned char net_mask[SIZE_NET_MASK];
- unsigned char ip_hdr[SIZE_IP_HDR];
- unsigned char pri_rmcp_port[SIZE_RMCP_PORT];
- unsigned char sec_rmcp_port[SIZE_RMCP_PORT];
- unsigned char arp_ctrl;
- unsigned char garp_interval;
- unsigned char df_gw_ip_addr[SIZE_IP_ADDR];
- unsigned char df_gw_mac_addr[SIZE_MAC_ADDR];
- unsigned char back_gw_ip_addr[SIZE_IP_ADDR];
- unsigned char back_gw_mac_addr[SIZE_MAC_ADDR];
- unsigned char community_str[SIZE_COMMUNITY_STR];
- unsigned char no_of_dest;
- unsigned char dest_type[SIZE_DEST_TYPE];
- unsigned char dest_addr[SIZE_DEST_ADDR];
-} lan_config_t;
-
-// Structure to store Processor Information
-typedef struct
-{
- unsigned char type;
- unsigned char freq[SIZE_PROC_FREQ];
-} proc_info_t;
-
-// Structure to store DIMM Information
-typedef struct
-{
- unsigned char type;
- unsigned char speed[SIZE_DIMM_SPEED];
- unsigned char size[SIZE_DIMM_SIZE];
-} dimm_info_t;
-
-// Structure for System Info Params (IPMI/Section 22.14a)
-typedef struct
-{
- unsigned char set_in_prog;
- unsigned char sysfw_ver[SIZE_SYSFW_VER];
- unsigned char sys_name[SIZE_SYS_NAME];
- unsigned char pri_os_name[SIZE_OS_NAME];
- unsigned char present_os_name[SIZE_OS_NAME];
- unsigned char present_os_ver[SIZE_OS_VER];
- unsigned char bmc_url[SIZE_BMC_URL];
- unsigned char os_hv_url[SIZE_OS_HV_URL];
-} sys_info_param_t;
-
-// Network Function Codes (IPMI/Section 5.1)
-enum
-{
- NETFN_CHASSIS_REQ = 0x00,
- NETFN_CHASSIS_RES,
- NETFN_BRIDGE_REQ,
- NETFN_BRIDGE_RES,
- NETFN_SENSOR_REQ,
- NETFN_SENSOR_RES,
- NETFN_APP_REQ,
- NETFN_APP_RES,
- NETFN_FIRMWARE_REQ,
- NETFN_FIRMWARE_RES,
- NETFN_STORAGE_REQ,
- NETFN_STORAGE_RES,
- NETFN_TRANSPORT_REQ,
- NETFN_TRANSPORT_RES,
- NETFN_OEM_REQ = 0x30,
- NETFN_OEM_RES = 0x31,
-};
-
-// Chassis Command Codes (IPMI/Table H-1)
-enum
-{
- CMD_CHASSIS_GET_STATUS = 0x01,
- CMD_CHASSIS_GET_BOOT_OPTIONS = 0x09,
-};
-
-// Application Command Codes (IPMI/Table H-1)
-enum
-{
- CMD_APP_GET_DEVICE_ID = 0x01,
- CMD_APP_GET_SELFTEST_RESULTS = 0x04,
- CMD_APP_GET_DEVICE_GUID = 0x08,
- CMD_APP_RESET_WDT = 0x22,
- CMD_APP_SET_WDT = 0x24,
- CMD_APP_GET_WDT = 0x25,
- CMD_APP_GET_GLOBAL_ENABLES = 0x2F,
- CMD_APP_GET_SYSTEM_GUID = 0x37,
- CMD_APP_SET_SYS_INFO_PARAMS = 0x58,
- CMD_APP_GET_SYS_INFO_PARAMS = 0x59,
-};
-
-// Storage Command Codes (IPMI/Table H-1)
-enum
-{
- CMD_STORAGE_GET_FRUID_INFO = 0x10,
- CMD_STORAGE_READ_FRUID_DATA = 0x11,
- CMD_STORAGE_GET_SDR_INFO = 0x20,
- CMD_STORAGE_RSV_SDR = 0x22,
- CMD_STORAGE_GET_SDR = 0x23,
- CMD_STORAGE_GET_SEL_INFO = 0x40,
- CMD_STORAGE_RSV_SEL = 0x42,
- CMD_STORAGE_GET_SEL = 0x43,
- CMD_STORAGE_ADD_SEL = 0x44,
- CMD_STORAGE_CLR_SEL = 0x47,
- CMD_STORAGE_GET_SEL_TIME = 0x48,
- CMD_STORAGE_GET_SEL_UTC = 0x5C,
-};
-
-// Transport Command Codes (IPMI/Table H-1)
-enum
-{
- CMD_TRANSPORT_SET_LAN_CONFIG = 0x01,
- CMD_TRANSPORT_GET_LAN_CONFIG = 0x02,
-};
-
-// OEM Command Codes (Quanta/FB defined commands)
-enum
-{
- CMD_OEM_SET_PROC_INFO = 0x1A,
- CMD_OEM_SET_DIMM_INFO = 0x1C,
- CMD_OEM_SET_POST_START = 0x73,
- CMD_OEM_SET_POST_END = 0x74,
-};
-
-// IPMI command Completion Codes (IPMI/Section 5.2)
-enum
-{
- CC_SUCCESS = 0x00,
- CC_INVALID_PARAM = 0x80,
- CC_SEL_ERASE_PROG = 0x81,
- CC_INVALID_CMD = 0xC1,
- CC_PARAM_OUT_OF_RANGE = 0xC9,
- CC_UNSPECIFIED_ERROR = 0xFF,
-};
-
-// LAN Configuration parameters (IPMI/Table 23-4)
-enum
-{
- LAN_PARAM_SET_IN_PROG,
- LAN_PARAM_AUTH_SUPPORT,
- LAN_PARAM_AUTH_ENABLES,
- LAN_PARAM_IP_ADDR,
- LAN_PARAM_IP_SRC,
- LAN_PARAM_MAC_ADDR,
- LAN_PARAM_NET_MASK,
- LAN_PARAM_IP_HDR,
- LAN_PARAM_PRI_RMCP_PORT,
- LAN_PARAM_SEC_RMCP_PORT,
- LAN_PARAM_ARP_CTRL,
- LAN_PARAM_GARP_INTERVAL,
- LAN_PARAM_DF_GW_IP_ADDR,
- LAN_PARAM_DF_GW_MAC_ADDR,
- LAN_PARAM_BACK_GW_IP_ADDR,
- LAN_PARAM_BACK_GW_MAC_ADDR,
- LAN_PARAM_COMMUNITY_STR,
- LAN_PARAM_NO_OF_DEST,
- LAN_PARAM_DEST_TYPE,
- LAN_PARAM_DEST_ADDR,
-};
-
-// Boot Option Parameters (IPMI/Table 28-14)
-enum
-{
- PARAM_SET_IN_PROG = 0x00,
- PARAM_SVC_PART_SELECT,
- PARAM_SVC_PART_SCAN,
- PARAM_BOOT_FLAG_CLR,
- PARAM_BOOT_INFO_ACK,
- PARAM_BOOT_FLAGS,
- PARAM_BOOT_INIT_INFO,
-};
-
-//System Info Parameters (IPMI/Table 22-16c)
-enum
-{
- SYS_INFO_PARAM_SET_IN_PROG,
- SYS_INFO_PARAM_SYSFW_VER,
- SYS_INFO_PARAM_SYS_NAME,
- SYS_INFO_PARAM_PRI_OS_NAME,
- SYS_INFO_PARAM_PRESENT_OS_NAME,
- SYS_INFO_PARAM_PRESENT_OS_VER,
- SYS_INFO_PARAM_BMC_URL,
- SYS_INFO_PARAM_OS_HV_URL,
-};
-
-// TODO: Once data storage is finalized, the following structure needs
-// to be retrieved/updated from persistant backend storage
-static lan_config_t g_lan_config = { 0 };
-static proc_info_t g_proc_info = { 0 };
-static dimm_info_t g_dimm_info[MAX_NUM_DIMMS] = { 0 };
-
-// TODO: Need to store this info after identifying proper storage
-static sys_info_param_t g_sys_info_params;
-
-// TODO: Based on performance testing results, might need fine grained locks
-// Since the global data is specific to a NetFunction, adding locs at NetFn level
-static pthread_mutex_t m_chassis;
-static pthread_mutex_t m_app;
-static pthread_mutex_t m_storage;
-static pthread_mutex_t m_transport;
-static pthread_mutex_t m_oem;
-
-/*
- * Function(s) to handle IPMI messages with NetFn: Chassis
- */
-// Get Chassis Status (IPMI/Section 28.2)
-static void
-chassis_get_status (unsigned char *response, unsigned char *res_len)
-{
- ipmi_res_t *res = (ipmi_res_t *) response;
- unsigned char *data = &res->data[0];
-
- res->cc = CC_SUCCESS;
-
- // TODO: Need to obtain current power state and last power event
- // from platform and return
- *data++ = 0x01; // Current Power State
- *data++ = 0x00; // Last Power Event
- *data++ = 0x40; // Misc. Chassis Status
- *data++ = 0x00; // Front Panel Button Disable
-
- res_len = data - &res->data[0];
-}
-
-// Get System Boot Options (IPMI/Section 28.12)
-static void
-chassis_get_boot_options (unsigned char *request, unsigned char *response,
- unsigned char *res_len)
-{
- ipmi_req_t *req = (ipmi_req_t *) request;
- ipmi_res_t *res= (ipmi_res_t *) response;
- unsigned char *data = &res->data[0];
- unsigned char param = req->data[0];
-
- // Fill response with default values
- res->cc = CC_SUCCESS;
- *data++ = 0x01; // Parameter Version
- *data++ = req->data[0]; // Parameter
-
- // TODO: Need to store user settings and return
- switch (param)
- {
- case PARAM_SET_IN_PROG:
- *data++ = 0x00; // Set In Progress
- break;
- case PARAM_SVC_PART_SELECT:
- *data++ = 0x00; // Service Partition Selector
- break;
- case PARAM_SVC_PART_SCAN:
- *data++ = 0x00; // Service Partition Scan
- break;
- case PARAM_BOOT_FLAG_CLR:
- *data++ = 0x00; // BMC Boot Flag Valid Bit Clear
- break;
- case PARAM_BOOT_INFO_ACK:
- *data++ = 0x00; // Write Mask
- *data++ = 0x00; // Boot Initiator Ack Data
- break;
- case PARAM_BOOT_FLAGS:
- *data++ = 0x00; // Boot Flags
- *data++ = 0x00; // Boot Device Selector
- *data++ = 0x00; // Firmwaer Verbosity
- *data++ = 0x00; // BIOS Override
- *data++ = 0x00; // Device Instance Selector
- break;
- case PARAM_BOOT_INIT_INFO:
- *data++ = 0x00; // Chanel Number
- *data++ = 0x00; // Session ID (4 bytes)
- *data++ = 0x00;
- *data++ = 0x00;
- *data++ = 0x00;
- *data++ = 0x00; // Boot Info Timestamp (4 bytes)
- *data++ = 0x00;
- *data++ = 0x00;
- *data++ = 0x00;
- break;
- deault:
- res->cc = CC_PARAM_OUT_OF_RANGE;
- break;
- }
-
- if (res->cc == CC_SUCCESS) {
- *res_len = data - &res->data[0];
- }
-}
-
-// Handle Chassis Commands (IPMI/Section 28)
-static void
-ipmi_handle_chassis (unsigned char *request, unsigned char req_len,
- unsigned char *response, unsigned char *res_len)
-{
- ipmi_req_t *req = (ipmi_req_t *) request;
- ipmi_res_t *res = (ipmi_res_t *) response;
- unsigned char cmd = req->cmd;
-
- pthread_mutex_lock(&m_chassis);
- switch (cmd)
- {
- case CMD_CHASSIS_GET_STATUS:
- chassis_get_status (response, res_len);
- break;
- case CMD_CHASSIS_GET_BOOT_OPTIONS:
- chassis_get_boot_options (request, response, res_len);
- break;
- default:
- res->cc = CC_INVALID_CMD;
- break;
- }
- pthread_mutex_unlock(&m_chassis);
-}
-
-/*
- * Function(s) to handle IPMI messages with NetFn: Application
- */
-// Get Device ID (IPMI/Section 20.1)
-static void
-app_get_device_id (unsigned char *response, unsigned char *res_len)
-{
-
- ipmi_res_t *res = (ipmi_res_t *) response;
- unsigned char *data = &res->data[0];
-
- res->cc = CC_SUCCESS;
-
- //TODO: Following data needs to be updated based on platform
- *data++ = 0x20; // Device ID
- *data++ = 0x81; // Device Revision
- *data++ = 0x00; // Firmware Revision Major
- *data++ = 0x09; // Firmware Revision Minor
- *data++ = 0x02; // IPMI Version
- *data++ = 0xBF; // Additional Device Support
- *data++ = 0x15; // Manufacturer ID1
- *data++ = 0xA0; // Manufacturer ID2
- *data++ = 0x00; // Manufacturer ID3
- *data++ = 0x46; // Product ID1
- *data++ = 0x31; // Product ID2
- *data++ = 0x00; // Aux. Firmware Version1
- *data++ = 0x00; // Aux. Firmware Version2
- *data++ = 0x00; // Aux. Firmware Version3
- *data++ = 0x00; // Aux. Firmware Version4
-
- *res_len = data - &res->data[0];
-}
-
-// Get Self Test Results (IPMI/Section 20.4)
-static void
-app_get_selftest_results (unsigned char *response, unsigned char *res_len)
-{
-
- ipmi_res_t *res = (ipmi_res_t *) response;
- unsigned char *data = &res->data[0];
-
- res->cc = CC_SUCCESS;
-
- //TODO: Following data needs to be updated based on self-test results
- *data++ = 0x55; // Self-Test result
- *data++ = 0x00; // Extra error info in case of failure
-
- *res_len = data - &res->data[0];
-}
-
-// Get Device GUID (IPMI/Section 20.8)
-static void
-app_get_device_guid (unsigned char *response, unsigned char *res_len)
-{
- ipmi_res_t *res = (ipmi_res_t *) response;
- unsigned char *data = &res->data[0];
-
- res->cc = 0x00;
-
- // TODO: Following data is Globaly Unique ID i.e. MAC Address..
- *data++ = 0x0;
- *data++ = 0x1;
- *data++ = 0x2;
- *data++ = 0x3;
- *data++ = 0x4;
- *data++ = 0x5;
- *data++ = 0x6;
- *data++ = 0x7;
- *data++ = 0x8;
- *data++ = 0x9;
- *data++ = 0xa;
- *data++ = 0xb;
- *data++ = 0xc;
- *data++ = 0xd;
- *data++ = 0xe;
- *data++ = 0xf;
-
- *res_len = data - &res->data[0];
-}
-
-// Get BMC Global Enables (IPMI/Section 22.2)
-static void
-app_get_global_enables (unsigned char *response, unsigned char *res_len)
-{
-
- ipmi_res_t *res = (ipmi_res_t *) response;
- unsigned char *data = &res->data[0];
-
- res->cc = CC_SUCCESS;
-
- *data++ = 0x09; // Global Enable
-
- *res_len = data - &res->data[0];
-}
-
-// Set System Info Params (IPMI/Section 22.14a)
-static void
-app_set_sys_info_params (unsigned char *request, unsigned char *response,
- unsigned char *res_len)
-{
-
- ipmi_req_t *req = (ipmi_req_t *) request;
- ipmi_res_t *res = (ipmi_res_t *) response;
- unsigned char param = req->data[0];
-
- res->cc = CC_SUCCESS;
-
- switch (param)
- {
- case SYS_INFO_PARAM_SET_IN_PROG:
- g_sys_info_params.set_in_prog = req->data[1];
- break;
- case SYS_INFO_PARAM_SYSFW_VER:
- memcpy(g_sys_info_params.sysfw_ver, &req->data[1], SIZE_SYSFW_VER);
- break;
- case SYS_INFO_PARAM_SYS_NAME:
- memcpy(g_sys_info_params.sys_name, &req->data[1], SIZE_SYS_NAME);
- break;
- case SYS_INFO_PARAM_PRI_OS_NAME:
- memcpy(g_sys_info_params.pri_os_name, &req->data[1], SIZE_OS_NAME);
- break;
- case SYS_INFO_PARAM_PRESENT_OS_NAME:
- memcpy(g_sys_info_params.present_os_name, &req->data[1], SIZE_OS_NAME);
- break;
- case SYS_INFO_PARAM_PRESENT_OS_VER:
- memcpy(g_sys_info_params.present_os_ver, &req->data[1], SIZE_OS_VER);
- break;
- case SYS_INFO_PARAM_BMC_URL:
- memcpy(g_sys_info_params.bmc_url, &req->data[1], SIZE_BMC_URL);
- break;
- case SYS_INFO_PARAM_OS_HV_URL:
- memcpy(g_sys_info_params.os_hv_url, &req->data[1], SIZE_OS_HV_URL);
- break;
- default:
- res->cc = CC_INVALID_PARAM;
- break;
- }
-
- return;
-}
-
-// Get System Info Params (IPMI/Section 22.14b)
-static void
-app_get_sys_info_params (unsigned char *request, unsigned char *response,
- unsigned char *res_len)
-{
-
- ipmi_req_t *req = (ipmi_req_t *) request;
- ipmi_res_t *res = (ipmi_res_t *) response;
- unsigned char *data = &res->data[0];
- unsigned char param = req->data[1];
-
- // Fill default return values
- res->cc = CC_SUCCESS;
- *data++ = 1; // Parameter revision
-
- switch (param)
- {
- case SYS_INFO_PARAM_SET_IN_PROG:
- *data++ = g_sys_info_params.set_in_prog;
- break;
- case SYS_INFO_PARAM_SYSFW_VER:
- memcpy(data, g_sys_info_params.sysfw_ver, SIZE_SYSFW_VER);
- data += SIZE_SYSFW_VER;
- break;
- case SYS_INFO_PARAM_SYS_NAME:
- memcpy(data, g_sys_info_params.sys_name, SIZE_SYS_NAME);
- data += SIZE_SYS_NAME;
- break;
- case SYS_INFO_PARAM_PRI_OS_NAME:
- memcpy(data, g_sys_info_params.pri_os_name, SIZE_OS_NAME);
- data += SIZE_OS_NAME;
- break;
- case SYS_INFO_PARAM_PRESENT_OS_NAME:
- memcpy(data, g_sys_info_params.present_os_name, SIZE_OS_NAME);
- data += SIZE_OS_NAME;
- break;
- case SYS_INFO_PARAM_PRESENT_OS_VER:
- memcpy(data, g_sys_info_params.present_os_ver, SIZE_OS_VER);
- data += SIZE_OS_VER;
- break;
- case SYS_INFO_PARAM_BMC_URL:
- memcpy(data, g_sys_info_params.bmc_url, SIZE_BMC_URL);
- data += SIZE_BMC_URL;
- break;
- case SYS_INFO_PARAM_OS_HV_URL:
- memcpy(data, g_sys_info_params.os_hv_url, SIZE_OS_HV_URL);
- data += SIZE_OS_HV_URL;
- break;
- default:
- res->cc = CC_INVALID_PARAM;
- break;
- }
-
- if (res->cc == CC_SUCCESS) {
- *res_len = data - &res->data[0];
- }
-
- return;
-}
-
-// Handle Appliction Commands (IPMI/Section 20)
-static void
-ipmi_handle_app (unsigned char *request, unsigned char req_len,
- unsigned char *response, unsigned char *res_len)
-{
- ipmi_req_t *req = (ipmi_req_t *) request;
- ipmi_res_t *res = (ipmi_res_t *) response;
- unsigned char cmd = req->cmd;
-
- pthread_mutex_lock(&m_app);
- switch (cmd)
- {
- case CMD_APP_GET_DEVICE_ID:
- app_get_device_id (response, res_len);
- break;
- case CMD_APP_GET_SELFTEST_RESULTS:
- app_get_selftest_results (response, res_len);
- break;
- case CMD_APP_GET_DEVICE_GUID:
- case CMD_APP_GET_SYSTEM_GUID:
- // Get Device GUID and Get System GUID returns same data
- // from IPMI stack. FYI, Get System GUID will have to be
- // sent with in an IPMI session that includes session info
- app_get_device_guid (response, res_len);
- break;
- case CMD_APP_GET_GLOBAL_ENABLES:
- app_get_global_enables (response, res_len);
- break;
- case CMD_APP_SET_SYS_INFO_PARAMS:
- app_set_sys_info_params (request, response, res_len);
- break;
- case CMD_APP_GET_SYS_INFO_PARAMS:
- app_get_sys_info_params (request, response, res_len);
- break;
- default:
- res->cc = CC_INVALID_CMD;
- break;
- }
- pthread_mutex_unlock(&m_app);
-}
-
-/*
- * Function(s) to handle IPMI messages with NetFn: Storage
- */
-
-static void
-storage_get_fruid_info(unsigned char *response, unsigned char *res_len)
-{
- ipmi_res_t *res = (ipmi_res_t *) response;
- unsigned char *data = &res->data[0];
- int size = plat_fruid_size();
-
- res->cc = CC_SUCCESS;
-
- *data++ = size & 0xFF; // FRUID size LSB
- *data++ = (size >> 8) & 0xFF; // FRUID size MSB
- *data++ = 0x00; // Device accessed by bytes
-
- *res_len = data - &res->data[0];
-
- return;
-}
-
-static void
-storage_get_fruid_data(unsigned char *request, unsigned char *response,
- unsigned char *res_len)
-{
- ipmi_req_t *req = (ipmi_req_t *) request;
- ipmi_res_t *res = (ipmi_res_t *) response;
- unsigned char *data = &res->data[0];
-
- int offset = req->data[1] + (req->data[2] << 8);
- int count = req->data[3];
-
- int ret = plat_fruid_data(offset, count, &(res->data[1]));
- if (ret) {
- res->cc = CC_UNSPECIFIED_ERROR;
- } else {
- res->cc = CC_SUCCESS;
- *data++ = count;
- data += count;
- }
-
- if (res->cc == CC_SUCCESS) {
- *res_len = data - &res->data[0];
- }
- return;
-}
-
-static void
-storage_get_sdr_info (unsigned char *response, unsigned char *res_len)
-{
- ipmi_res_t *res = (ipmi_res_t *) response;
- unsigned char *data = &res->data[0];
- int num_entries; // number of sdr records
- int free_space; // free space in SDR device in bytes
- time_stamp_t ts_recent_add; // Recent Addition Timestamp
- time_stamp_t ts_recent_erase; // Recent Erasure Timestamp
-
- // Use platform APIs to get SDR information
- num_entries = plat_sdr_num_entries ();
- free_space = plat_sdr_free_space ();
- plat_sdr_ts_recent_add (&ts_recent_add);
- plat_sdr_ts_recent_erase (&ts_recent_erase);
-
- res->cc = CC_SUCCESS;
-
- *data++ = IPMI_SDR_VERSION; // SDR version
- *data++ = num_entries & 0xFF; // number of sdr entries
- *data++ = (num_entries >> 8) & 0xFF;
- *data++ = free_space & 0xFF; // Free SDR Space
- *data++ = (free_space >> 8) & 0xFF;
-
- memcpy(data, ts_recent_add.ts, SIZE_TIME_STAMP);
- data += SIZE_TIME_STAMP;
-
- memcpy(data, ts_recent_erase.ts, SIZE_TIME_STAMP);
- data += SIZE_TIME_STAMP;
-
- *data++ = 0x02; // Operations supported
-
- *res_len = data - &res->data[0];
-
- return;
-}
-
-static void
-storage_rsv_sdr (unsigned char *response, unsigned char *res_len)
-{
- ipmi_res_t *res = (ipmi_res_t *) response;
- unsigned char *data = &res->data[0];
- int rsv_id; // SDR reservation ID
-
- // Use platform APIs to get a SDR reservation ID
- rsv_id = plat_sdr_rsv_id ();
- if (rsv_id < 0)
- {
- res->cc = CC_UNSPECIFIED_ERROR;
- return;
- }
-
- res->cc = CC_SUCCESS;
- *data++ = rsv_id & 0xFF; // Reservation ID
- *data++ = (rsv_id >> 8) & 0XFF;
-
- *res_len = data - &res->data[0];
-
- return;
-}
-
-static void
-storage_get_sdr (unsigned char *request, unsigned char *response,
- unsigned char *res_len)
-{
- ipmi_req_t *req = (ipmi_req_t *) request;
- ipmi_res_t *res = (ipmi_res_t *) response;
- unsigned char *data = &res->data[0];
-
- int read_rec_id; //record ID to be read
- int next_rec_id; //record ID for the next entry
- int rsv_id; // Reservation ID for the request
- int rec_offset; // Read offset into the record
- int rec_bytes; // Number of bytes to be read
- sdr_rec_t entry; // SDR record entry
- int ret;
-
- rsv_id = (req->data[1] >> 8) | req->data[0];
- read_rec_id = (req->data[3] >> 8) | req->data[2];
- rec_offset = req->data[4];
- rec_bytes = req->data[5];
-
- // Use platform API to read the record Id and get next ID
- ret = plat_sdr_get_entry (rsv_id, read_rec_id, &entry, &next_rec_id);
- if (ret)
- {
- res->cc = CC_UNSPECIFIED_ERROR;
- return;
- }
-
- res->cc = CC_SUCCESS;
- *data++ = next_rec_id & 0xFF; // next record ID
- *data++ = (next_rec_id >> 8) & 0xFF;
-
- memcpy (data, &entry.rec[rec_offset], rec_bytes);
- data += rec_bytes;
-
- *res_len = data - &res->data[0];
-
- return;
-}
-
-static void
-storage_get_sel_info (unsigned char *response, unsigned char *res_len)
-{
- ipmi_res_t *res = (ipmi_res_t *) response;
- unsigned char *data = &res->data[0];
- int num_entries; // number of log entries
- int free_space; // free space in SEL device in bytes
- time_stamp_t ts_recent_add; // Recent Addition Timestamp
- time_stamp_t ts_recent_erase; // Recent Erasure Timestamp
-
- // Use platform APIs to get SEL information
- num_entries = plat_sel_num_entries ();
- free_space = plat_sel_free_space ();
- plat_sel_ts_recent_add (&ts_recent_add);
- plat_sel_ts_recent_erase (&ts_recent_erase);
-
- res->cc = CC_SUCCESS;
-
- *data++ = IPMI_SEL_VERSION; // SEL version
- *data++ = num_entries & 0xFF; // number of log entries
- *data++ = (num_entries >> 8) & 0xFF;
- *data++ = free_space & 0xFF; // Free SEL Space
- *data++ = (free_space >> 8) & 0xFF;
-
- memcpy(data, ts_recent_add.ts, SIZE_TIME_STAMP);
- data += SIZE_TIME_STAMP;
-
- memcpy(data, ts_recent_erase.ts, SIZE_TIME_STAMP);
- data += SIZE_TIME_STAMP;
-
- *data++ = 0x02; // Operations supported
-
- *res_len = data - &res->data[0];
-
- return;
-}
-
-static void
-storage_rsv_sel (unsigned char *response, unsigned char *res_len)
-{
- ipmi_res_t *res = (ipmi_res_t *) response;
- unsigned char *data = &res->data[0];
- int rsv_id; // SEL reservation ID
-
- // Use platform APIs to get a SEL reservation ID
- rsv_id = plat_sel_rsv_id ();
- if (rsv_id < 0)
- {
- res->cc = CC_SEL_ERASE_PROG;
- return;
- }
-
- res->cc = CC_SUCCESS;
- *data++ = rsv_id & 0xFF; // Reservation ID
- *data++ = (rsv_id >> 8) & 0XFF;
-
- *res_len = data - &res->data[0];
-
- return;
-}
-
-static void
-storage_get_sel (unsigned char *request, unsigned char *response,
- unsigned char *res_len)
-{
- ipmi_req_t *req = (ipmi_req_t *) request;
- ipmi_res_t *res = (ipmi_res_t *) response;
- unsigned char *data = &res->data[0];
-
- int read_rec_id; //record ID to be read
- int next_rec_id; //record ID for the next msg
- sel_msg_t entry; // SEL log entry
- int ret;
-
- read_rec_id = (req->data[3] >> 8) | req->data[2];
-
- // Use platform API to read the record Id and get next ID
- ret = plat_sel_get_entry (read_rec_id, &entry, &next_rec_id);
- if (ret)
- {
- res->cc = CC_UNSPECIFIED_ERROR;
- return;
- }
-
- res->cc = CC_SUCCESS;
- *data++ = next_rec_id & 0xFF; // next record ID
- *data++ = (next_rec_id >> 8) & 0xFF;
-
- memcpy(data, entry.msg, SIZE_SEL_REC);
- data += SIZE_SEL_REC;
-
- *res_len = data - &res->data[0];
-
- return;
-}
-
-static void
-storage_add_sel (unsigned char *request, unsigned char *response,
- unsigned char *res_len)
-{
- ipmi_req_t *req = (ipmi_req_t *) request;
- ipmi_res_t *res = (ipmi_res_t *) response;
- unsigned char *data = &res->data[0];
-
-
- int record_id; // Record ID for added entry
- int ret;
-
- sel_msg_t entry;
-
- memcpy(entry.msg, req->data, SIZE_SEL_REC);
-
- // Use platform APIs to add the new SEL entry
- ret = plat_sel_add_entry (&entry, &record_id);
- if (ret)
- {
- res->cc = CC_UNSPECIFIED_ERROR;
- return;
- }
-
- res->cc = CC_SUCCESS;
- *data++ = record_id & 0xFF;
- *data++ = (record_id >> 8) & 0xFF;
-
- *res_len = data - &res->data[0];
-
- return;
-}
-
-static void
-storage_clr_sel (unsigned char *request, unsigned char *response,
- unsigned char *res_len)
-{
- ipmi_req_t *req = (ipmi_req_t *) request;
- ipmi_res_t *res = (ipmi_res_t *) response;
- unsigned char *data = &res->data[0];
-
- sel_erase_stat_t status;
- int ret;
- int rsv_id;
-
- // Verify the request to contain 'CLR' characters
- if ((req->data[2] != 'C') || (req->data[3] != 'L') || (req->data[4] != 'R'))
- {
- res->cc = CC_INVALID_PARAM;
- return;
- }
-
- // Populate reservation ID given in request
- rsv_id = (req->data[1] << 8) | req->data[0];
-
- // Use platform APIs to clear or get status
- if (req->data[5] == IPMI_SEL_INIT_ERASE)
- {
- ret = plat_sel_erase (rsv_id);
- }
- else if (req->data[5] == IPMI_SEL_ERASE_STAT)
- {
- ret = plat_sel_erase_status (rsv_id, &status);
- }
- else
- {
- res->cc = CC_INVALID_PARAM;
- return;
- }
-
- // Handle platform error and return
- if (ret)
- {
- res->cc = CC_UNSPECIFIED_ERROR;
- return;
- }
-
- res->cc = CC_SUCCESS;
- *data++ = status;
-
- *res_len = data - &res->data[0];
-
- return;
-}
-
-static void
-ipmi_handle_storage (unsigned char *request, unsigned char req_len,
- unsigned char *response, unsigned char *res_len)
-{
- ipmi_req_t *req = (ipmi_req_t *) request;
- ipmi_res_t *res = (ipmi_res_t *) response;
- unsigned char cmd = req->cmd;
-
- res->cc = CC_SUCCESS;
- *res_len = 0;
-
- pthread_mutex_lock(&m_storage);
- switch (cmd)
- {
- case CMD_STORAGE_GET_FRUID_INFO:
- storage_get_fruid_info (response, res_len);
- break;
- case CMD_STORAGE_READ_FRUID_DATA:
- storage_get_fruid_data (request, response, res_len);
- break;
- case CMD_STORAGE_GET_SEL_INFO:
- storage_get_sel_info (response, res_len);
- break;
- case CMD_STORAGE_RSV_SEL:
- storage_rsv_sel (response, res_len);
- break;
- case CMD_STORAGE_ADD_SEL:
- storage_add_sel (request, response, res_len);
- break;
- case CMD_STORAGE_GET_SEL:
- storage_get_sel (request, response, res_len);
- break;
- case CMD_STORAGE_CLR_SEL:
- storage_clr_sel (request, response, res_len);
- break;
- case CMD_STORAGE_GET_SDR_INFO:
- storage_get_sdr_info (response, res_len);
- break;
- case CMD_STORAGE_RSV_SDR:
- storage_rsv_sdr (response, res_len);
- break;
- case CMD_STORAGE_GET_SDR:
- storage_get_sdr (request, response, res_len);
- break;
- default:
- res->cc = CC_INVALID_CMD;
- break;
- }
-
- pthread_mutex_unlock(&m_storage);
- return;
-}
-
-/*
- * Function(s) to handle IPMI messages with NetFn: Transport
- */
-
-// Set LAN Configuration (IPMI/Section 23.1)
-static void
-transport_set_lan_config (unsigned char *request, unsigned char *response,
- unsigned char *res_len)
-{
- ipmi_req_t *req = (ipmi_req_t *) request;
- ipmi_res_t *res = (ipmi_res_t *) response;
- unsigned char param = req->data[1];
-
- // Fill the response with default values
- res->cc = CC_SUCCESS;
-
- switch (param)
- {
- case LAN_PARAM_SET_IN_PROG:
- g_lan_config.set_in_prog = req->data[2];
- break;
- case LAN_PARAM_AUTH_SUPPORT:
- g_lan_config.auth_support = req->data[2];
- break;
- case LAN_PARAM_AUTH_ENABLES:
- memcpy(g_lan_config.auth_enables, &req->data[2], SIZE_AUTH_ENABLES);
- break;
- case LAN_PARAM_IP_ADDR:
- memcpy(g_lan_config.ip_addr, &req->data[2], SIZE_IP_ADDR);
- break;
- case LAN_PARAM_IP_SRC:
- g_lan_config.ip_src = req->data[2];
- break;
- case LAN_PARAM_MAC_ADDR:
- memcpy(g_lan_config.mac_addr, &req->data[2], SIZE_MAC_ADDR);
- break;
- case LAN_PARAM_NET_MASK:
- memcpy(g_lan_config.net_mask, &req->data[2], SIZE_NET_MASK);
- break;
- case LAN_PARAM_IP_HDR:
- memcpy(g_lan_config.ip_hdr, &req->data[2], SIZE_IP_HDR);
- break;
- case LAN_PARAM_PRI_RMCP_PORT:
- g_lan_config.pri_rmcp_port[0] = req->data[2];
- g_lan_config.pri_rmcp_port[1] = req->data[3];
- break;
- case LAN_PARAM_SEC_RMCP_PORT:
- g_lan_config.sec_rmcp_port[0] = req->data[2];
- g_lan_config.sec_rmcp_port[1] = req->data[3];
- break;
- case LAN_PARAM_ARP_CTRL:
- g_lan_config.arp_ctrl = req->data[2];
- break;
- case LAN_PARAM_GARP_INTERVAL:
- g_lan_config.garp_interval = req->data[2];
- break;
- case LAN_PARAM_DF_GW_IP_ADDR:
- memcpy(g_lan_config.df_gw_ip_addr, &req->data[2], SIZE_IP_ADDR);
- break;
- case LAN_PARAM_DF_GW_MAC_ADDR:
- memcpy(g_lan_config.df_gw_mac_addr, &req->data[2], SIZE_MAC_ADDR);
- break;
- case LAN_PARAM_BACK_GW_IP_ADDR:
- memcpy(g_lan_config.back_gw_ip_addr, &req->data[2], SIZE_IP_ADDR);
- break;
- case LAN_PARAM_BACK_GW_MAC_ADDR:
- memcpy(g_lan_config.back_gw_mac_addr, &req->data[2], SIZE_MAC_ADDR);
- break;
- case LAN_PARAM_COMMUNITY_STR:
- memcpy(g_lan_config.community_str, &req->data[2], SIZE_COMMUNITY_STR);
- break;
- case LAN_PARAM_NO_OF_DEST:
- g_lan_config.no_of_dest = req->data[2];
- break;
- case LAN_PARAM_DEST_TYPE:
- memcpy(g_lan_config.dest_type, &req->data[2], SIZE_DEST_TYPE);
- break;
- case LAN_PARAM_DEST_ADDR:
- memcpy(g_lan_config.dest_addr, &req->data[2], SIZE_DEST_ADDR);
- break;
- default:
- res->cc = CC_INVALID_PARAM;
- break;
- }
-}
-
-// Get LAN Configuration (IPMI/Section 23.2)
-static void
-transport_get_lan_config (unsigned char *request, unsigned char *response,
- unsigned char *res_len)
-{
-
- ipmi_req_t *req = (ipmi_req_t *) request;
- ipmi_res_t *res = (ipmi_res_t *) response;
- unsigned char *data = &res->data[0];
- unsigned char param = req->data[1];
-
- // Fill the response with default values
- res->cc = CC_SUCCESS;
- *data++ = 0x01; // Parameter revision
-
- switch (param)
- {
- case LAN_PARAM_SET_IN_PROG:
- *data++ = g_lan_config.set_in_prog;
- break;
- case LAN_PARAM_AUTH_SUPPORT:
- *data++ = g_lan_config.auth_support;
- break;
- case LAN_PARAM_AUTH_ENABLES:
- memcpy(data, g_lan_config.auth_enables, SIZE_AUTH_ENABLES);
- data += SIZE_AUTH_ENABLES;
- break;
- case LAN_PARAM_IP_ADDR:
- memcpy(data, g_lan_config.ip_addr, SIZE_IP_ADDR);
- data += SIZE_IP_ADDR;
- break;
- case LAN_PARAM_IP_SRC:
- *data++ = g_lan_config.ip_src;
- break;
- case LAN_PARAM_MAC_ADDR:
- memcpy(data, g_lan_config.mac_addr, SIZE_MAC_ADDR);
- data += SIZE_MAC_ADDR;
- break;
- case LAN_PARAM_NET_MASK:
- memcpy(data, g_lan_config.net_mask, SIZE_NET_MASK);
- data += SIZE_NET_MASK;
- break;
- case LAN_PARAM_IP_HDR:
- memcpy(data, g_lan_config.ip_hdr, SIZE_IP_HDR);
- data += SIZE_IP_HDR;
- break;
- case LAN_PARAM_PRI_RMCP_PORT:
- *data++ = g_lan_config.pri_rmcp_port[0];
- *data++ = g_lan_config.pri_rmcp_port[1];
- break;
- case LAN_PARAM_SEC_RMCP_PORT:
- *data++ = g_lan_config.sec_rmcp_port[0];
- *data++ = g_lan_config.sec_rmcp_port[1];
- break;
- case LAN_PARAM_ARP_CTRL:
- *data++ = g_lan_config.arp_ctrl;
- break;
- case LAN_PARAM_GARP_INTERVAL:
- *data++ = g_lan_config.garp_interval;
- break;
- case LAN_PARAM_DF_GW_IP_ADDR:
- memcpy(data, g_lan_config.df_gw_ip_addr, SIZE_IP_ADDR);
- data += SIZE_IP_ADDR;
- break;
- case LAN_PARAM_DF_GW_MAC_ADDR:
- memcpy(data, g_lan_config.df_gw_mac_addr, SIZE_MAC_ADDR);
- data += SIZE_MAC_ADDR;
- break;
- case LAN_PARAM_BACK_GW_IP_ADDR:
- memcpy(data, g_lan_config.back_gw_ip_addr, SIZE_IP_ADDR);
- data += SIZE_IP_ADDR;
- break;
- case LAN_PARAM_BACK_GW_MAC_ADDR:
- memcpy(data, g_lan_config.back_gw_mac_addr, SIZE_MAC_ADDR);
- data += SIZE_MAC_ADDR;
- break;
- case LAN_PARAM_COMMUNITY_STR:
- memcpy(data, g_lan_config.community_str, SIZE_COMMUNITY_STR);
- data += SIZE_COMMUNITY_STR;
- break;
- case LAN_PARAM_NO_OF_DEST:
- *data++ = g_lan_config.no_of_dest;
- break;
- case LAN_PARAM_DEST_TYPE:
- memcpy(data, g_lan_config.dest_type, SIZE_DEST_TYPE);
- data += SIZE_DEST_TYPE;
- break;
- case LAN_PARAM_DEST_ADDR:
- memcpy(data, g_lan_config.dest_addr, SIZE_DEST_ADDR);
- data += SIZE_DEST_ADDR;
- break;
- default:
- res->cc = CC_INVALID_PARAM;
- break;
- }
-
- if (res->cc == CC_SUCCESS) {
- *res_len = data - &res->data[0];
- }
-}
-
-// Handle Transport Commands (IPMI/Section 23)
-static void
-ipmi_handle_transport (unsigned char *request, unsigned char req_len,
- unsigned char *response, unsigned char *res_len)
-{
- ipmi_req_t *req = (ipmi_req_t *) request;
- ipmi_res_t *res = (ipmi_res_t *) response;
- unsigned char cmd = req->cmd;
-
- pthread_mutex_lock(&m_transport);
- switch (cmd)
- {
- case CMD_TRANSPORT_SET_LAN_CONFIG:
- transport_set_lan_config (request, response, res_len);
- break;
- case CMD_TRANSPORT_GET_LAN_CONFIG:
- transport_get_lan_config (request, response, res_len);
- break;
- default:
- res->cc = CC_INVALID_CMD;
- break;
- }
- pthread_mutex_unlock(&m_transport);
-}
-
-/*
- * Function(s) to handle IPMI messages with NetFn: OEM
- */
-
-static void
-oem_set_proc_info (unsigned char *request, unsigned char *response,
- unsigned char *res_len)
-{
- ipmi_req_t *req = (ipmi_req_t *) request;
- ipmi_res_t *res = (ipmi_res_t *) response;
-
- g_proc_info.type = req->data[1];
- g_proc_info.freq[0] = req->data[2];
- g_proc_info.freq[1] = req->data[3];
-
- res->cc = CC_SUCCESS;
- *res_len = 0;
-}
-
-static void
-oem_set_dimm_info (unsigned char *request, unsigned char *response,
- unsigned char *res_len)
-{
- ipmi_req_t *req = (ipmi_req_t *) request;
- ipmi_res_t *res = (ipmi_res_t *) response;
-
- unsigned char index = req->data[0];
-
- g_dimm_info[index].type = req->data[1];
- g_dimm_info[index].speed[0] = req->data[2];
- g_dimm_info[index].speed[1] = req->data[3];
- g_dimm_info[index].size[0] = req->data[4];
- g_dimm_info[index].size[1] = req->data[5];
-
- res->cc = CC_SUCCESS;
- *res_len = 0;
-}
-
-static void
-oem_set_post_start (unsigned char *response, unsigned char *res_len)
-{
-
- ipmi_res_t *res = (ipmi_res_t *) response;
-
- // TODO: For now logging the event, need to find usage for this info
- syslog (LOG_INFO, "POST Start Event\n");
-
- res->cc = CC_SUCCESS;
- *res_len = 0;
-}
-
-static void
-oem_set_post_end (unsigned char *response, unsigned char *res_len)
-{
-
- ipmi_res_t *res = (ipmi_res_t *) response;
-
- // TODO: For now logging the event, need to find usage for this info
- syslog (LOG_INFO, "POST End Event\n");
-
- res->cc = CC_SUCCESS;
- *res_len = 0;
-}
-
-static void
-ipmi_handle_oem (unsigned char *request, unsigned char req_len,
- unsigned char *response, unsigned char *res_len)
-{
-
- ipmi_req_t *req = (ipmi_req_t *) request;
- ipmi_res_t *res = (ipmi_res_t *) response;
-
- unsigned char cmd = req->cmd;
-
- pthread_mutex_lock(&m_oem);
- switch (cmd)
- {
- case CMD_OEM_SET_PROC_INFO:
- oem_set_proc_info (request, response, res_len);
- break;
- case CMD_OEM_SET_DIMM_INFO:
- oem_set_dimm_info (request, response, res_len);
- break;
- case CMD_OEM_SET_POST_START:
- oem_set_post_start (response, res_len);
- break;
- case CMD_OEM_SET_POST_END:
- oem_set_post_end (response, res_len);
- break;
- default:
- res->cc = CC_INVALID_CMD;
- break;
- }
- pthread_mutex_unlock(&m_oem);
-}
-
-/*
- * Function to handle all IPMI messages
- */
-static void
-ipmi_handle (unsigned char *request, unsigned char req_len,
- unsigned char *response, unsigned char *res_len)
-{
-
- ipmi_req_t *req = (ipmi_req_t *) request;
- ipmi_res_t *res = (ipmi_res_t *) response;
- unsigned char netfn;
-
- netfn = req->netfn_lun >> 2;
-
- // Provide default values in the response message
- res->cmd = req->cmd;
- res->cc = 0xFF; // Unspecified completion code
- *res_len = 0;
-
- switch (netfn)
- {
- case NETFN_CHASSIS_REQ:
- res->netfn_lun = NETFN_CHASSIS_RES << 2;
- ipmi_handle_chassis (request, req_len, response, res_len);
- break;
- case NETFN_APP_REQ:
- res->netfn_lun = NETFN_APP_RES << 2;
- ipmi_handle_app (request, req_len, response, res_len);
- break;
- case NETFN_STORAGE_REQ:
- res->netfn_lun = NETFN_STORAGE_RES << 2;
- ipmi_handle_storage (request, req_len, response, res_len);
- break;
- case NETFN_TRANSPORT_REQ:
- res->netfn_lun = NETFN_TRANSPORT_RES << 2;
- ipmi_handle_transport (request, req_len, response, res_len);
- break;
- case NETFN_OEM_REQ:
- res->netfn_lun = NETFN_OEM_RES << 2;
- ipmi_handle_oem (request, req_len, response, res_len);
- break;
- default:
- res->netfn_lun = (netfn + 1) << 2;
- break;
- }
-
- // This header includes NetFunction, Command, and Completion Code
- *res_len += SIZE_IPMI_RES_HDR;
-
- return;
-}
-
-void
-*conn_handler(void *socket_desc) {
- int sock = *(int*)socket_desc;
- int n;
- unsigned char req_buf[MAX_IPMI_MSG_SIZE];
- unsigned char res_buf[MAX_IPMI_MSG_SIZE];
- unsigned char res_len = 0;
-
- n = recv (sock, req_buf, sizeof(req_buf), 0);
- if (n <= 0) {
- syslog(LOG_ALERT, "ipmid: recv() failed with %d\n", n);
- goto conn_cleanup;
- }
-
- ipmi_handle(req_buf, n, res_buf, &res_len);
-
- if (send (sock, res_buf, res_len, 0) < 0) {
- syslog(LOG_ALERT, "ipmid: send() failed\n");
- }
-
-conn_cleanup:
- close(sock);
-
- pthread_exit(NULL);
- return 0;
-}
-
-
-int
-main (void)
-{
- int s, s2, t, len;
- struct sockaddr_un local, remote;
- pthread_t tid;
-
- daemon(1, 0);
- openlog("ipmid", LOG_CONS, LOG_DAEMON);
-
- plat_sel_init();
- plat_sensor_init();
- plat_sdr_init();
- plat_fruid_init();
-
- pthread_mutex_init(&m_chassis, NULL);
- pthread_mutex_init(&m_app, NULL);
- pthread_mutex_init(&m_storage, NULL);
- pthread_mutex_init(&m_transport, NULL);
- pthread_mutex_init(&m_oem, NULL);
-
- if ((s = socket (AF_UNIX, SOCK_STREAM, 0)) == -1)
- {
- syslog(LOG_ALERT, "ipmid: socket() failed\n");
- exit (1);
- }
-
- local.sun_family = AF_UNIX;
- strcpy (local.sun_path, SOCK_PATH);
- unlink (local.sun_path);
- len = strlen (local.sun_path) + sizeof (local.sun_family);
- if (bind (s, (struct sockaddr *) &local, len) == -1)
- {
- syslog(LOG_ALERT, "ipmid: bind() failed\n");
- exit (1);
- }
-
- if (listen (s, 5) == -1)
- {
- syslog(LOG_ALERT, "ipmid: listen() failed\n");
- exit (1);
- }
-
- while(1) {
- int n;
- t = sizeof (remote);
- if ((s2 = accept (s, (struct sockaddr *) &remote, &t)) < 0) {
- syslog(LOG_ALERT, "ipmid: accept() failed\n");
- break;
- }
-
- // Creating a worker thread to handle the request
- // TODO: Need to monitor the server performance with higher load and
- // see if we need to create pre-defined number of workers and schedule
- // the requests among them.
- if (pthread_create(&tid, NULL, conn_handler, (void*) &s2) < 0) {
- syslog(LOG_ALERT, "ipmid: pthread_create failed\n");
- close(s2);
- continue;
- }
-
- pthread_detach(tid);
- }
-
- close(s);
-
- pthread_mutex_destroy(&m_chassis);
- pthread_mutex_destroy(&m_app);
- pthread_mutex_destroy(&m_storage);
- pthread_mutex_destroy(&m_transport);
- pthread_mutex_destroy(&m_oem);
-
- return 0;
-}
diff --git a/meta-facebook/meta-wedge/recipes-wedge/ipmid/files/platform/fruid.h b/meta-facebook/meta-wedge/recipes-wedge/ipmid/files/platform/fruid.h
deleted file mode 100644
index 3580b08..0000000
--- a/meta-facebook/meta-wedge/recipes-wedge/ipmid/files/platform/fruid.h
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- *
- * Copyright 2015-present Facebook. All Rights Reserved.
- *
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-
-#ifndef __FRUID_H__
-#define __FRUID_H__
-
-int plat_fruid_size(void);
-int plat_fruid_data(int offset, int count, unsigned char *data);
-int plat_fruid_init(void);
-
-#endif /* __FRUID_H__ */
diff --git a/meta-facebook/meta-wedge/recipes-wedge/ipmid/files/platform/sdr.c b/meta-facebook/meta-wedge/recipes-wedge/ipmid/files/platform/sdr.c
deleted file mode 100644
index e0a2f9a..0000000
--- a/meta-facebook/meta-wedge/recipes-wedge/ipmid/files/platform/sdr.c
+++ /dev/null
@@ -1,412 +0,0 @@
-/*
- *
- * Copyright 2014-present Facebook. All Rights Reserved.
- *
- * This file represents platform specific implementation for storing
- * SDR record entries and acts as back-end for IPMI stack
- *
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-#include "sdr.h"
-#include "sensor.h"
-#include "timestamp.h"
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <errno.h>
-#include <syslog.h>
-#include <string.h>
-
-// SDR Header magic number
-#define SDR_HDR_MAGIC 0xFBFBFBFB
-
-// SDR Header version number
-#define SDR_HDR_VERSION 0x01
-
-// SDR reservation IDs can not be 0x00 or 0xFFFF
-#define SDR_RSVID_MIN 0x01
-#define SDR_RSVID_MAX 0xFFFE
-
-#define SDR_RECORDS_MAX 64 // to support around 64 sensors
-
-// SDR index to keep track
-#define SDR_INDEX_MIN 0
-#define SDR_INDEX_MAX (SDR_RECORDS_MAX - 1)
-
-// Record ID can not be 0x0 (IPMI/Section 31)
-#define SDR_RECID_MIN 1
-#define SDR_RECID_MAX SDR_RECORDS_MAX
-
-// Special RecID value for first and last (IPMI/Section 31)
-#define SDR_RECID_FIRST 0x0000
-#define SDR_RECID_LAST 0xFFFF
-
-#define SDR_VERSION 0x51
-#define SDR_LEN_MAX 64
-
-#define SDR_FULL_TYPE 0x01
-#define SDR_MGMT_TYPE 0x12
-#define SDR_OEM_TYPE 0xC0
-
-#define SDR_FULL_LEN 64
-#define SDR_MGMT_LEN 32
-#define SDR_OEM_LEN 64
-
-// SDR header struct to keep track of SEL Log entries
-typedef struct {
- int magic; // Magic number to check validity
- int version; // version number of this header
- int begin; // index to the first SDR entry
- int end; // index to the last SDR entry
- time_stamp_t ts_add; // last addition time stamp
- time_stamp_t ts_erase; // last erase time stamp
-} sdr_hdr_t;
-
-// Keep track of last Reservation ID
-static int g_rsv_id = 0x01;
-
-// SDR Header and data global structures
-static sdr_hdr_t g_sdr_hdr;
-static sdr_rec_t g_sdr_data[SDR_RECORDS_MAX];
-
-// Add a new SDR entry
-static int
-plat_sdr_add_entry(sdr_rec_t *rec, int *rec_id) {
- // If SDR is full, return error
- if (plat_sdr_num_entries() == SDR_RECORDS_MAX) {
- syslog(LOG_ALERT, "plat_sdr_add_entry: SDR full\n");
- return -1;
- }
-
- // Add Record ID which is array index + 1
- rec->rec[0] = g_sdr_hdr.end+1;
-
- // Add the enry at end
- memcpy(g_sdr_data[g_sdr_hdr.end].rec, rec->rec, sizeof(sdr_rec_t));
-
- // Return the newly added record ID
- *rec_id = g_sdr_hdr.end+1;
-
- // Increment the end pointer
- ++g_sdr_hdr.end;
-
- // Update timestamp for add in header
- time_stamp_fill(g_sdr_hdr.ts_add.ts);
-
- return 0;
-}
-
-static int
-sdr_add_mgmt_rec(sensor_mgmt_t *p_rec) {
- int rec_id = 0;
- sdr_rec_t sdr = { 0 };
- sdr_mgmt_t rec = { 0 };
-
- // Populate SDR MGMT record
- rec.ver = SDR_VERSION;
- rec.type = SDR_MGMT_TYPE;
- rec.len = SDR_MGMT_LEN;
-
- rec.slave_addr = p_rec->slave_addr;
- rec.chan_no = p_rec->chan_no;
-
- rec.pwr_state_init = p_rec->pwr_state_init;
- rec.dev_caps = p_rec->dev_caps;
- rec.ent_id = p_rec->ent_id;
- rec.ent_inst = p_rec->ent_inst;
- rec.oem = p_rec->oem;
- rec.str_type_len = p_rec->str_type_len;
- memcpy(rec.str, p_rec->str, SENSOR_STR_SIZE);
-
- // Copy this record to generic SDR record
- memcpy(sdr.rec, &rec, SDR_LEN_MAX);
-
- // Add this record to SDR repo
- if (plat_sdr_add_entry(&sdr, &rec_id)) {
- syslog(LOG_ALERT, "sdr_add_mgmt_rec: plat_sdr_add_entry failed\n");
- return -1;
- }
-
- return 0;
-}
-
-static int
-sdr_add_disc_rec(sensor_disc_t *p_rec) {
- int rec_id = 0;
- sdr_rec_t sdr = { 0 };
- sdr_full_t rec = { 0 };
-
- // Populate SDR FULL record
- rec.ver = SDR_VERSION;
- rec.type = SDR_FULL_TYPE;
- rec.len = SDR_FULL_LEN;
-
- rec.owner = p_rec->owner;
- rec.lun = p_rec->lun;
-
- rec.ent_id = p_rec->ent_id;
- rec.ent_inst = p_rec->ent_inst;
- rec.sensor_init = p_rec->sensor_init;
- rec.sensor_caps = p_rec->sensor_caps;
- rec.sensor_type = p_rec->sensor_type;
- rec.evt_read_type = p_rec->evt_read_type;
- memcpy(rec.assert_evt_mask, p_rec->assert_evt_mask, 2);
- memcpy(rec.deassert_evt_mask, p_rec->deassert_evt_mask, 2);
- memcpy(rec.read_evt_mask, p_rec->read_evt_mask, 2);
- rec.oem = p_rec->oem;
- rec.str_type_len = p_rec->str_type_len;
- memcpy(rec.str, p_rec->str, SENSOR_STR_SIZE);
-
- // Copy this record to generic SDR record
- memcpy(sdr.rec, &rec, SDR_LEN_MAX);
-
- // Add this record to SDR repo
- if (plat_sdr_add_entry(&sdr, &rec_id)) {
- syslog(LOG_ALERT, "sdr_add_disc_rec: plat_sdr_add_entry failed\n");
- return -1;
- }
-
- return 0;
-}
-
-static int
-sdr_add_thresh_rec(sensor_thresh_t *p_rec) {
- int rec_id = 0;
- sdr_rec_t sdr = { 0 };
- sdr_full_t rec = { 0 };
-
- // Populate SDR FULL record
- rec.ver = SDR_VERSION;
- rec.type = SDR_FULL_TYPE;
- rec.len = SDR_FULL_LEN;
-
- rec.owner = p_rec->owner;
- rec.lun = p_rec->lun;
-
- rec.ent_id = p_rec->ent_id;
- rec.ent_inst = p_rec->ent_inst;
- rec.sensor_init = p_rec->sensor_init;
- rec.sensor_caps = p_rec->sensor_caps;
- rec.sensor_type = p_rec->sensor_type;
- rec.evt_read_type = p_rec->evt_read_type;
- memcpy(rec.lt_read_mask, p_rec->lt_read_mask, 2);
- memcpy(rec.ut_read_mask, p_rec->ut_read_mask, 2);
- memcpy(rec.set_thresh_mask, p_rec->set_thresh_mask, 2);
- rec.sensor_units1 = p_rec->sensor_units1;
- rec.sensor_units2 = p_rec->sensor_units2;
- rec.sensor_units3 = p_rec->sensor_units3;
- rec.linear = p_rec->linear;
- rec.m_val = p_rec->m_val;
- rec.m_tolerance = p_rec->m_tolerance;
- rec.b_val = p_rec->b_val;
- rec.b_accuracy = p_rec->b_accuracy;
- rec.analog_flags = p_rec->analog_flags;
- rec.nominal = p_rec->nominal;
- rec.normal_max = p_rec->normal_max;
- rec.normal_min = p_rec->normal_min;
- rec.max_reading = p_rec->max_reading;
- rec.min_reading = p_rec->min_reading;
- rec.unr_thresh = p_rec->unr_thresh;
- rec.uc_thresh = p_rec->uc_thresh;
- rec.unc_thresh = p_rec->unc_thresh;
- rec.lnr_thresh = p_rec->lnr_thresh;
- rec.lc_thresh = p_rec->lc_thresh;
- rec.lnc_thresh = p_rec->lnc_thresh;
- rec.pos_hyst = p_rec->pos_hyst;
- rec.neg_hyst = p_rec->neg_hyst;
- rec.oem = p_rec->oem;
- rec.str_type_len = p_rec->str_type_len;
- memcpy(rec.str, p_rec->str, SENSOR_STR_SIZE);
-
- // Copy this record to generic SDR record
- memcpy(sdr.rec, &rec, SDR_LEN_MAX);
-
- // Add this record to SDR repo
- if (plat_sdr_add_entry(&sdr, &rec_id)) {
- syslog(LOG_ALERT, "sdr_add_thresh_rec: plat_sdr_add_entry failed\n");
- return -1;
- }
-
- return 0;
-}
-
-static int
-sdr_add_oem_rec(sensor_oem_t *p_rec) {
- int rec_id = 0;
- sdr_rec_t sdr = { 0 };
- sdr_oem_t rec = { 0 };
-
- // Populate SDR OEM record
- rec.ver = SDR_VERSION;
- rec.type = SDR_OEM_TYPE;
- rec.len = SDR_OEM_LEN;
-
- memcpy(rec.mfr_id, p_rec->mfr_id, 3);
- memcpy(rec.oem_data, p_rec->oem_data, SENSOR_OEM_DATA_SIZE);
-
- // Copy this record to generic SDR record
- memcpy(sdr.rec, &rec, SDR_LEN_MAX);
-
- // Add this record to SDR repo
- if (plat_sdr_add_entry(&sdr, &rec_id)) {
- syslog(LOG_ALERT, "sdr_add_oem_rec: plat_sdr_add_entry failed\n");
- return -1;
- }
-
- return 0;
-}
-
-// Platform specific SEL API entry points
-// Retrieve time stamp for recent add operation
-void
-plat_sdr_ts_recent_add(time_stamp_t *ts) {
- memcpy(ts->ts, g_sdr_hdr.ts_add.ts, 0x04);
-}
-
-// Retrieve time stamp for recent erase operation
-void
-plat_sdr_ts_recent_erase(time_stamp_t *ts) {
- memcpy(ts->ts, g_sdr_hdr.ts_erase.ts, 0x04);
-}
-
-// Retrieve total number of entries in SDR repo
-int
-plat_sdr_num_entries(void) {
- return (g_sdr_hdr.end - g_sdr_hdr.begin);
-}
-
-// Retrieve total free space available in SDR repo
-int
-plat_sdr_free_space(void) {
- int total_space;
- int used_space;
-
- total_space = SDR_RECORDS_MAX * sizeof(sdr_rec_t);
- used_space = plat_sdr_num_entries() * sizeof(sdr_rec_t);
-
- return (total_space - used_space);
-}
-
-// Reserve an ID that will be used in later operations
-// IPMI/Section 33.11
-int
-plat_sdr_rsv_id() {
- // Increment the current reservation ID and return
- if (g_rsv_id++ == SDR_RSVID_MAX) {
- g_rsv_id = SDR_RSVID_MIN;
- }
-
- return g_rsv_id;
-}
-
-// Get the SDR entry for a given record ID
-// IPMI/Section 33.12
-int
-plat_sdr_get_entry(int rsv_id, int read_rec_id, sdr_rec_t *rec,
- int *next_rec_id) {
-
- int index;
-
- // Make sure the rsv_id matches
- if (rsv_id != g_rsv_id) {
- syslog(LOG_ALERT, "plat_sdr_get_entry: Reservation ID mismatch\n");
- return -1;
- }
-
- // Find the index in to array based on given index
- if (read_rec_id == SDR_RECID_FIRST) {
- index = g_sdr_hdr.begin;
- } else if (read_rec_id == SDR_RECID_LAST) {
- index = g_sdr_hdr.end - 1;
- } else {
- index = read_rec_id - 1;
- }
-
- // If the SDR repo is empty return error
- if (plat_sdr_num_entries() == 0) {
- syslog(LOG_ALERT, "plat_sdr_get_entry: No entries\n");
- return -1;
- }
-
- // Check for boundary conditions
- if ((index < SDR_INDEX_MIN) || (index > SDR_INDEX_MAX)) {
- syslog(LOG_ALERT, "plat_sdr_get_entry: Invalid Record ID %d\n", read_rec_id);
- return -1;
- }
-
- // Check to make sure the given id is valid
- if (index < g_sdr_hdr.begin || index >= g_sdr_hdr.end) {
- syslog(LOG_ALERT, "plat_sdr_get_entry: Wrong Record ID %d\n", read_rec_id);
- return -1;
- }
-
- memcpy(rec->rec, g_sdr_data[index].rec, sizeof(sdr_rec_t));
-
- // Return the next record ID in the log
- *next_rec_id = ++read_rec_id;
-
- // If this is the last entry in the log, return 0xFFFF
- if (*next_rec_id == g_sdr_hdr.end) {
- *next_rec_id = SDR_RECID_LAST;
- }
-
- return 0;
-}
-
-
-// Initialize SDR Repo structure
-int
-plat_sdr_init(void) {
- int num;
- sensor_mgmt_t *p_mgmt;
- sensor_thresh_t *p_thresh;
- sensor_disc_t *p_disc;
- sensor_oem_t *p_oem;
-
- // Populate SDR Header
- g_sdr_hdr.magic = SDR_HDR_MAGIC;
- g_sdr_hdr.version = SDR_HDR_VERSION;
- g_sdr_hdr.begin = SDR_INDEX_MIN;
- g_sdr_hdr.end = SDR_INDEX_MIN;
- memset(g_sdr_hdr.ts_add.ts, 0x0, 4);
- memset(g_sdr_hdr.ts_erase.ts, 0x0, 4);
-
- // Populate all mgmt control sensors
- plat_sensor_mgmt_info(&num, &p_mgmt);
- for (int i = 0; i < num; i++) {
- sdr_add_mgmt_rec(&p_mgmt[i]);
- }
-
- // Populate all discrete sensors
- plat_sensor_disc_info(&num, &p_disc);
- for (int i = 0; i < num; i++) {
- sdr_add_disc_rec(&p_disc[i]);
- }
-
- // Populate all threshold sensors
- plat_sensor_thresh_info(&num, &p_thresh);
- for (int i = 0; i < num; i++) {
- sdr_add_thresh_rec(&p_thresh[i]);
- }
-
- // Populate all OEM sensors
- plat_sensor_oem_info(&num, &p_oem);
- for (int i = 0; i < num; i++) {
- sdr_add_oem_rec(&p_oem[i]);
- }
-
- return 0;
-}
diff --git a/meta-facebook/meta-wedge/recipes-wedge/ipmid/files/platform/sdr.h b/meta-facebook/meta-wedge/recipes-wedge/ipmid/files/platform/sdr.h
deleted file mode 100644
index 5e2a591..0000000
--- a/meta-facebook/meta-wedge/recipes-wedge/ipmid/files/platform/sdr.h
+++ /dev/null
@@ -1,132 +0,0 @@
-/*
- *
- * Copyright 2014-present Facebook. All Rights Reserved.
- *
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-
-#ifndef __SDR_H__
-#define __SDR_H__
-
-#include "timestamp.h"
-
-typedef struct {
- unsigned char rec[64];
-} sdr_rec_t;
-
-// Full Sensor SDR record; IPMI/Section 43.1
-typedef struct {
- // Sensor Record Header
- unsigned char rec_id[2];
- unsigned char ver;
- unsigned char type;
- unsigned char len;
- // Record Key Bytes
- unsigned char owner;
- unsigned char lun;
- unsigned char sensor_num;
- // Record Body Bytes
- unsigned char ent_id;
- unsigned char ent_inst;
- unsigned char sensor_init;
- unsigned char sensor_caps;
- unsigned char sensor_type;
- unsigned char evt_read_type;
- union {
- unsigned char assert_evt_mask[2];
- unsigned char lt_read_mask[2];
- };
- union {
- unsigned char deassert_evt_mask[2];
- unsigned char ut_read_mask[2];
- };
- union {
- unsigned char read_evt_mask[2];
- unsigned char set_thresh_mask[2];
- };
- unsigned char sensor_units1;
- unsigned char sensor_units2;
- unsigned char sensor_units3;
- unsigned char linear;
- unsigned char m_val;
- unsigned char m_tolerance;
- unsigned char b_val;
- unsigned char b_accuracy;
- unsigned char accuracy_dir;
- unsigned char rb_exp;
- unsigned char analog_flags;
- unsigned char nominal;
- unsigned char normal_max;
- unsigned char normal_min;
- unsigned char max_reading;
- unsigned char min_reading;
- unsigned char unr_thresh;
- unsigned char uc_thresh;
- unsigned char unc_thresh;
- unsigned char lnr_thresh;
- unsigned char lc_thresh;
- unsigned char lnc_thresh;
- unsigned char pos_hyst;
- unsigned char neg_hyst;
- unsigned char rsvd[2];
- unsigned char oem;
- unsigned char str_type_len;
- char str[16];
-} sdr_full_t;
-
-// Mgmt. Controller SDR record; IPMI/ Section 43.9
-typedef struct {
- // Sensor Record Header
- unsigned char rec_id[2];
- unsigned char ver;
- unsigned char type;
- unsigned char len;
- // Record Key Bytes
- unsigned char slave_addr;
- unsigned char chan_no;
- // Record Body Bytes
- unsigned char pwr_state_init;
- unsigned char dev_caps;
- unsigned char rsvd[3];
- unsigned char ent_id;
- unsigned char ent_inst;
- unsigned char oem;
- unsigned char str_type_len;
- char str[16];
-} sdr_mgmt_t;
-
-// OEM type SDR record; IPMI/Section 43.12
-typedef struct {
- // Sensor Record Header
- unsigned char rec_id[2];
- unsigned char ver;
- unsigned char type;
- unsigned char len;
- // Record Body Bytes
- unsigned char mfr_id[3];
- unsigned char oem_data[56];
-} sdr_oem_t;
-
-void plat_sdr_ts_recent_add(time_stamp_t *ts);
-void plat_sdr_ts_recent_erase(time_stamp_t *ts);
-int plat_sdr_num_entries(void);
-int plat_sdr_free_space(void);
-int plat_sdr_rsv_id();
-int plat_sdr_get_entry(int rsv_id, int read_rec_id, sdr_rec_t *rec,
- int *next_rec_id);
-int plat_sdr_init(void);
-
-#endif /* __SDR_H__ */
diff --git a/meta-facebook/meta-wedge/recipes-wedge/ipmid/files/platform/sel.c b/meta-facebook/meta-wedge/recipes-wedge/ipmid/files/platform/sel.c
deleted file mode 100644
index a7aa78f..0000000
--- a/meta-facebook/meta-wedge/recipes-wedge/ipmid/files/platform/sel.c
+++ /dev/null
@@ -1,438 +0,0 @@
-/*
- *
- * Copyright 2014-present Facebook. All Rights Reserved.
- *
- * This file represents platform specific implementation for storing
- * SEL logs and acts as back-end for IPMI stack
- *
- * TODO: Optimize the file handling to keep file open always instead of
- * current open/seek/close
- *
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-#include "sel.h"
-#include "timestamp.h"
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <errno.h>
-#include <syslog.h>
-#include <string.h>
-
-// SEL File.
-#define SEL_LOG_FILE "/mnt/data/sel.bin"
-
-// SEL Header magic number
-#define SEL_HDR_MAGIC 0xFBFBFBFB
-
-// SEL Header version number
-#define SEL_HDR_VERSION 0x01
-
-// SEL Data offset from file beginning
-#define SEL_DATA_OFFSET 0x100
-
-// SEL reservation IDs can not be 0x00 or 0xFFFF
-#define SEL_RSVID_MIN 0x01
-#define SEL_RSVID_MAX 0xFFFE
-
-// Number of SEL records before wrap
-#define SEL_RECORDS_MAX 128 // TODO: Based on need we can make it bigger
-#define SEL_ELEMS_MAX (SEL_RECORDS_MAX+1)
-
-// Index for circular array
-#define SEL_INDEX_MIN 0x00
-#define SEL_INDEX_MAX SEL_RECORDS_MAX
-
-// Record ID can not be 0x0 (IPMI/Section 31)
-#define SEL_RECID_MIN (SEL_INDEX_MIN+1)
-#define SEL_RECID_MAX (SEL_INDEX_MAX+1)
-
-// Special RecID value for first and last (IPMI/Section 31)
-#define SEL_RECID_FIRST 0x0000
-#define SEL_RECID_LAST 0xFFFF
-
-// SEL header struct to keep track of SEL Log entries
-typedef struct {
- int magic; // Magic number to check validity
- int version; // version number of this header
- int begin; // index to the begining of the log
- int end; // index to end of the log
- time_stamp_t ts_add; // last addition time stamp
- time_stamp_t ts_erase; // last erase time stamp
-} sel_hdr_t;
-
-// Keep track of last Reservation ID
-static int g_rsv_id = 0x01;
-
-// Cached version of SEL Header and data
-static sel_hdr_t g_sel_hdr;
-static sel_msg_t g_sel_data[SEL_ELEMS_MAX];
-
-// Local helper functions to interact with file system
-static int
-file_get_sel_hdr(void) {
- FILE *fp;
-
- fp = fopen(SEL_LOG_FILE, "r");
- if (fp == NULL) {
- return -1;
- }
-
- if (fread(&g_sel_hdr, sizeof(sel_hdr_t), 1, fp) <= 0) {
- syslog(LOG_ALERT, "file_get_sel_hdr: fread\n");
- fclose (fp);
- return -1;
- }
-
- fclose(fp);
- return 0;
-}
-
-static int
-file_get_sel_data(void) {
- FILE *fp;
-
- fp = fopen(SEL_LOG_FILE, "r");
- if (fp == NULL) {
- syslog(LOG_ALERT, "file_get_sel_data: fopen\n");
- return -1;
- }
-
- if (fseek(fp, SEL_DATA_OFFSET, SEEK_SET)) {
- syslog(LOG_ALERT, "file_get_sel_data: fseek\n");
- fclose(fp);
- return -1;
- }
-
- unsigned char buf[SEL_ELEMS_MAX * 16];
- if (fread(buf, 1, SEL_ELEMS_MAX * sizeof(sel_msg_t), fp) <= 0) {
- syslog(LOG_ALERT, "file_get_sel_data: fread\n");
- fclose(fp);
- return -1;
- }
-
- fclose(fp);
-
- for (int i = 0; i < SEL_ELEMS_MAX; i++) {
- for (int j = 0; j < sizeof(sel_msg_t);j++) {
- g_sel_data[i].msg[j] = buf[i*16 + j];
- }
- }
-
- return 0;
-}
-
-static int
-file_store_sel_hdr(void) {
- FILE *fp;
-
- fp = fopen(SEL_LOG_FILE, "r+");
- if (fp == NULL) {
- syslog(LOG_ALERT, "file_store_sel_hdr: fopen\n");
- return -1;
- }
-
- if (fwrite(&g_sel_hdr, sizeof(sel_hdr_t), 1, fp) <= 0) {
- syslog(LOG_ALERT, "file_store_sel_hdr: fwrite\n");
- fclose(fp);
- return -1;
- }
-
- fclose(fp);
-
- return 0;
-}
-
-static int
-file_store_sel_data(int recId, sel_msg_t *data) {
- FILE *fp;
- int index;
-
- fp = fopen(SEL_LOG_FILE, "r+");
- if (fp == NULL) {
- syslog(LOG_ALERT, "file_store_sel_data: fopen\n");
- return -1;
- }
-
- // Records are stored using zero-based index
- index = (recId-1) * sizeof(sel_msg_t);
-
- if (fseek(fp, SEL_DATA_OFFSET+index, SEEK_SET)) {
- syslog(LOG_ALERT, "file_store_sel_data: fseek\n");
- fclose(fp);
- return -1;
- }
-
- if (fwrite(data->msg, sizeof(sel_msg_t), 1, fp) <= 0) {
- syslog(LOG_ALERT, "file_store_sel_data: fwrite\n");
- fclose(fp);
- return -1;
- }
-
- fclose(fp);
-
- return 0;
-}
-
-// Platform specific SEL API entry points
-// Retrieve time stamp for recent add operation
-void
-plat_sel_ts_recent_add(time_stamp_t *ts) {
- memcpy(ts->ts, g_sel_hdr.ts_add.ts, 0x04);
-}
-
-// Retrieve time stamp for recent erase operation
-void
-plat_sel_ts_recent_erase(time_stamp_t *ts) {
- memcpy(ts->ts, g_sel_hdr.ts_erase.ts, 0x04);
-}
-
-// Retrieve total number of entries in SEL log
-int
-plat_sel_num_entries(void) {
- if (g_sel_hdr.begin <= g_sel_hdr.end) {
- return (g_sel_hdr.end - g_sel_hdr.begin);
- } else {
- return (g_sel_hdr.end + (SEL_INDEX_MAX - g_sel_hdr.begin + 1));
- }
-}
-
-// Retrieve total free space available in SEL log
-int
-plat_sel_free_space(void) {
- int total_space;
- int used_space;
-
- total_space = SEL_RECORDS_MAX * sizeof(sel_msg_t);
- used_space = plat_sel_num_entries() * sizeof(sel_msg_t);
-
- return (total_space - used_space);
-}
-
-// Reserve an ID that will be used in later operations
-// IPMI/Section 31.4
-int
-plat_sel_rsv_id() {
- // Increment the current reservation ID and return
- if (g_rsv_id++ == SEL_RSVID_MAX) {
- g_rsv_id = SEL_RSVID_MIN;
- }
-
- return g_rsv_id;
-}
-
-// Get the SEL entry for a given record ID
-// IPMI/Section 31.5
-int
-plat_sel_get_entry(int read_rec_id, sel_msg_t *msg, int *next_rec_id) {
-
- int index;
-
- // Find the index in to array based on given index
- if (read_rec_id == SEL_RECID_FIRST) {
- index = g_sel_hdr.begin;
- } else if (read_rec_id == SEL_RECID_LAST) {
- if (g_sel_hdr.end) {
- index = g_sel_hdr.end - 1;
- } else {
- index = SEL_INDEX_MAX;
- }
- } else {
- index = read_rec_id - 1;
- }
-
- // If the log is empty return error
- if (plat_sel_num_entries() == 0) {
- syslog(LOG_ALERT, "plat_sel_get_entry: No entries\n");
- return -1;
- }
-
- // Check for boundary conditions
- if ((index < SEL_INDEX_MIN) || (index > SEL_INDEX_MAX)) {
- syslog(LOG_ALERT, "plat_sel_get_entry: Invalid Record ID %d\n", read_rec_id);
- return -1;
- }
-
- // If begin < end, check to make sure the given id falls between
- if (g_sel_hdr.begin < g_sel_hdr.end) {
- if (index < g_sel_hdr.begin || index >= g_sel_hdr.end) {
- syslog(LOG_ALERT, "plat_sel_get_entry: Wrong Record ID %d\n", read_rec_id);
- return -1;
- }
- }
-
- // If end < begin, check to make sure the given id is valid
- if (g_sel_hdr.begin > g_sel_hdr.end) {
- if (index >= g_sel_hdr.end && index < g_sel_hdr.begin) {
- syslog(LOG_ALERT, "plat_sel_get_entry: Wrong Record ID2 %d\n", read_rec_id);
- return -1;
- }
- }
-
- memcpy(msg->msg, g_sel_data[index].msg, sizeof(sel_msg_t));
-
- // Return the next record ID in the log
- *next_rec_id = read_rec_id++;
- if (*next_rec_id > SEL_INDEX_MAX) {
- *next_rec_id = SEL_INDEX_MIN;
- }
-
- // If this is the last entry in the log, return 0xFFFF
- if (*next_rec_id == g_sel_hdr.end) {
- *next_rec_id = SEL_RECID_LAST;
- }
-
- return 0;
-}
-
-// Add a new entry in to SEL log
-// IPMI/Section 31.6
-int
-plat_sel_add_entry(sel_msg_t *msg, int *rec_id) {
- // If the SEL if full, roll over. To keep track of empty condition, use
- // one empty location less than the max records.
- if (plat_sel_num_entries() == SEL_RECORDS_MAX) {
- syslog(LOG_ALERT, "plat_sel_add_entry: SEL rollover\n");
- if (++g_sel_hdr.begin > SEL_INDEX_MAX) {
- g_sel_hdr.begin = SEL_INDEX_MIN;
- }
- }
-
- // Update message's time stamp starting at byte 4
- time_stamp_fill(&msg->msg[3]);
-
- // Add the enry at end
- memcpy(g_sel_data[g_sel_hdr.end].msg, msg->msg, sizeof(sel_msg_t));
-
- // Return the newly added record ID
- *rec_id = g_sel_hdr.end+1;
-
- if (file_store_sel_data(*rec_id, msg)) {
- syslog(LOG_ALERT, "plat_sel_add_entry: file_store_sel_data\n");
- return -1;
- }
-
- // Increment the end pointer
- if (++g_sel_hdr.end > SEL_INDEX_MAX) {
- g_sel_hdr.end = SEL_INDEX_MIN;
- }
-
- // Update timestamp for add in header
- time_stamp_fill(g_sel_hdr.ts_add.ts);
-
- // Store the structure persistently
- if (file_store_sel_hdr()) {
- syslog(LOG_ALERT, "plat_sel_add_entry: file_store_sel_hdr\n");
- return -1;
- }
-
- return 0;
-}
-
-// Erase the SEL completely
-// IPMI/Section 31.9
-// Note: To reduce wear/tear, instead of erasing, manipulating the metadata
-int
-plat_sel_erase(int rsv_id) {
- if (rsv_id != g_rsv_id) {
- return -1;
- }
-
- // Erase SEL Logs
- g_sel_hdr.begin = SEL_INDEX_MIN;
- g_sel_hdr.end = SEL_INDEX_MIN;
-
- // Update timestamp for erase in header
- time_stamp_fill(g_sel_hdr.ts_erase.ts);
-
- // Store the structure persistently
- if (file_store_sel_hdr()) {
- syslog(LOG_ALERT, "plat_sel_erase: file_store_sel_hdr\n");
- return -1;
- }
-
- return 0;
-}
-
-// To get the erase status while erase happens
-// IPMI/Section 31.2
-// Note: Since we are not doing offline erasing, need not return in-progress state
-int
-plat_sel_erase_status(int rsv_id, sel_erase_stat_t *status) {
- if (rsv_id != g_rsv_id) {
- return -1;
- }
-
- // Since we do not do any offline erasing, always return erase done
- *status = SEL_ERASE_DONE;
-
- return 0;
-}
-
-// Initialize SEL log file
-int
-plat_sel_init(void) {
- FILE *fp;
-
- // Check if the file exists or not
- if (access(SEL_LOG_FILE, F_OK) == 0) {
- // Since file is present, fetch all the contents to cache
- if (file_get_sel_hdr()) {
- syslog(LOG_ALERT, "plat_init_sel: file_get_sel_hdr\n");
- return -1;
- }
-
- if (file_get_sel_data()) {
- syslog(LOG_ALERT, "plat_init_sel: file_get_sel_data\n");
- return -1;
- }
-
- return 0;
- }
-
- // File not present, so create the file
- fp = fopen(SEL_LOG_FILE, "w+");
- if (fp == NULL) {
- syslog(LOG_ALERT, "plat_init_sel: fopen\n");
- return -1;
- }
-
- fclose (fp);
-
- // Populate SEL Header in to the file
- g_sel_hdr.magic = SEL_HDR_MAGIC;
- g_sel_hdr.version = SEL_HDR_VERSION;
- g_sel_hdr.begin = SEL_INDEX_MIN;
- g_sel_hdr.end = SEL_INDEX_MIN;
- memset(g_sel_hdr.ts_add.ts, 0x0, 4);
- memset(g_sel_hdr.ts_erase.ts, 0x0, 4);
-
- if (file_store_sel_hdr()) {
- syslog(LOG_ALERT, "plat_init_sel: file_store_sel_hdr\n");
- return -1;
- }
-
- // Populate SEL Data in to the file
- for (int i = 1; i <= SEL_RECORDS_MAX; i++) {
- sel_msg_t msg = {0};
- if (file_store_sel_data(i, &msg)) {
- syslog(LOG_ALERT, "plat_init_sel: file_store_sel_data\n");
- return -1;
- }
- }
-
- return 0;
-}
diff --git a/meta-facebook/meta-wedge/recipes-wedge/ipmid/files/platform/sel.h b/meta-facebook/meta-wedge/recipes-wedge/ipmid/files/platform/sel.h
deleted file mode 100644
index 81dbcdf..0000000
--- a/meta-facebook/meta-wedge/recipes-wedge/ipmid/files/platform/sel.h
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- *
- * Copyright 2014-present Facebook. All Rights Reserved.
- *
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-
-#ifndef __SEL_H__
-#define __SEL_H__
-
-#include "timestamp.h"
-
-enum {
- IPMI_SEL_INIT_ERASE = 0xAA,
- IPMI_SEL_ERASE_STAT = 0x00,
-};
-
-typedef enum {
- SEL_ERASE_IN_PROG = 0x00,
- SEL_ERASE_DONE = 0x01,
-} sel_erase_stat_t;
-
-typedef struct {
- unsigned char msg[16];
-} sel_msg_t;
-
-void plat_sel_ts_recent_add(time_stamp_t *ts);
-void plat_sel_ts_recent_erase(time_stamp_t *ts);
-int plat_sel_num_entries(void);
-int plat_sel_free_space(void);
-int plat_sel_rsv_id();
-int plat_sel_get_entry(int read_rec_id, sel_msg_t *msg, int *next_rec_id);
-int plat_sel_add_entry(sel_msg_t *msg, int *rec_id);
-int plat_sel_erase(int rsv_id);
-int plat_sel_erase_status(int rsv_id, sel_erase_stat_t *status);
-int plat_sel_init(void);
-
-#endif /* __SEL_H__ */
diff --git a/meta-facebook/meta-wedge/recipes-wedge/ipmid/files/platform/sensor.h b/meta-facebook/meta-wedge/recipes-wedge/ipmid/files/platform/sensor.h
deleted file mode 100644
index 5d8c11a..0000000
--- a/meta-facebook/meta-wedge/recipes-wedge/ipmid/files/platform/sensor.h
+++ /dev/null
@@ -1,117 +0,0 @@
-/*
- *
- * Copyright 2014-present Facebook. All Rights Reserved.
- *
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-
-#ifndef __SENSOR_H__
-#define __SENSOR_H__
-
-#include "timestamp.h"
-
-#define IANA_ID_SIZE 3
-#define SENSOR_STR_SIZE 16
-#define SENSOR_OEM_DATA_SIZE 56
-
-// Threshold Sensor Descriptor
-typedef struct {
- unsigned char owner;
- unsigned char lun;
- unsigned char sensor_num;
- unsigned char ent_id;
- unsigned char ent_inst;
- unsigned char sensor_init;
- unsigned char sensor_caps;
- unsigned char sensor_type;
- unsigned char evt_read_type;
- unsigned char lt_read_mask[2];
- unsigned char ut_read_mask[2];
- unsigned char set_thresh_mask[2];
- unsigned char sensor_units1;
- unsigned char sensor_units2;
- unsigned char sensor_units3;
- unsigned char linear;
- unsigned char m_val;
- unsigned char m_tolerance;
- unsigned char b_val;
- unsigned char b_accuracy;
- unsigned char accuracy_dir;
- unsigned char rb_exp;
- unsigned char analog_flags;
- unsigned char nominal;
- unsigned char normal_max;
- unsigned char normal_min;
- unsigned char max_reading;
- unsigned char min_reading;
- unsigned char unr_thresh;
- unsigned char uc_thresh;
- unsigned char unc_thresh;
- unsigned char lnr_thresh;
- unsigned char lc_thresh;
- unsigned char lnc_thresh;
- unsigned char pos_hyst;
- unsigned char neg_hyst;
- unsigned char oem;
- unsigned char str_type_len;
- char str[SENSOR_STR_SIZE];
-} sensor_thresh_t;
-
-// Discrete Sensor Descriptor
-typedef struct {
- unsigned char owner;
- unsigned char lun;
- unsigned char sensor_num;
- unsigned char ent_id;
- unsigned char ent_inst;
- unsigned char sensor_init;
- unsigned char sensor_caps;
- unsigned char sensor_type;
- unsigned char evt_read_type;
- unsigned char assert_evt_mask[2];
- unsigned char deassert_evt_mask[2];
- unsigned char read_evt_mask[2];
- unsigned char oem;
- unsigned char str_type_len;
- char str[SENSOR_STR_SIZE];
-} sensor_disc_t;
-
-// Mgmt. Controller Sensor Descriptor
-typedef struct {
- unsigned char slave_addr;
- unsigned char chan_no;
- unsigned char pwr_state_init;
- unsigned char dev_caps;
- unsigned char ent_id;
- unsigned char ent_inst;
- unsigned char oem;
- unsigned char str_type_len;
- char str[SENSOR_STR_SIZE];
-} sensor_mgmt_t;
-
-// OEM type Sensor Descriptor
-typedef struct {
- unsigned char mfr_id[IANA_ID_SIZE];
- unsigned char oem_data[SENSOR_OEM_DATA_SIZE];
-} sensor_oem_t;
-
-void plat_sensor_mgmt_info(int *num, sensor_mgmt_t **p_sensor);
-void plat_sensor_disc_info(int *num, sensor_disc_t **p_sensor);
-void plat_sensor_thresh_info(int *num, sensor_thresh_t **p_sensor);
-void plat_sensor_oem_info(int *num, sensor_oem_t **p_sensor);
-int plat_sensor_init(void);
-
-#endif /* __SENSOR_H__ */
diff --git a/meta-facebook/meta-wedge/recipes-wedge/ipmid/files/platform/timestamp.c b/meta-facebook/meta-wedge/recipes-wedge/ipmid/files/platform/timestamp.c
deleted file mode 100644
index 11ac03e..0000000
--- a/meta-facebook/meta-wedge/recipes-wedge/ipmid/files/platform/timestamp.c
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- *
- * Copyright 2014-present Facebook. All Rights Reserved.
- *
- * This file is a helper file to fill timestamps from platform
- * used by SEL Logs, SDR records etc.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <errno.h>
-#include <syslog.h>
-#include <string.h>
-#include <sys/time.h>
-#include <time.h>
-
-// Local helper function to fill time stamp
-void
-time_stamp_fill(unsigned char *ts) {
- unsigned int time;
- struct timeval tv;
-
- gettimeofday(&tv, NULL);
-
- time = tv.tv_sec;
- ts[0] = time & 0xFF;
- ts[1] = (time >> 8) & 0xFF;
- ts[2] = (time >> 16) & 0xFF;
- ts[3] = (time >> 24) & 0xFF;
-
- return;
-}
diff --git a/meta-facebook/meta-wedge/recipes-wedge/ipmid/files/platform/timestamp.h b/meta-facebook/meta-wedge/recipes-wedge/ipmid/files/platform/timestamp.h
deleted file mode 100644
index 430dd23..0000000
--- a/meta-facebook/meta-wedge/recipes-wedge/ipmid/files/platform/timestamp.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- *
- * Copyright 2014-present Facebook. All Rights Reserved.
- *
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-
-#ifndef __TIMESTAMP_H__
-#define __TIMESTAMP_H__
-
-typedef struct {
- unsigned char ts[4];
-} time_stamp_t;
-
-void time_stamp_fill(unsigned char *ts);
-
-#endif /* __TIMESTAMP_H__ */
diff --git a/meta-facebook/meta-wedge/recipes-wedge/ipmid/files/platform/wedge/fruid.c b/meta-facebook/meta-wedge/recipes-wedge/ipmid/files/platform/wedge/fruid.c
deleted file mode 100644
index 1d9ddda..0000000
--- a/meta-facebook/meta-wedge/recipes-wedge/ipmid/files/platform/wedge/fruid.c
+++ /dev/null
@@ -1,183 +0,0 @@
-/*
- *
- * Copyright 2015-present Facebook. All Rights Reserved.
- *
- * This file provides platform specific implementation of FRUID information
- *
- * FRUID specification can be found at
- * www.intel.com/content/dam/www/public/us/en/documents/product-briefs/platform-management-fru-document-rev-1-2-feb-2013.pdf
- *
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-
-#include "../fruid.h"
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <errno.h>
-#include <syslog.h>
-#include <string.h>
-#include <facebook/wedge_eeprom.h>
-
-#define WEDGE_FRUID_SIZE 0x100
-
-#define COMMON_HDR_VER 1
-#define PROD_INFO_VER 1
-
-#define PROD_INFO_AREA_OFFSET 0x10
-#define PROD_INFO_CKSUM_OFFSET (PROD_INFO_AREA_OFFSET + 1)
-#define LANG_CODE_ENGLISH 25
-#define TYPE_STR 0xC0
-#define TYPE_LAST 0xC1
-#define ZERO_CKSUM_CONST 0x100
-#define LEN_BYTE_SIZE 8
-
-typedef struct _fruid_common_hdr_t {
- unsigned char ver;
- unsigned char internal_use_area_offset;
- unsigned char chassis_info_area_offset;
- unsigned char board_info_area_offset;
- unsigned char prod_info_area_offset;
- unsigned char multi_record_area_offset;
- unsigned char padding;
- unsigned char cksum;
-} fruid_common_hdr_t;
-
-// Global structures
-static unsigned char g_fruid[WEDGE_FRUID_SIZE] = {0};
-
-static void
-populate_fruid(void) {
-
- memset(&g_fruid, sizeof(g_fruid), 0);
-
- fruid_common_hdr_t *chdr = g_fruid;
-
- // Set Common Header version
- chdr->ver = COMMON_HDR_VER;
-
- // Product Info Area offset in multiples of 8 bytes
- chdr->prod_info_area_offset = PROD_INFO_AREA_OFFSET/LEN_BYTE_SIZE;
-
- // Calculate zero checksum
- chdr->cksum = chdr->ver + chdr->prod_info_area_offset;
- chdr->cksum = ZERO_CKSUM_CONST - chdr->cksum;
-
- // Retrieve Wedge EEPROM content
- struct wedge_eeprom_st eeprom;
- int rc = 0;
- rc = wedge_eeprom_parse(NULL, &eeprom);
- if (rc)
- {
- syslog(LOG_ALERT, "populate_fruid: wedge_eeprom_parse returns %d\n", rc);
- return;
- }
-
- // Start index at beginning of product info area
- int i = PROD_INFO_AREA_OFFSET;
- g_fruid[i++] = PROD_INFO_VER;
- g_fruid[i++] = 0x00; // prod area length; filled at end
- g_fruid[i++] = LANG_CODE_ENGLISH;
-
-#define _APPEND_STR_VALUE(name) do { \
- if (sizeof(name) < 1 || i + 1 + sizeof(name) >= sizeof(g_fruid)) { \
- break; \
- } \
- g_fruid[i++] = TYPE_STR + sizeof(name); \
- memcpy(&g_fruid[i], name, sizeof(name)); \
- i += sizeof(name); \
-} while(0)
-
- // Fill system manufacturer field
-
- _APPEND_STR_VALUE(eeprom.fbw_system_manufacturer);
-
- // Fill product name field
- _APPEND_STR_VALUE(eeprom.fbw_product_name);
-
- // Fill product number field
- _APPEND_STR_VALUE(eeprom.fbw_product_number);
-
- // convert product version to string and fill
- char vbuf[5] = {0};
- snprintf(vbuf, sizeof(vbuf), "%0X", eeprom.fbw_product_version);
- _APPEND_STR_VALUE(vbuf);
-
- // Fill product serial number field
- _APPEND_STR_VALUE(eeprom.fbw_product_serial);
-
- // Fill product asset tag field
- _APPEND_STR_VALUE(eeprom.fbw_product_asset);
-
- // Fill fruid file with dummy file name
- char fruid_file_name[] = "fruid_1.0";
- _APPEND_STR_VALUE(fruid_file_name);
-
- // Field to indicate the last entry
- g_fruid[i++] = TYPE_LAST;
-
- // length of the area in multiples of 8 bytes
- int len = i-PROD_INFO_AREA_OFFSET+1;
- if (len % LEN_BYTE_SIZE){
- // For non-multiple of 8 bytes, add one for partial data
- g_fruid[PROD_INFO_CKSUM_OFFSET] = len/LEN_BYTE_SIZE + 1;
- // And also increment index to keep checksum byte
- i += (len % LEN_BYTE_SIZE);
- } else {
- g_fruid[PROD_INFO_CKSUM_OFFSET] = len/LEN_BYTE_SIZE;
- }
-
- // Calculate zero checksum by adding all the values in product info area
- for (int j = PROD_INFO_AREA_OFFSET; j < i; j++) {
- g_fruid[i] += g_fruid[j];
- }
-
- // Calculate final cksum by subtraction
- g_fruid[i] = ZERO_CKSUM_CONST - g_fruid[i];
-
-#undef _APPEND_STR_VALUE
-
- return;
-}
-
-// Access functions for FRUID
-int
-plat_fruid_size(void) {
- return WEDGE_FRUID_SIZE;
-}
-
-int
-plat_fruid_data(int offset, int count, unsigned char *data) {
- // Check for the boundary condition
- if ((offset + count) > WEDGE_FRUID_SIZE) {
- return -1;
- }
-
- // Copy the FRUID content from the global structure
- memcpy(data, &(g_fruid[offset]), count);
-
- return 0;
-}
-
-// Initialize FRUID
-int
-plat_fruid_init(void) {
-
- // Populate FRUID global structure
- populate_fruid();
-
- return 0;
-}
diff --git a/meta-facebook/meta-wedge/recipes-wedge/ipmid/files/platform/wedge/sensor.c b/meta-facebook/meta-wedge/recipes-wedge/ipmid/files/platform/wedge/sensor.c
deleted file mode 100644
index ce3d4fb..0000000
--- a/meta-facebook/meta-wedge/recipes-wedge/ipmid/files/platform/wedge/sensor.c
+++ /dev/null
@@ -1,371 +0,0 @@
-/*
- *
- * Copyright 2014-present Facebook. All Rights Reserved.
- *
- * This file provides platform specific implementation of sensor information
- *
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-#include "../sensor.h"
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <errno.h>
-#include <syslog.h>
-#include <string.h>
-
-#define SENSOR_MGMT_MAX 1
-#define SENSOR_DISC_MAX 8
-#define SENSOR_THRESH_MAX 1
-#define SENSOR_OEM_MAX 1
-
-#define BMC_SLAVE_ADDR 0x20
-
-typedef struct {
- unsigned char num;
- sensor_mgmt_t sensor[SENSOR_MGMT_MAX];
-} sensor_mgmt_info_t;
-
-typedef struct {
- unsigned char num;
- sensor_disc_t sensor[SENSOR_DISC_MAX];
-} sensor_disc_info_t;
-
-typedef struct {
- unsigned char num;
- sensor_thresh_t sensor[SENSOR_THRESH_MAX];
-} sensor_thresh_info_t;
-
-typedef struct {
- unsigned char num;
- sensor_oem_t sensor[SENSOR_OEM_MAX];
-} sensor_oem_info_t;
-
-// Global structures
-static sensor_mgmt_info_t g_sensor_mgmt = {0};
-static sensor_disc_info_t g_sensor_disc = {0};
-static sensor_thresh_info_t g_sensor_thresh = {0};
-static sensor_oem_info_t g_sensor_oem = {0};
-
-static void
-populate_mgmt_sensors(void) {
- sensor_mgmt_t sensor = {0};
-
- // Add record for the AST2100 BMC
- sensor.slave_addr = BMC_SLAVE_ADDR;
- sensor.chan_no = 0x0; // Primary BMC controller
-
- // Init Agent = false
- sensor.pwr_state_init = 0x00;
-
- // FRUID = true, SEL = true, SDR = true, Sensor = true
- sensor.dev_caps = 0x0F;
-
- // Device ID string
- // Type - 0xC0: ASCII, Length - 0x09
- sensor.str_type_len = 0xC0 + 0x09;
- strncpy(sensor.str, "Wedge-BMC", 0x09);
-
- // Add this sensor to the global table
- if (g_sensor_mgmt.num >= SENSOR_MGMT_MAX) {
- syslog(LOG_ALERT, "populate_mgmt_sensors: num exceeded\n");
- return;
- }
-
- memcpy(&g_sensor_mgmt.sensor[g_sensor_mgmt.num], &sensor, sizeof(sensor_mgmt_t));
-
- g_sensor_mgmt.num++;
-
- return;
-}
-
-static void
-populate_disc_sensors(void) {
-
- sensor_disc_t sensor = {0};
-
- // Sensor uS Status
- // Sensor# 0x10
- // EntitiyId# 0xD0, EntityInst# 0x00
- // Sensor Type# Chassis 0x18
- // Event Read/Type# OEM 0x70
- sensor.owner= BMC_SLAVE_ADDR;
- sensor.lun = 0x00;
- sensor.sensor_num = 0x10;
-
- sensor.ent_id = 0xD0;
- sensor.ent_inst = 0x00;
- // Enable Scanning, Enable Events
- sensor.sensor_init = 0x63;
- // Supports Auto Re-Arm
- sensor.sensor_caps = 0x40;
- sensor.sensor_type = 0x18;
- sensor.evt_read_type = 0x70;
- // 1-bit for CPU0 Thermal Trip
- sensor.assert_evt_mask[0] = 0x04;
- sensor.deassert_evt_mask[0] = 0x00;
- sensor.read_evt_mask[0] = 0x04;
-
- // Device ID string
- // Type - 0xC0: ASCII, Length - 12
- sensor.str_type_len = 0xC0 + 9;
- strncpy(sensor.str, "uS-Status", 9);
-
- // Add this sensor to the global table
- if (g_sensor_disc.num >= SENSOR_DISC_MAX) {
- syslog(LOG_ALERT, "populate_disc_sensors: num exceeded\n");
- return;
- }
-
- memcpy(&g_sensor_disc.sensor[g_sensor_disc.num], &sensor, sizeof(sensor_disc_t));
-
- g_sensor_disc.num++;
-
- // Sensor SEL Status
- // Sensor# 0x5F
- // EntitiyId# 0xD0, EntityInst# 0x02
- // Sensor Type# OEM: 0xC0
- // Event Read/Type# Sensor Specific: 0x6F
- sensor.owner= BMC_SLAVE_ADDR;
- sensor.lun = 0x00;
- sensor.sensor_num = 0x5F;
-
- sensor.ent_id = 0xD0;
- sensor.ent_inst = 0x02;
- // Enable Scanning, Enable Events
- sensor.sensor_init = 0x63;
- // Supports Auto Re-Arm
- sensor.sensor_caps = 0x40;
- sensor.sensor_type = 0xC0;
- sensor.evt_read_type = 0x6F;
- // SEL Clear(bit1), SEL Rollover(bit8)
- sensor.assert_evt_mask[0] = 0x02;
- sensor.assert_evt_mask[1] = 0x01;
- sensor.deassert_evt_mask[0] = 0x00;
- sensor.deassert_evt_mask[1] = 0x00;
- sensor.read_evt_mask[0] = 0x02;
- sensor.read_evt_mask[1] = 0x01;
-
- // Device ID string
- // Type - 0xC0: ASCII, Length - 12
- sensor.str_type_len = 0xC0 + 10;
- strncpy(sensor.str, "SEL-Status", 10);
-
- // Add this sensor to the global table
- if (g_sensor_disc.num >= SENSOR_DISC_MAX) {
- syslog(LOG_ALERT, "populate_disc_sensors: num exceeded\n");
- return;
- }
-
- memcpy(&g_sensor_disc.sensor[g_sensor_disc.num], &sensor, sizeof(sensor_disc_t));
-
- g_sensor_disc.num++;
-
-
- // Sensor WDT
- // Sensor# 0x60
- // EntitiyId# 0xD0, EntityInst# 0x03
- // Sensor Type# WDT2: 0x23
- // Event Read/Type# Sensor Specific: 0x6F
- sensor.owner= BMC_SLAVE_ADDR;
- sensor.lun = 0x00;
- sensor.sensor_num = 0x60;
-
- sensor.ent_id = 0xD0;
- sensor.ent_inst = 0x03;
- // Enable Scanning, Enable Events
- sensor.sensor_init = 0x63;
- // Supports Auto Re-Arm
- sensor.sensor_caps = 0x40;
- sensor.sensor_type = 0x23;
- sensor.evt_read_type = 0x6F;
- // 5 bits for expiry, reset, pwrdown, pwrcycle, timer
- sensor.assert_evt_mask[0] = 0x0F;
- sensor.assert_evt_mask[1] = 0x01;
- sensor.deassert_evt_mask[0] = 0x00;
- sensor.deassert_evt_mask[1] = 0x00;
- sensor.read_evt_mask[0] = 0x0F;
- sensor.read_evt_mask[1] = 0x01;
-
- // Device ID string
- // Type - 0xC0: ASCII, Length - 12
- sensor.str_type_len = 0xC0 + 3;
- strncpy(sensor.str, "WDT", 3);
-
- // Add this sensor to the global table
- if (g_sensor_disc.num >= SENSOR_DISC_MAX) {
- syslog(LOG_ALERT, "populate_disc_sensors: num exceeded\n");
- return;
- }
-
- memcpy(&g_sensor_disc.sensor[g_sensor_disc.num], &sensor, sizeof(sensor_disc_t));
-
- g_sensor_disc.num++;
-
-
- // Sensor Chassis Pwr Sts
- // Sensor# 0x70
- // EntitiyId# 0x15, EntityInst# 0x00
- // Sensor Type# OEM: 0xC8
- // Event Read/Type# Sensor Specific: 0x6F
- sensor.owner= BMC_SLAVE_ADDR;
- sensor.lun = 0x00;
- sensor.sensor_num = 0x70;
-
- sensor.ent_id = 0x15;
- sensor.ent_inst = 0x00;
- // Enable Scanning, Enable Events
- sensor.sensor_init = 0x63;
- // Supports Auto Re-Arm
- sensor.sensor_caps = 0x40;
- sensor.sensor_type = 0xC8;
- sensor.evt_read_type = 0x6F;
- // 6 bits for pwroff, pwrcycle, pwron, softdown, ac-lost, hard-reset
- sensor.assert_evt_mask[0] = 0x3F;
- sensor.deassert_evt_mask[0] = 0x00;
- sensor.read_evt_mask[0] = 0x3F;
-
- // Device ID string
- // Type - 0xC0: ASCII, Length - 12
- sensor.str_type_len = 0xC0 + 13;
- strncpy(sensor.str, "CH-Pwr-Status", 13);
-
- // Add this sensor to the global table
- if (g_sensor_disc.num >= SENSOR_DISC_MAX) {
- syslog(LOG_ALERT, "populate_disc_sensors: num exceeded\n");
- return;
- }
-
- memcpy(&g_sensor_disc.sensor[g_sensor_disc.num], &sensor, sizeof(sensor_disc_t));
-
- g_sensor_disc.num++;
-
- // Sensor CPU DIMM Hot
- // Sensor# 0xB3
- // EntitiyId# 0xD0, EntityInst# 0x05
- // Sensor Type# OEM 0xC6
- // Event Read/Type# Sensor Specific 6Fh
- sensor.owner= BMC_SLAVE_ADDR;
- sensor.lun = 0x00;
- sensor.sensor_num = 0xB3;
-
- sensor.ent_id = 0xD0;
- sensor.ent_inst = 0x05;
- // Enable Scanning, Enable Events
- sensor.sensor_init = 0x63;
- // Supports Auto Re-Arm
- sensor.sensor_caps = 0x40;
- sensor.sensor_type = 0xC6;
- sensor.evt_read_type = 0x6F;
- // Two bits for CPU Hot, DIMM Hot
- sensor.assert_evt_mask[0] = 0x05;
- sensor.deassert_evt_mask[0] = 0x05;
- sensor.read_evt_mask[0] = 0x05;
-
- // Device ID string
- // Type - 0xC0: ASCII, Length - 12
- sensor.str_type_len = 0xC0 + 12;
- strncpy(sensor.str, "CPU_DIMM_HOT", 12);
-
- // Add this sensor to the global table
- if (g_sensor_disc.num >= SENSOR_DISC_MAX) {
- syslog(LOG_ALERT, "populate_disc_sensors: num exceeded\n");
- return;
- }
-
- memcpy(&g_sensor_disc.sensor[g_sensor_disc.num], &sensor, sizeof(sensor_disc_t));
-
- g_sensor_disc.num++;
-
- // Sensor PMBus Status Word Low
- // Sensor PMBus Status Word High
- // Sensor PMBus Status MFR
- // Sensor PMBus Status Input
- // Sensor NTP Status
- // Sensor# 0xED
- // EntitiyId# 0x35, EntityInst# 0x00
- // Sensor Type# OEM 0xC7
- // Event Read/Type# Sensor Specific 6Fh
- sensor.owner= BMC_SLAVE_ADDR;
- sensor.lun = 0x00;
- sensor.sensor_num = 0xED;
-
- sensor.ent_id = 0x35;
- sensor.ent_inst = 0x00;
- // Enable Scanning, Enable Events
- sensor.sensor_init = 0x63;
- // Supports Auto Re-Arm
- sensor.sensor_caps = 0x40;
- sensor.sensor_type = 0xC7;
- sensor.evt_read_type = 0x6F;
- // 1-bit for date/time sync failed
- sensor.assert_evt_mask[0] = 0x01;
- sensor.deassert_evt_mask[0] = 0x00;
- sensor.read_evt_mask[0] = 0x01;
-
- // Device ID string
- // Type - 0xC0: ASCII, Length - 10
- sensor.str_type_len = 0xC0 + 12;
- strncpy(sensor.str, "NTP-Status", 10);
-
- // Add this sensor to the global table
- if (g_sensor_disc.num >= SENSOR_DISC_MAX) {
- syslog(LOG_ALERT, "populate_disc_sensors: num exceeded\n");
- return;
- }
-
- memcpy(&g_sensor_disc.sensor[g_sensor_disc.num], &sensor, sizeof(sensor_disc_t));
-
- g_sensor_disc.num++;
-
- return;
-}
-
-// Access functions for Sensor Table
-void
-plat_sensor_mgmt_info(int *p_num, sensor_mgmt_t **p_sensor) {
- *p_num = g_sensor_mgmt.num;
- *p_sensor = g_sensor_mgmt.sensor;
-}
-
-void
-plat_sensor_disc_info(int *p_num, sensor_disc_t **p_sensor) {
- *p_num = g_sensor_disc.num;
- *p_sensor = g_sensor_disc.sensor;
-}
-
-void
-plat_sensor_thresh_info(int *p_num, sensor_thresh_t **p_sensor) {
- *p_num = g_sensor_thresh.num;
- *p_sensor = g_sensor_thresh.sensor;
-}
-
-void
-plat_sensor_oem_info(int *p_num, sensor_oem_t **p_sensor) {
- *p_num = g_sensor_oem.num;
- *p_sensor = g_sensor_oem.sensor;
-}
-
-// Initialize Sensor Table
-int
-plat_sensor_init(void) {
-
- // Populate all Sensors
- populate_mgmt_sensors();
- populate_disc_sensors();
-
- return 0;
-}
diff --git a/meta-facebook/meta-wedge/recipes-wedge/ipmid/files/setup-ipmid.sh b/meta-facebook/meta-wedge/recipes-wedge/ipmid/files/setup-ipmid.sh
deleted file mode 100644
index b724d70..0000000
--- a/meta-facebook/meta-wedge/recipes-wedge/ipmid/files/setup-ipmid.sh
+++ /dev/null
@@ -1,32 +0,0 @@
-#!/bin/sh
-#
-# Copyright 2014-present Facebook. All Rights Reserved.
-#
-# This program file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program in a file named COPYING; if not, write to the
-# Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor,
-# Boston, MA 02110-1301 USA
-#
-
-### BEGIN INIT INFO
-# Provides: setup-ipmid
-# Required-Start:
-# Required-Stop:
-# Default-Start: S
-# Default-Stop:
-# Short-Description: Set IPMI Message handler
-### END INIT INFO
-
-echo -n "Setup IPMI message handler... "
-/usr/local/bin/ipmid
-echo "done."
diff --git a/meta-facebook/meta-wedge/recipes-wedge/ipmid/ipmid_0.1.bb b/meta-facebook/meta-wedge/recipes-wedge/ipmid/ipmid_0.1.bb
deleted file mode 100644
index 7d8fd37..0000000
--- a/meta-facebook/meta-wedge/recipes-wedge/ipmid/ipmid_0.1.bb
+++ /dev/null
@@ -1,69 +0,0 @@
-# Copyright 2014-present Facebook. All Rights Reserved.
-#
-# This program file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program in a file named COPYING; if not, write to the
-# Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor,
-# Boston, MA 02110-1301 USA
-
-SUMMARY = "IPMI Daemon"
-DESCRIPTION = "Daemon to handle IPMI Messages."
-SECTION = "base"
-PR = "r1"
-LICENSE = "GPLv2"
-LIC_FILES_CHKSUM = "file://ipmid.c;beginline=8;endline=20;md5=da35978751a9d71b73679307c4d296ec"
-
-
-DEPENDS_append = "libwedge-eeprom update-rc.d-native"
-
-SRC_URI = "file://Makefile \
- file://setup-ipmid.sh \
- file://ipmid.c \
- file://platform/timestamp.c \
- file://platform/timestamp.h \
- file://platform/sel.c \
- file://platform/sel.h \
- file://platform/sdr.c \
- file://platform/sdr.h \
- file://platform/sensor.h \
- file://platform/fruid.h \
- file://platform/wedge/sensor.c \
- file://platform/wedge/fruid.c \
- "
-
-S = "${WORKDIR}"
-
-binfiles = "ipmid"
-
-pkgdir = "ipmid"
-
-do_install() {
- dst="${D}/usr/local/fbpackages/${pkgdir}"
- bin="${D}/usr/local/bin"
- install -d $dst
- install -d $bin
- install -m 755 ipmid ${dst}/ipmid
- ln -snf ../fbpackages/${pkgdir}/ipmid ${bin}/ipmid
- install -d ${D}${sysconfdir}/init.d
- install -d ${D}${sysconfdir}/rcS.d
- install -m 755 setup-ipmid.sh ${D}${sysconfdir}/init.d/setup-ipmid.sh
- update-rc.d -r ${D} setup-ipmid.sh start 64 S .
-}
-
-FBPACKAGEDIR = "${prefix}/local/fbpackages"
-
-FILES_${PN} = "${FBPACKAGEDIR}/ipmid ${prefix}/local/bin ${sysconfdir} "
-
-# Inhibit complaints about .debug directories for the fand binary:
-
-INHIBIT_PACKAGE_DEBUG_SPLIT = "1"
-INHIBIT_PACKAGE_STRIP = "1"
diff --git a/meta-facebook/meta-wedge/recipes-wedge/lm_sensors/files/wedge.conf b/meta-facebook/meta-wedge/recipes-wedge/lm_sensors/files/wedge.conf
deleted file mode 100644
index 266a695..0000000
--- a/meta-facebook/meta-wedge/recipes-wedge/lm_sensors/files/wedge.conf
+++ /dev/null
@@ -1,77 +0,0 @@
-
-bus "i2c-3" "ast_i2c.3"
-
-bus "i2c-4" "ast_i2c.4"
-
-bus "i2c-6" "ast_i2c.6"
-
-chip "tmp75-i2c-3-48"
- label temp1 "Inlet Temp"
- set temp1_max 70
- set temp1_max_hyst 60
-
-chip "tmp75-i2c-3-49"
- label temp1 "Switch Temp"
- set temp1_max 70
- set temp1_max_hyst 60
-
-chip "tmp75-i2c-3-4a"
- label temp1 "Outlet Temp"
- set temp1_max 70
- set temp1_max_hyst 60
-
-chip "tmp75-i2c-4-4c"
- label temp1 "Microserver Ambient Temp"
-
-chip "max127-i2c-6-28"
- label in0 "+1 Voltage"
- label in1 "+2.5 Voltage"
- ignore in2
- label in3 "+1 Voltage"
- ignore in4
- label in5 "+3.3 Voltage"
- label in6 "+5 Voltage"
- ignore in7
-
-chip "ast_pwm-*"
- label fan1 "Fan 2 front"
- label fan2 "Fan 3 front"
- label fan3 "Fan 1 front"
- label fan4 "Fan 0 front"
- label fan5 "Fan 2 rear"
- label fan6 "Fan 3 rear"
- label fan7 "Fan 1 rear"
- label fan8 "Fan 0 rear"
- ignore fan9
- ignore fan10
- ignore fan11
- ignore fan12
- ignore fan13
- ignore fan14
- ignore fan15
- ignore fan16
-
-chip "fb_panther_plus-*"
- label temp1 "CPU Temp"
- label temp2 "DIMM0 Temp"
- ignore temp3
- ignore temp4
- ignore temp5
-
-chip "ast_adc-isa-0000"
- ignore in0
- ignore in1
- ignore in2
- ignore in3
- ignore in4
- label in5 "+1 Core Voltage"
- label in6 "+1 Analog Voltage"
- label in7 "+5 Voltage"
- label in8 "+3.3 Voltage"
- label in9 "+2.5 Voltage"
- ignore in10
- ignore in11
- ignore in12
- ignore in13
- ignore in14
- ignore in15
diff --git a/meta-facebook/meta-wedge/recipes-wedge/lm_sensors/lmsensors_%.bbappend b/meta-facebook/meta-wedge/recipes-wedge/lm_sensors/lmsensors_%.bbappend
deleted file mode 100644
index 90a3954..0000000
--- a/meta-facebook/meta-wedge/recipes-wedge/lm_sensors/lmsensors_%.bbappend
+++ /dev/null
@@ -1,14 +0,0 @@
-
-FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
-
-SRC_URI += "file://wedge.conf \
- "
-
-do_install_board_config() {
- install -d ${D}${sysconfdir}/sensors.d
- install -m 644 ../wedge.conf ${D}${sysconfdir}/sensors.d/wedge.conf
-}
-
-do_install_append() {
- do_install_board_config
-}
diff --git a/meta-facebook/meta-wedge/recipes-wedge/oob-nic/oob-nic/src/Makefile b/meta-facebook/meta-wedge/recipes-wedge/oob-nic/oob-nic/src/Makefile
deleted file mode 100644
index 00464e5..0000000
--- a/meta-facebook/meta-wedge/recipes-wedge/oob-nic/oob-nic/src/Makefile
+++ /dev/null
@@ -1,29 +0,0 @@
-# Copyright 2014-present Facebook. All Rights Reserved.
-#
-# This program file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program in a file named COPYING; if not, write to the
-# Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor,
-# Boston, MA 02110-1301 USA
-
-all: oob-nic i2craw
-
-oob-nic: main.o nic.o intf.o ll_map.o libnetlink.o
- $(CC) -o $@ $^ $(LDFLAGS) -lwedge_eeprom
-
-i2craw: i2craw.o
- $(CC) -o $@ $^ $(LDFLAGS)
-
-.PHONY: clean
-
-clean:
- rm -rf *.o oob-nic i2craw
diff --git a/meta-facebook/meta-wedge/recipes-wedge/oob-nic/oob-nic/src/README b/meta-facebook/meta-wedge/recipes-wedge/oob-nic/oob-nic/src/README
deleted file mode 100644
index f46971f..0000000
--- a/meta-facebook/meta-wedge/recipes-wedge/oob-nic/oob-nic/src/README
+++ /dev/null
@@ -1,10 +0,0 @@
-
-TODO:
-
-1. Currently, we poll the SMbus instead of rely on the ALERT. The kernel does not handle the ALERT either other than just a print out.
-
-2. Maximum fragment is 32
-
-3. We use libnetlink for bring interface up and setting MAC. That increases the binary by about 50k and also we copied about 5 files from iproute2 here for that. We might be able to get away this by using some non-iproute2 API
-
-4. The dependency in the Makefile does not consider .h
diff --git a/meta-facebook/meta-wedge/recipes-wedge/oob-nic/oob-nic/src/etc/oob-nic.sh b/meta-facebook/meta-wedge/recipes-wedge/oob-nic/oob-nic/src/etc/oob-nic.sh
deleted file mode 100644
index 7eaf581..0000000
--- a/meta-facebook/meta-wedge/recipes-wedge/oob-nic/oob-nic/src/etc/oob-nic.sh
+++ /dev/null
@@ -1,101 +0,0 @@
-#! /bin/sh
-#
-# Copyright 2014-present Facebook. All Rights Reserved.
-#
-# This program file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program in a file named COPYING; if not, write to the
-# Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor,
-# Boston, MA 02110-1301 USA
-#
-
-### BEGIN INIT INFO
-# Provides: oob-nic
-# Required-Start:
-# Required-Stop:
-# Default-Start: S
-# Default-Stop: 0 6
-# Short-Description: One of the first scripts to be executed. Starts or stops
-# the OOB NIC.
-#
-### END INIT INFO
-
-PATH=/sbin:/bin:/usr/sbin:/usr/bin
-DAEMON=/usr/sbin/oob-nic
-NAME=oob-nic
-DESC="OOB NIC Driver"
-
-# source function library
-. /etc/init.d/functions
-
-test -f $DAEMON || exit 0
-
-# enable the isolation buffer
-. /usr/local/bin/openbmc-utils.sh
-
-fix_etc_interfaces() {
- local intf_conf board_rev board_type enable_oob
- if wedge_should_enable_oob; then
- intf_conf="/etc/network/interfaces"
- if ! grep oob $intf_conf > /dev/null 2>&1; then
- echo >> $intf_conf
- echo "auto oob" >> $intf_conf
- echo "iface oob inet dhcp" >> $intf_conf
- fi
- fi
-}
-
-STOPPER=
-ACTION="$1"
-
-case "$ACTION" in
- start)
- echo -n "Starting $DESC: "
- if [ ! -d /dev/net ]
- then
- mkdir /dev/net
- fi
- if [ ! -f /dev/net/tun ]
- then
- mknod /dev/net/tun c 10 200
- chmod 666 /dev/net/tun
- fi
- fix_etc_interfaces
- $DAEMON > /dev/null 2>&1 &
- echo "$NAME."
- ;;
- stop)
- echo -n "Stopping $DESC: "
- start-stop-daemon --stop --quiet --exec $DAEMON
- echo "$NAME."
- ;;
- restart|force-reload)
- echo -n "Restarting $DESC: "
- start-stop-daemon --stop --quiet --exec $DAEMON
- sleep 1
- fix_etc_interfaces
- $DAEMON > /dev/null 2>&1 &
- echo "$NAME."
- ;;
- status)
- status $DAEMON
- exit $?
- ;;
- *)
- N=${0##*/}
- N=${N#[SK]??}
- echo "Usage: $N {start|stop|status|restart|force-reload}" >&2
- exit 1
- ;;
-esac
-
-exit 0
diff --git a/meta-facebook/meta-wedge/recipes-wedge/oob-nic/oob-nic/src/hlist.h b/meta-facebook/meta-wedge/recipes-wedge/oob-nic/oob-nic/src/hlist.h
deleted file mode 100644
index 5e89765..0000000
--- a/meta-facebook/meta-wedge/recipes-wedge/oob-nic/oob-nic/src/hlist.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Note: Original file from iproute2 package
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-#ifndef __HLIST_H__
-#define __HLIST_H__ 1
-/* Hash list stuff from kernel */
-
-#include <stddef.h>
-
-#define container_of(ptr, type, member) ({ \
- const typeof( ((type *)0)->member ) *__mptr = (ptr); \
- (type *)( (char *)__mptr - offsetof(type,member) );})
-
-struct hlist_head {
- struct hlist_node *first;
-};
-
-struct hlist_node {
- struct hlist_node *next, **pprev;
-};
-
-static inline void hlist_del(struct hlist_node *n)
-{
- struct hlist_node *next = n->next;
- struct hlist_node **pprev = n->pprev;
- *pprev = next;
- if (next)
- next->pprev = pprev;
-}
-
-static inline void hlist_add_head(struct hlist_node *n, struct hlist_head *h)
-{
- struct hlist_node *first = h->first;
- n->next = first;
- if (first)
- first->pprev = &n->next;
- h->first = n;
- n->pprev = &h->first;
-}
-
-#define hlist_for_each(pos, head) \
- for (pos = (head)->first; pos ; pos = pos->next)
-
-
-#define hlist_for_each_safe(pos, n, head) \
- for (pos = (head)->first; pos && ({ n = pos->next; 1; }); \
- pos = n)
-
-#define hlist_entry_safe(ptr, type, member) \
- ({ typeof(ptr) ____ptr = (ptr); \
- ____ptr ? hlist_entry(____ptr, type, member) : NULL; \
- })
-
-#define hlist_for_each_entry(pos, head, member) \
- for (pos = hlist_entry_safe((head)->first, typeof(*(pos)), member);\
- pos; \
- pos = hlist_entry_safe((pos)->member.next, typeof(*(pos)), member))
-
-#endif /* __HLIST_H__ */
diff --git a/meta-facebook/meta-wedge/recipes-wedge/oob-nic/oob-nic/src/i2craw.c b/meta-facebook/meta-wedge/recipes-wedge/oob-nic/oob-nic/src/i2craw.c
deleted file mode 100644
index 83f03b7..0000000
--- a/meta-facebook/meta-wedge/recipes-wedge/oob-nic/oob-nic/src/i2craw.c
+++ /dev/null
@@ -1,245 +0,0 @@
-/*
- * Copyright 2004-present Facebook. All Rights Reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-#include <errno.h>
-#include <fcntl.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/ioctl.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <unistd.h>
-#include <stdint.h>
-
-#include "facebook/i2c-dev.h"
-#include "openbmc/log.h"
-
-void usage(const char *prog) {
- printf("Usage: %s [options] <bus number> <slave address>\n", prog);
- printf("\n Options:\n"
- "\n\t-w 'bytes to write':\n"
- "\t\t i2c write\n"
- "\n\t-r <number of bytes to read>:\n"
- "\t\t if 0 is provided, the first byte of read is used to determine\n"
- "\t\t how many bytes more to read\n"
- "\n\t-p:\n"
- "\t\t Use PEC\n"
- "\n\t-h:\n"
- "\t\t Print this help\n"
- "\n Note: if both '-w' and '-r' are specified, write will be"
- "\n performed first, followed by read\n");
-}
-
-#define MAX_BYTES 255
-
-int g_use_pec = 0;
-int g_has_write = 0;
-int g_n_write = 0;
-uint8_t g_write_bytes[MAX_BYTES];
-int g_has_read = 0;
-int g_n_read = -1;
-uint8_t g_read_bytes[MAX_BYTES];
-uint8_t g_bus = -1;
-uint8_t g_slave_addr = 0xff;
-
-static int parse_byte_string(const char *str) {
- const char *startptr = str;
- char *endptr;
- int total = 0;
- unsigned long val;
-
- do {
- val = strtoul(startptr, &endptr, 0);
- if (startptr == endptr) {
- printf("'%s' is invalid\n", str);
- return -1;
- }
- if (val > MAX_BYTES) {
- printf("'%s' is invalid\n", str);
- return -1;
- }
- g_write_bytes[total++] = val;
- if (*endptr == '\0') {
- break;
- }
- if (total >= MAX_BYTES) {
- printf("'%s' is invalid\n", str);
- return -1;
- }
- startptr = endptr;
- } while(1);
-
- return total;
-}
-
-static int i2c_open() {
- int fd;
- char fn[32];
- int rc;
-
- snprintf(fn, sizeof(fn), "/dev/i2c-%d", g_bus);
- fd = open(fn, O_RDWR);
- if (fd == -1) {
- LOG_ERR(errno, "Failed to open i2c device %s", fn);
- return -1;
- }
-
- rc = ioctl(fd, I2C_SLAVE, g_slave_addr);
- if (rc < 0) {
- LOG_ERR(errno, "Failed to open slave @ address 0x%x", g_slave_addr);
- close(fd);
- }
-
- return fd;
-}
-
-static int i2c_io(int fd) {
- struct i2c_rdwr_ioctl_data data;
- struct i2c_msg msg[2];
- int n_msg = 0;
- int rc;
-
- memset(&msg, 0, sizeof(msg));
-
- if (g_has_write) {
- msg[n_msg].addr = g_slave_addr;
- msg[n_msg].flags = (g_use_pec) ? I2C_CLIENT_PEC : 0;
- msg[n_msg].len = g_n_write;
- msg[n_msg].buf = g_write_bytes;
- n_msg++;
- }
-
- if (g_has_read) {
- msg[n_msg].addr = g_slave_addr;
- msg[n_msg].flags = I2C_M_RD
- | ((g_use_pec) ? I2C_CLIENT_PEC : 0)
- | ((g_n_read == 0) ? I2C_M_RECV_LEN : 0);
- /*
- * In case of g_n_read is 0, block length will be added by
- * the underlying bus driver.
- */
- msg[n_msg].len = (g_n_read) ? g_n_read : 256;
- msg[n_msg].buf = g_read_bytes;
- if (g_n_read == 0) {
- /* If we're using variable length block reads, we have to set the
- * first byte of the buffer to at least one or the kernel complains.
- */
- g_read_bytes[0] = 1;
- }
- n_msg++;
- }
-
- data.msgs = msg;
- data.nmsgs = n_msg;
-
- rc = ioctl(fd, I2C_RDWR, &data);
- if (rc < 0) {
- LOG_ERR(errno, "Failed to do raw io");
- return -1;
- }
-
- return 0;
-}
-
-int main(int argc, char * const argv[]) {
- int i;
- int fd;
- int opt;
- while ((opt = getopt(argc, argv, "hpw:r:")) != -1) {
- switch (opt) {
- case 'h':
- usage(argv[0]);
- return 0;
- case 'p':
- g_use_pec = 1;
- break;
- case 'w':
- g_has_write = 1;
- if ((g_n_write = parse_byte_string(optarg)) <= 0) {
- usage(argv[0]);
- return -1;
- }
- break;
- case 'r':
- g_has_read = 1;
- g_n_read = atoi(optarg);
- break;
- default:
- usage(argv[0]);
- return -1;
- }
- }
-
- /* make sure we still have arguments for bus and slave address */
- if (optind + 2 != argc) {
- printf("Bus or slave address is missing\n");
- usage(argv[0]);
- return -1;
- }
-
- g_bus = atoi(argv[optind]);
- g_slave_addr = strtoul(argv[optind + 1], NULL, 0);
- if ((g_slave_addr & 0x80)) {
- printf("Slave address must be 7-bit\n");
- return -1;
- }
-
- if (!g_has_write && !g_has_read) {
- /* by default, read, first byte read is the length */
- g_has_read = 1;
- g_n_read = 0;
- }
-
- printf("Bus: %d\nDevice address: 0x%x\n", g_bus, g_slave_addr);
- if (g_has_write) {
- printf("To write %d bytes:", g_n_write);
- for (i = 0; i < g_n_write; i++) {
- printf(" 0x%x", g_write_bytes[i]);
- }
- printf("\n");
- }
- if (g_has_read) {
- if (g_n_read) {
- printf("To read %d bytes.\n", g_n_read);
- } else {
- printf("To read data.\n");
- }
- }
-
- fd = i2c_open();
- if (fd < 0) {
- return -1;
- }
-
- if (i2c_io(fd) < 0) {
- return -1;
- }
-
- if (g_has_read) {
- printf("Received:\n ");
- if (g_n_read == 0) {
- g_n_read = g_read_bytes[0] + 1;
- }
- for (i = 0; i < g_n_read; i++) {
- printf(" 0x%x", g_read_bytes[i]);
- }
- printf("\n");
- }
-
- return 0;
-}
diff --git a/meta-facebook/meta-wedge/recipes-wedge/oob-nic/oob-nic/src/intf.c b/meta-facebook/meta-wedge/recipes-wedge/oob-nic/oob-nic/src/intf.c
deleted file mode 100644
index 81834b9..0000000
--- a/meta-facebook/meta-wedge/recipes-wedge/oob-nic/oob-nic/src/intf.c
+++ /dev/null
@@ -1,254 +0,0 @@
-/*
- * Copyright 2014-present Facebook. All Rights Reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-
-#include "intf.h"
-
-#include <errno.h>
-#include <fcntl.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-#include <sys/ioctl.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <linux/rtnetlink.h>
-#include <linux/if.h>
-#include <linux/if_tun.h>
-#include <linux/fib_rules.h>
-
-#include "openbmc/log.h"
-#include "libnetlink.h"
-#include "ll_map.h"
-
-struct oob_intf_t {
- char oi_name[32];
- int oi_fd;
- int oi_ifidx;
- uint8_t oi_mac[6];
- struct rtnl_handle oi_rth;
-};
-
-#define TUN_DEVICE "/dev/net/tun"
-
-static int oob_intf_set_mac(oob_intf *intf, const uint8_t mac[6]) {
- int rc;
- struct {
- struct nlmsghdr n;
- struct ifinfomsg ifi;
- char buf[256];
- } req;
-
- memset(&req, 0, sizeof(req));
- req.n.nlmsg_len = NLMSG_LENGTH(sizeof(struct ifinfomsg));
- req.n.nlmsg_type = RTM_NEWLINK;
- req.n.nlmsg_flags = NLM_F_REQUEST;
- req.ifi.ifi_family = AF_UNSPEC;
- req.ifi.ifi_index = intf->oi_ifidx;
- memcpy(intf->oi_mac, mac, sizeof(intf->oi_mac));
- addattr_l(&req.n, sizeof(req), IFLA_ADDRESS,
- intf->oi_mac, sizeof(intf->oi_mac));
- rc = rtnl_talk(&intf->oi_rth, &req.n, 0, 0, NULL);
- if (rc < 0) {
- rc = errno;
- LOG_ERR(rc, "Failed to set mac to interface %s @ index %d",
- intf->oi_name, intf->oi_ifidx);
- return -rc;
- }
-
- LOG_INFO("Set interface %s @ index %d mac to %x:%x:%x:%x:%x:%x",
- intf->oi_name, intf->oi_ifidx,
- intf->oi_mac[0], intf->oi_mac[1], intf->oi_mac[2],
- intf->oi_mac[3], intf->oi_mac[4], intf->oi_mac[5]);
-
- return 0;
-}
-
-static int oob_intf_bring_up(oob_intf *intf) {
- int rc;
- struct {
- struct nlmsghdr n;
- struct ifinfomsg ifi;
- char buf[256];
- } req;
-
- memset(&req, 0, sizeof(req));
- req.n.nlmsg_len = NLMSG_LENGTH(sizeof(struct ifinfomsg));
- req.n.nlmsg_type = RTM_NEWLINK;
- req.n.nlmsg_flags = NLM_F_REQUEST;
- req.ifi.ifi_family = AF_UNSPEC;
- req.ifi.ifi_change |= IFF_UP;
- req.ifi.ifi_flags |= IFF_UP;
- req.ifi.ifi_index = intf->oi_ifidx;
- rc = rtnl_talk(&intf->oi_rth, &req.n, 0, 0, NULL);
- if (rc < 0) {
- rc = errno;
- LOG_ERR(rc, "Failed to bring up interface %s @ index %d",
- intf->oi_name, intf->oi_ifidx);
- return -rc;
- }
-
- LOG_INFO("Brought up interface %s @ index %d", intf->oi_name, intf->oi_ifidx);
-
- return 0;
-}
-
-oob_intf* oob_intf_create(const char *name, const uint8_t mac[6]) {
-
- int rc;
- int flags;
- struct ifreq ifr;
- oob_intf *intf = NULL;
-
-#define _CHECK_RC(fmt, ...) do { \
- if (rc < 0) { \
- rc = errno; \
- LOG_ERR(rc, fmt, ##__VA_ARGS__); \
- goto err_out; \
- } \
-} while(0)
-
- intf = malloc(sizeof(*intf));
- if (!intf) {
- rc = ENOMEM;
- LOG_ERR(rc, "Failed to allocate memory for interface");
- goto err_out;
- }
- memset(intf, 0, sizeof(*intf));
- strncpy(intf->oi_name, name, sizeof(intf->oi_name));
- intf->oi_name[sizeof(intf->oi_name) - 1] = '\0';
- intf->oi_fd = -1;
-
- rc = rtnl_open(&intf->oi_rth, 0);
- _CHECK_RC("Failed to open rth_handler");
-
- rc = open(TUN_DEVICE, O_RDWR);
- _CHECK_RC("Failed to open %s", TUN_DEVICE);
- intf->oi_fd = rc;
-
- memset(&ifr, 0, sizeof(ifr));
- /*
- * IFF_TAP: TAP interface
- * IFF_NO_PI: Do not provide pracket information
- */
- ifr.ifr_flags = IFF_TAP|IFF_NO_PI;
- strncpy(ifr.ifr_name, name, sizeof(ifr.ifr_name));
- ifr.ifr_name[sizeof(ifr.ifr_name) - 1] = '\0';
-
- rc = ioctl(intf->oi_fd, TUNSETIFF, (void *) &ifr);
- _CHECK_RC("Failed to create tap interface %s", ifr.ifr_name);
-
- /* make fd non-blocking */
- rc = fcntl(intf->oi_fd, F_GETFL);
- _CHECK_RC("Failed to get flags from fd ", intf->oi_fd);
- flags = rc | O_NONBLOCK;
- rc = fcntl(intf->oi_fd, F_SETFL, rc);
- _CHECK_RC("Failed to set non-blocking flags ", flags,
- " to fd ", intf->oi_fd);
-
- /* set CLOEXEC */
- rc = fcntl(intf->oi_fd, F_GETFD);
- _CHECK_RC("Failed to get flags from fd ", intf->oi_fd);
- flags = rc | FD_CLOEXEC;
- rc = fcntl(intf->oi_fd, F_SETFD, flags);
- _CHECK_RC("Failed to set close-on-exec flags ", flags,
- " to fd ", intf->oi_fd);
-
- // TODO: if needed, we can adjust send buffer size, TUNSETSNDBUF
- intf->oi_ifidx = ll_name_to_index(intf->oi_name);
-
- /* now set the mac address */
- oob_intf_set_mac(intf, mac);
-
-#if 0
- /* make it persistent */
- rc = ioctl(intf->oi_fd, TUNSETPERSIST, 0);
- _CHECK_RC("Failed to make the tap interface %s persistent", intf->oi_name);
-#endif
-
- LOG_INFO("Create/attach to tap interface %s @ fd %d, index %d",
- intf->oi_name, intf->oi_fd, intf->oi_ifidx);
-
- //oob_intf_bring_up(intf);
-
- return intf;
-
- err_out:
- if (intf) {
- rtnl_close(&intf->oi_rth);
- if (intf->oi_fd != -1) {
- close(intf->oi_fd);
- }
- free(intf);
- }
-
- return NULL;
-}
-
-int oob_intf_get_fd(const oob_intf *intf) {
- return intf->oi_fd;
-}
-
-int oob_intf_receive(const oob_intf *intf, char *buf, int len) {
- int rc;
- do {
- rc = read(intf->oi_fd, buf, len);
- } while (rc == -1 && errno == EINTR);
- if (rc < 0) {
- rc = errno;
- if (rc != EAGAIN) {
- LOG_ERR(rc, "Failed to read on interface fd %d", intf->oi_fd);
- return -rc;
- } else {
- /* nothing is available */
- return 0;
- }
- } else if (rc == 0) {
- // Nothing to read. It shall not happen as the fd is non-blocking.
- // Just add this case to be safe.
- return 0;
- } else if (rc > len) {
- // The pkt is larger than the buffer. We don't have complete packet.
- // It shall not happen unless the MTU is mis-match. Drop the packet.
- LOG_ERR(ENOSPC, "Received a too large packet (%d bytes > %d) from the "
- "tap interface. Drop it...", rc, len);
- return -ENOSPC;
- } else {
- LOG_VER("Recv a packet of %d bytes from %s", rc, intf->oi_name);
- return rc;
- }
-}
-
-int oob_intf_send(const oob_intf *intf, const char *buf, int len) {
- int rc;
- do {
- rc = write(intf->oi_fd, buf, len);
- } while (rc == -1 && errno == EINTR);
- if (rc < 0) {
- rc = errno;
- LOG_ERR(rc, "Failed to send on interface fd %d", intf->oi_fd);
- return -rc;
- } else if (rc < len) {
- LOG_ERR(EIO, "Failed to send the full packet (%d bytes > %d) for fd %d",
- len, rc, intf->oi_fd);
- return -EIO;
- } else {
- LOG_VER("Sent a packet of %d bytes to %s", rc, intf->oi_name);
- return rc;
- }
-}
diff --git a/meta-facebook/meta-wedge/recipes-wedge/oob-nic/oob-nic/src/intf.h b/meta-facebook/meta-wedge/recipes-wedge/oob-nic/oob-nic/src/intf.h
deleted file mode 100644
index 6ea7af1..0000000
--- a/meta-facebook/meta-wedge/recipes-wedge/oob-nic/oob-nic/src/intf.h
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Copyright 2014-present Facebook. All Rights Reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-#ifndef INTF_H
-#define INTF_H
-
-#include <stdint.h>
-
-typedef struct oob_intf_t oob_intf;
-
-oob_intf* oob_intf_create(const char *name, const uint8_t mac[6]);
-int oob_intf_get_fd(const oob_intf *intf);
-
-int oob_intf_receive(const oob_intf *intf, char *buf, int len);
-int oob_intf_send(const oob_intf *intf, const char *buf, int len);
-
-#endif
diff --git a/meta-facebook/meta-wedge/recipes-wedge/oob-nic/oob-nic/src/libnetlink.c b/meta-facebook/meta-wedge/recipes-wedge/oob-nic/oob-nic/src/libnetlink.c
deleted file mode 100644
index 019e2c8..0000000
--- a/meta-facebook/meta-wedge/recipes-wedge/oob-nic/oob-nic/src/libnetlink.c
+++ /dev/null
@@ -1,717 +0,0 @@
-/*
- * Note: Original file from iproute2 package
- *
- * libnetlink.c RTnetlink service routines.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version
- * 2 of the License, or (at your option) any later version.
- *
- * Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru>
- *
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <syslog.h>
-#include <fcntl.h>
-#include <net/if_arp.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <string.h>
-#include <errno.h>
-#include <time.h>
-#include <sys/uio.h>
-
-#include "libnetlink.h"
-
-int rcvbuf = 1024 * 1024;
-
-void rtnl_close(struct rtnl_handle *rth)
-{
- if (rth->fd >= 0) {
- close(rth->fd);
- rth->fd = -1;
- }
-}
-
-int rtnl_open_byproto(struct rtnl_handle *rth, unsigned subscriptions,
- int protocol)
-{
- socklen_t addr_len;
- int sndbuf = 32768;
-
- memset(rth, 0, sizeof(*rth));
-
- rth->fd = socket(AF_NETLINK, SOCK_RAW | SOCK_CLOEXEC, protocol);
- if (rth->fd < 0) {
- perror("Cannot open netlink socket");
- return -1;
- }
-
- if (setsockopt(rth->fd,SOL_SOCKET,SO_SNDBUF,&sndbuf,sizeof(sndbuf)) < 0) {
- perror("SO_SNDBUF");
- return -1;
- }
-
- if (setsockopt(rth->fd,SOL_SOCKET,SO_RCVBUF,&rcvbuf,sizeof(rcvbuf)) < 0) {
- perror("SO_RCVBUF");
- return -1;
- }
-
- memset(&rth->local, 0, sizeof(rth->local));
- rth->local.nl_family = AF_NETLINK;
- rth->local.nl_groups = subscriptions;
-
- if (bind(rth->fd, (struct sockaddr*)&rth->local, sizeof(rth->local)) < 0) {
- perror("Cannot bind netlink socket");
- return -1;
- }
- addr_len = sizeof(rth->local);
- if (getsockname(rth->fd, (struct sockaddr*)&rth->local, &addr_len) < 0) {
- perror("Cannot getsockname");
- return -1;
- }
- if (addr_len != sizeof(rth->local)) {
- fprintf(stderr, "Wrong address length %d\n", addr_len);
- return -1;
- }
- if (rth->local.nl_family != AF_NETLINK) {
- fprintf(stderr, "Wrong address family %d\n", rth->local.nl_family);
- return -1;
- }
- rth->seq = time(NULL);
- return 0;
-}
-
-int rtnl_open(struct rtnl_handle *rth, unsigned subscriptions)
-{
- return rtnl_open_byproto(rth, subscriptions, NETLINK_ROUTE);
-}
-
-int rtnl_wilddump_request(struct rtnl_handle *rth, int family, int type)
-{
- return rtnl_wilddump_req_filter(rth, family, type, RTEXT_FILTER_VF);
-}
-
-int rtnl_wilddump_req_filter(struct rtnl_handle *rth, int family, int type,
- __u32 filt_mask)
-{
- struct {
- struct nlmsghdr nlh;
- struct ifinfomsg ifm;
- /* attribute has to be NLMSG aligned */
- struct rtattr ext_req __attribute__ ((aligned(NLMSG_ALIGNTO)));
- __u32 ext_filter_mask;
- } req;
-
- memset(&req, 0, sizeof(req));
- req.nlh.nlmsg_len = sizeof(req);
- req.nlh.nlmsg_type = type;
- req.nlh.nlmsg_flags = NLM_F_DUMP|NLM_F_REQUEST;
- req.nlh.nlmsg_pid = 0;
- req.nlh.nlmsg_seq = rth->dump = ++rth->seq;
- req.ifm.ifi_family = family;
-
- req.ext_req.rta_type = IFLA_EXT_MASK;
- req.ext_req.rta_len = RTA_LENGTH(sizeof(__u32));
- req.ext_filter_mask = filt_mask;
-
- return send(rth->fd, (void*)&req, sizeof(req), 0);
-}
-
-int rtnl_send(struct rtnl_handle *rth, const void *buf, int len)
-{
- return send(rth->fd, buf, len, 0);
-}
-
-int rtnl_send_check(struct rtnl_handle *rth, const void *buf, int len)
-{
- struct nlmsghdr *h;
- int status;
- char resp[1024];
-
- status = send(rth->fd, buf, len, 0);
- if (status < 0)
- return status;
-
- /* Check for immediate errors */
- status = recv(rth->fd, resp, sizeof(resp), MSG_DONTWAIT|MSG_PEEK);
- if (status < 0) {
- if (errno == EAGAIN)
- return 0;
- return -1;
- }
-
- for (h = (struct nlmsghdr *)resp; NLMSG_OK(h, status);
- h = NLMSG_NEXT(h, status)) {
- if (h->nlmsg_type == NLMSG_ERROR) {
- struct nlmsgerr *err = (struct nlmsgerr*)NLMSG_DATA(h);
- if (h->nlmsg_len < NLMSG_LENGTH(sizeof(struct nlmsgerr)))
- fprintf(stderr, "ERROR truncated\n");
- else
- errno = -err->error;
- return -1;
- }
- }
-
- return 0;
-}
-
-int rtnl_dump_request(struct rtnl_handle *rth, int type, void *req, int len)
-{
- struct nlmsghdr nlh;
- struct sockaddr_nl nladdr = { .nl_family = AF_NETLINK };
- struct iovec iov[2] = {
- { .iov_base = &nlh, .iov_len = sizeof(nlh) },
- { .iov_base = req, .iov_len = len }
- };
- struct msghdr msg = {
- .msg_name = &nladdr,
- .msg_namelen = sizeof(nladdr),
- .msg_iov = iov,
- .msg_iovlen = 2,
- };
-
- nlh.nlmsg_len = NLMSG_LENGTH(len);
- nlh.nlmsg_type = type;
- nlh.nlmsg_flags = NLM_F_DUMP|NLM_F_REQUEST;
- nlh.nlmsg_pid = 0;
- nlh.nlmsg_seq = rth->dump = ++rth->seq;
-
- return sendmsg(rth->fd, &msg, 0);
-}
-
-int rtnl_dump_filter_l(struct rtnl_handle *rth,
- const struct rtnl_dump_filter_arg *arg)
-{
- struct sockaddr_nl nladdr;
- struct iovec iov;
- struct msghdr msg = {
- .msg_name = &nladdr,
- .msg_namelen = sizeof(nladdr),
- .msg_iov = &iov,
- .msg_iovlen = 1,
- };
- char buf[16384];
- int dump_intr = 0;
-
- iov.iov_base = buf;
- while (1) {
- int status;
- const struct rtnl_dump_filter_arg *a;
- int found_done = 0;
- int msglen = 0;
-
- iov.iov_len = sizeof(buf);
- status = recvmsg(rth->fd, &msg, 0);
-
- if (status < 0) {
- if (errno == EINTR || errno == EAGAIN)
- continue;
- fprintf(stderr, "netlink receive error %s (%d)\n",
- strerror(errno), errno);
- return -1;
- }
-
- if (status == 0) {
- fprintf(stderr, "EOF on netlink\n");
- return -1;
- }
-
- for (a = arg; a->filter; a++) {
- struct nlmsghdr *h = (struct nlmsghdr*)buf;
- msglen = status;
-
- while (NLMSG_OK(h, msglen)) {
- int err;
-
- if (nladdr.nl_pid != 0 ||
- h->nlmsg_pid != rth->local.nl_pid ||
- h->nlmsg_seq != rth->dump)
- goto skip_it;
-
- if (h->nlmsg_flags & NLM_F_DUMP_INTR)
- dump_intr = 1;
-
- if (h->nlmsg_type == NLMSG_DONE) {
- found_done = 1;
- break; /* process next filter */
- }
- if (h->nlmsg_type == NLMSG_ERROR) {
- struct nlmsgerr *err = (struct nlmsgerr*)NLMSG_DATA(h);
- if (h->nlmsg_len < NLMSG_LENGTH(sizeof(struct nlmsgerr))) {
- fprintf(stderr,
- "ERROR truncated\n");
- } else {
- errno = -err->error;
- perror("RTNETLINK answers");
- }
- return -1;
- }
- err = a->filter(&nladdr, h, a->arg1);
- if (err < 0)
- return err;
-
-skip_it:
- h = NLMSG_NEXT(h, msglen);
- }
- }
-
- if (found_done) {
- if (dump_intr)
- fprintf(stderr,
- "Dump was interrupted and may be inconsistent.\n");
- return 0;
- }
-
- if (msg.msg_flags & MSG_TRUNC) {
- fprintf(stderr, "Message truncated\n");
- continue;
- }
- if (msglen) {
- fprintf(stderr, "!!!Remnant of size %d\n", msglen);
- exit(1);
- }
- }
-}
-
-int rtnl_dump_filter(struct rtnl_handle *rth,
- rtnl_filter_t filter,
- void *arg1)
-{
- const struct rtnl_dump_filter_arg a[2] = {
- { .filter = filter, .arg1 = arg1, },
- { .filter = NULL, .arg1 = NULL, },
- };
-
- return rtnl_dump_filter_l(rth, a);
-}
-
-int rtnl_talk(struct rtnl_handle *rtnl, struct nlmsghdr *n, pid_t peer,
- unsigned groups, struct nlmsghdr *answer)
-{
- int status;
- unsigned seq;
- struct nlmsghdr *h;
- struct sockaddr_nl nladdr;
- struct iovec iov = {
- .iov_base = (void*) n,
- .iov_len = n->nlmsg_len
- };
- struct msghdr msg = {
- .msg_name = &nladdr,
- .msg_namelen = sizeof(nladdr),
- .msg_iov = &iov,
- .msg_iovlen = 1,
- };
- char buf[16384];
-
- memset(&nladdr, 0, sizeof(nladdr));
- nladdr.nl_family = AF_NETLINK;
- nladdr.nl_pid = peer;
- nladdr.nl_groups = groups;
-
- n->nlmsg_seq = seq = ++rtnl->seq;
-
- if (answer == NULL)
- n->nlmsg_flags |= NLM_F_ACK;
-
- status = sendmsg(rtnl->fd, &msg, 0);
-
- if (status < 0) {
- perror("Cannot talk to rtnetlink");
- return -1;
- }
-
- memset(buf,0,sizeof(buf));
-
- iov.iov_base = buf;
-
- while (1) {
- iov.iov_len = sizeof(buf);
- status = recvmsg(rtnl->fd, &msg, 0);
-
- if (status < 0) {
- if (errno == EINTR || errno == EAGAIN)
- continue;
- fprintf(stderr, "netlink receive error %s (%d)\n",
- strerror(errno), errno);
- return -1;
- }
- if (status == 0) {
- fprintf(stderr, "EOF on netlink\n");
- return -1;
- }
- if (msg.msg_namelen != sizeof(nladdr)) {
- fprintf(stderr, "sender address length == %d\n", msg.msg_namelen);
- exit(1);
- }
- for (h = (struct nlmsghdr*)buf; status >= sizeof(*h); ) {
- int len = h->nlmsg_len;
- int l = len - sizeof(*h);
-
- if (l < 0 || len>status) {
- if (msg.msg_flags & MSG_TRUNC) {
- fprintf(stderr, "Truncated message\n");
- return -1;
- }
- fprintf(stderr, "!!!malformed message: len=%d\n", len);
- exit(1);
- }
-
- if (nladdr.nl_pid != peer ||
- h->nlmsg_pid != rtnl->local.nl_pid ||
- h->nlmsg_seq != seq) {
- /* Don't forget to skip that message. */
- status -= NLMSG_ALIGN(len);
- h = (struct nlmsghdr*)((char*)h + NLMSG_ALIGN(len));
- continue;
- }
-
- if (h->nlmsg_type == NLMSG_ERROR) {
- struct nlmsgerr *err = (struct nlmsgerr*)NLMSG_DATA(h);
- if (l < sizeof(struct nlmsgerr)) {
- fprintf(stderr, "ERROR truncated\n");
- } else {
- if (!err->error) {
- if (answer)
- memcpy(answer, h, h->nlmsg_len);
- return 0;
- }
-
- fprintf(stderr, "RTNETLINK answers: %s\n", strerror(-err->error));
- errno = -err->error;
- }
- return -1;
- }
- if (answer) {
- memcpy(answer, h, h->nlmsg_len);
- return 0;
- }
-
- fprintf(stderr, "Unexpected reply!!!\n");
-
- status -= NLMSG_ALIGN(len);
- h = (struct nlmsghdr*)((char*)h + NLMSG_ALIGN(len));
- }
- if (msg.msg_flags & MSG_TRUNC) {
- fprintf(stderr, "Message truncated\n");
- continue;
- }
- if (status) {
- fprintf(stderr, "!!!Remnant of size %d\n", status);
- exit(1);
- }
- }
-}
-
-int rtnl_listen(struct rtnl_handle *rtnl,
- rtnl_filter_t handler,
- void *jarg)
-{
- int status;
- struct nlmsghdr *h;
- struct sockaddr_nl nladdr;
- struct iovec iov;
- struct msghdr msg = {
- .msg_name = &nladdr,
- .msg_namelen = sizeof(nladdr),
- .msg_iov = &iov,
- .msg_iovlen = 1,
- };
- char buf[8192];
-
- memset(&nladdr, 0, sizeof(nladdr));
- nladdr.nl_family = AF_NETLINK;
- nladdr.nl_pid = 0;
- nladdr.nl_groups = 0;
-
- iov.iov_base = buf;
- while (1) {
- iov.iov_len = sizeof(buf);
- status = recvmsg(rtnl->fd, &msg, 0);
-
- if (status < 0) {
- if (errno == EINTR || errno == EAGAIN)
- continue;
- fprintf(stderr, "netlink receive error %s (%d)\n",
- strerror(errno), errno);
- if (errno == ENOBUFS)
- continue;
- return -1;
- }
- if (status == 0) {
- fprintf(stderr, "EOF on netlink\n");
- return -1;
- }
- if (msg.msg_namelen != sizeof(nladdr)) {
- fprintf(stderr, "Sender address length == %d\n", msg.msg_namelen);
- exit(1);
- }
- for (h = (struct nlmsghdr*)buf; status >= sizeof(*h); ) {
- int err;
- int len = h->nlmsg_len;
- int l = len - sizeof(*h);
-
- if (l<0 || len>status) {
- if (msg.msg_flags & MSG_TRUNC) {
- fprintf(stderr, "Truncated message\n");
- return -1;
- }
- fprintf(stderr, "!!!malformed message: len=%d\n", len);
- exit(1);
- }
-
- err = handler(&nladdr, h, jarg);
- if (err < 0)
- return err;
-
- status -= NLMSG_ALIGN(len);
- h = (struct nlmsghdr*)((char*)h + NLMSG_ALIGN(len));
- }
- if (msg.msg_flags & MSG_TRUNC) {
- fprintf(stderr, "Message truncated\n");
- continue;
- }
- if (status) {
- fprintf(stderr, "!!!Remnant of size %d\n", status);
- exit(1);
- }
- }
-}
-
-int rtnl_from_file(FILE *rtnl, rtnl_filter_t handler,
- void *jarg)
-{
- int status;
- struct sockaddr_nl nladdr;
- char buf[8192];
- struct nlmsghdr *h = (void*)buf;
-
- memset(&nladdr, 0, sizeof(nladdr));
- nladdr.nl_family = AF_NETLINK;
- nladdr.nl_pid = 0;
- nladdr.nl_groups = 0;
-
- while (1) {
- int err, len;
- int l;
-
- status = fread(&buf, 1, sizeof(*h), rtnl);
-
- if (status < 0) {
- if (errno == EINTR)
- continue;
- perror("rtnl_from_file: fread");
- return -1;
- }
- if (status == 0)
- return 0;
-
- len = h->nlmsg_len;
- l = len - sizeof(*h);
-
- if (l<0 || len>sizeof(buf)) {
- fprintf(stderr, "!!!malformed message: len=%d @%lu\n",
- len, ftell(rtnl));
- return -1;
- }
-
- status = fread(NLMSG_DATA(h), 1, NLMSG_ALIGN(l), rtnl);
-
- if (status < 0) {
- perror("rtnl_from_file: fread");
- return -1;
- }
- if (status < l) {
- fprintf(stderr, "rtnl-from_file: truncated message\n");
- return -1;
- }
-
- err = handler(&nladdr, h, jarg);
- if (err < 0)
- return err;
- }
-}
-
-int addattr(struct nlmsghdr *n, int maxlen, int type)
-{
- return addattr_l(n, maxlen, type, NULL, 0);
-}
-
-int addattr8(struct nlmsghdr *n, int maxlen, int type, __u8 data)
-{
- return addattr_l(n, maxlen, type, &data, sizeof(__u8));
-}
-
-int addattr16(struct nlmsghdr *n, int maxlen, int type, __u16 data)
-{
- return addattr_l(n, maxlen, type, &data, sizeof(__u16));
-}
-
-int addattr32(struct nlmsghdr *n, int maxlen, int type, __u32 data)
-{
- return addattr_l(n, maxlen, type, &data, sizeof(__u32));
-}
-
-int addattr64(struct nlmsghdr *n, int maxlen, int type, __u64 data)
-{
- return addattr_l(n, maxlen, type, &data, sizeof(__u64));
-}
-
-int addattrstrz(struct nlmsghdr *n, int maxlen, int type, const char *str)
-{
- return addattr_l(n, maxlen, type, str, strlen(str)+1);
-}
-
-int addattr_l(struct nlmsghdr *n, int maxlen, int type, const void *data,
- int alen)
-{
- int len = RTA_LENGTH(alen);
- struct rtattr *rta;
-
- if (NLMSG_ALIGN(n->nlmsg_len) + RTA_ALIGN(len) > maxlen) {
- fprintf(stderr, "addattr_l ERROR: message exceeded bound of %d\n",maxlen);
- return -1;
- }
- rta = NLMSG_TAIL(n);
- rta->rta_type = type;
- rta->rta_len = len;
- memcpy(RTA_DATA(rta), data, alen);
- n->nlmsg_len = NLMSG_ALIGN(n->nlmsg_len) + RTA_ALIGN(len);
- return 0;
-}
-
-int addraw_l(struct nlmsghdr *n, int maxlen, const void *data, int len)
-{
- if (NLMSG_ALIGN(n->nlmsg_len) + NLMSG_ALIGN(len) > maxlen) {
- fprintf(stderr, "addraw_l ERROR: message exceeded bound of %d\n",maxlen);
- return -1;
- }
-
- memcpy(NLMSG_TAIL(n), data, len);
- memset((void *) NLMSG_TAIL(n) + len, 0, NLMSG_ALIGN(len) - len);
- n->nlmsg_len = NLMSG_ALIGN(n->nlmsg_len) + NLMSG_ALIGN(len);
- return 0;
-}
-
-struct rtattr *addattr_nest(struct nlmsghdr *n, int maxlen, int type)
-{
- struct rtattr *nest = NLMSG_TAIL(n);
-
- addattr_l(n, maxlen, type, NULL, 0);
- return nest;
-}
-
-int addattr_nest_end(struct nlmsghdr *n, struct rtattr *nest)
-{
- nest->rta_len = (void *)NLMSG_TAIL(n) - (void *)nest;
- return n->nlmsg_len;
-}
-
-struct rtattr *addattr_nest_compat(struct nlmsghdr *n, int maxlen, int type,
- const void *data, int len)
-{
- struct rtattr *start = NLMSG_TAIL(n);
-
- addattr_l(n, maxlen, type, data, len);
- addattr_nest(n, maxlen, type);
- return start;
-}
-
-int addattr_nest_compat_end(struct nlmsghdr *n, struct rtattr *start)
-{
- struct rtattr *nest = (void *)start + NLMSG_ALIGN(start->rta_len);
-
- start->rta_len = (void *)NLMSG_TAIL(n) - (void *)start;
- addattr_nest_end(n, nest);
- return n->nlmsg_len;
-}
-
-int rta_addattr32(struct rtattr *rta, int maxlen, int type, __u32 data)
-{
- int len = RTA_LENGTH(4);
- struct rtattr *subrta;
-
- if (RTA_ALIGN(rta->rta_len) + len > maxlen) {
- fprintf(stderr,"rta_addattr32: Error! max allowed bound %d exceeded\n",maxlen);
- return -1;
- }
- subrta = (struct rtattr*)(((char*)rta) + RTA_ALIGN(rta->rta_len));
- subrta->rta_type = type;
- subrta->rta_len = len;
- memcpy(RTA_DATA(subrta), &data, 4);
- rta->rta_len = NLMSG_ALIGN(rta->rta_len) + len;
- return 0;
-}
-
-int rta_addattr_l(struct rtattr *rta, int maxlen, int type,
- const void *data, int alen)
-{
- struct rtattr *subrta;
- int len = RTA_LENGTH(alen);
-
- if (RTA_ALIGN(rta->rta_len) + RTA_ALIGN(len) > maxlen) {
- fprintf(stderr,"rta_addattr_l: Error! max allowed bound %d exceeded\n",maxlen);
- return -1;
- }
- subrta = (struct rtattr*)(((char*)rta) + RTA_ALIGN(rta->rta_len));
- subrta->rta_type = type;
- subrta->rta_len = len;
- memcpy(RTA_DATA(subrta), data, alen);
- rta->rta_len = NLMSG_ALIGN(rta->rta_len) + RTA_ALIGN(len);
- return 0;
-}
-
-int parse_rtattr(struct rtattr *tb[], int max, struct rtattr *rta, int len)
-{
- return parse_rtattr_flags(tb, max, rta, len, 0);
-}
-
-int parse_rtattr_flags(struct rtattr *tb[], int max, struct rtattr *rta,
- int len, unsigned short flags)
-{
- unsigned short type;
-
- memset(tb, 0, sizeof(struct rtattr *) * (max + 1));
- while (RTA_OK(rta, len)) {
- type = rta->rta_type & ~flags;
- if ((type <= max) && (!tb[type]))
- tb[type] = rta;
- rta = RTA_NEXT(rta,len);
- }
- if (len)
- fprintf(stderr, "!!!Deficit %d, rta_len=%d\n", len, rta->rta_len);
- return 0;
-}
-
-int parse_rtattr_byindex(struct rtattr *tb[], int max, struct rtattr *rta, int len)
-{
- int i = 0;
-
- memset(tb, 0, sizeof(struct rtattr *) * max);
- while (RTA_OK(rta, len)) {
- if (rta->rta_type <= max && i < max)
- tb[i++] = rta;
- rta = RTA_NEXT(rta,len);
- }
- if (len)
- fprintf(stderr, "!!!Deficit %d, rta_len=%d\n", len, rta->rta_len);
- return i;
-}
-
-int __parse_rtattr_nested_compat(struct rtattr *tb[], int max, struct rtattr *rta,
- int len)
-{
- if (RTA_PAYLOAD(rta) < len)
- return -1;
- if (RTA_PAYLOAD(rta) >= RTA_ALIGN(len) + sizeof(struct rtattr)) {
- rta = RTA_DATA(rta) + RTA_ALIGN(len);
- return parse_rtattr_nested(tb, max, rta);
- }
- memset(tb, 0, sizeof(struct rtattr *) * (max + 1));
- return 0;
-}
diff --git a/meta-facebook/meta-wedge/recipes-wedge/oob-nic/oob-nic/src/libnetlink.h b/meta-facebook/meta-wedge/recipes-wedge/oob-nic/oob-nic/src/libnetlink.h
deleted file mode 100644
index 9e72692..0000000
--- a/meta-facebook/meta-wedge/recipes-wedge/oob-nic/oob-nic/src/libnetlink.h
+++ /dev/null
@@ -1,161 +0,0 @@
-/*
- * Note: Original file from iproute2 package
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-#ifndef __LIBNETLINK_H__
-#define __LIBNETLINK_H__ 1
-
-#include <stdio.h>
-#include <string.h>
-#include <asm/types.h>
-#include <linux/netlink.h>
-#include <linux/rtnetlink.h>
-#include <linux/if_link.h>
-#include <linux/if_addr.h>
-#include <linux/neighbour.h>
-#include <linux/netconf.h>
-
-struct rtnl_handle
-{
- int fd;
- struct sockaddr_nl local;
- struct sockaddr_nl peer;
- __u32 seq;
- __u32 dump;
-};
-
-extern int rcvbuf;
-
-extern int rtnl_open(struct rtnl_handle *rth, unsigned subscriptions);
-extern int rtnl_open_byproto(struct rtnl_handle *rth, unsigned subscriptions, int protocol);
-extern void rtnl_close(struct rtnl_handle *rth);
-extern int rtnl_wilddump_request(struct rtnl_handle *rth, int fam, int type);
-extern int rtnl_wilddump_req_filter(struct rtnl_handle *rth, int fam, int type,
- __u32 filt_mask);
-extern int rtnl_dump_request(struct rtnl_handle *rth, int type, void *req, int len);
-
-typedef int (*rtnl_filter_t)(const struct sockaddr_nl *,
- struct nlmsghdr *n, void *);
-
-struct rtnl_dump_filter_arg
-{
- rtnl_filter_t filter;
- void *arg1;
-};
-
-extern int rtnl_dump_filter_l(struct rtnl_handle *rth,
- const struct rtnl_dump_filter_arg *arg);
-extern int rtnl_dump_filter(struct rtnl_handle *rth, rtnl_filter_t filter,
- void *arg);
-extern int rtnl_talk(struct rtnl_handle *rtnl, struct nlmsghdr *n, pid_t peer,
- unsigned groups, struct nlmsghdr *answer);
-extern int rtnl_send(struct rtnl_handle *rth, const void *buf, int);
-extern int rtnl_send_check(struct rtnl_handle *rth, const void *buf, int);
-
-extern int addattr(struct nlmsghdr *n, int maxlen, int type);
-extern int addattr8(struct nlmsghdr *n, int maxlen, int type, __u8 data);
-extern int addattr16(struct nlmsghdr *n, int maxlen, int type, __u16 data);
-extern int addattr32(struct nlmsghdr *n, int maxlen, int type, __u32 data);
-extern int addattr64(struct nlmsghdr *n, int maxlen, int type, __u64 data);
-extern int addattrstrz(struct nlmsghdr *n, int maxlen, int type, const char *data);
-
-extern int addattr_l(struct nlmsghdr *n, int maxlen, int type, const void *data, int alen);
-extern int addraw_l(struct nlmsghdr *n, int maxlen, const void *data, int len);
-extern struct rtattr *addattr_nest(struct nlmsghdr *n, int maxlen, int type);
-extern int addattr_nest_end(struct nlmsghdr *n, struct rtattr *nest);
-extern struct rtattr *addattr_nest_compat(struct nlmsghdr *n, int maxlen, int type, const void *data, int len);
-extern int addattr_nest_compat_end(struct nlmsghdr *n, struct rtattr *nest);
-extern int rta_addattr32(struct rtattr *rta, int maxlen, int type, __u32 data);
-extern int rta_addattr_l(struct rtattr *rta, int maxlen, int type, const void *data, int alen);
-
-extern int parse_rtattr(struct rtattr *tb[], int max, struct rtattr *rta, int len);
-extern int parse_rtattr_flags(struct rtattr *tb[], int max, struct rtattr *rta,
- int len, unsigned short flags);
-extern int parse_rtattr_byindex(struct rtattr *tb[], int max, struct rtattr *rta, int len);
-extern int __parse_rtattr_nested_compat(struct rtattr *tb[], int max, struct rtattr *rta, int len);
-
-#define parse_rtattr_nested(tb, max, rta) \
- (parse_rtattr((tb), (max), RTA_DATA(rta), RTA_PAYLOAD(rta)))
-
-#define parse_rtattr_nested_compat(tb, max, rta, data, len) \
- ({ data = RTA_PAYLOAD(rta) >= len ? RTA_DATA(rta) : NULL; \
- __parse_rtattr_nested_compat(tb, max, rta, len); })
-
-static inline __u8 rta_getattr_u8(const struct rtattr *rta)
-{
- return *(__u8 *)RTA_DATA(rta);
-}
-static inline __u16 rta_getattr_u16(const struct rtattr *rta)
-{
- return *(__u16 *)RTA_DATA(rta);
-}
-static inline __u32 rta_getattr_u32(const struct rtattr *rta)
-{
- return *(__u32 *)RTA_DATA(rta);
-}
-static inline __u64 rta_getattr_u64(const struct rtattr *rta)
-{
- __u64 tmp;
- memcpy(&tmp, RTA_DATA(rta), sizeof(__u64));
- return tmp;
-}
-static inline const char *rta_getattr_str(const struct rtattr *rta)
-{
- return (const char *)RTA_DATA(rta);
-}
-
-extern int rtnl_listen(struct rtnl_handle *, rtnl_filter_t handler,
- void *jarg);
-extern int rtnl_from_file(FILE *, rtnl_filter_t handler,
- void *jarg);
-
-#define NLMSG_TAIL(nmsg) \
- ((struct rtattr *) (((void *) (nmsg)) + NLMSG_ALIGN((nmsg)->nlmsg_len)))
-
-#ifndef IFA_RTA
-#define IFA_RTA(r) \
- ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct ifaddrmsg))))
-#endif
-#ifndef IFA_PAYLOAD
-#define IFA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct ifaddrmsg))
-#endif
-
-#ifndef IFLA_RTA
-#define IFLA_RTA(r) \
- ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct ifinfomsg))))
-#endif
-#ifndef IFLA_PAYLOAD
-#define IFLA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct ifinfomsg))
-#endif
-
-#ifndef NDA_RTA
-#define NDA_RTA(r) \
- ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct ndmsg))))
-#endif
-#ifndef NDA_PAYLOAD
-#define NDA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct ndmsg))
-#endif
-
-#ifndef NDTA_RTA
-#define NDTA_RTA(r) \
- ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct ndtmsg))))
-#endif
-#ifndef NDTA_PAYLOAD
-#define NDTA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct ndtmsg))
-#endif
-
-#endif /* __LIBNETLINK_H__ */
-
diff --git a/meta-facebook/meta-wedge/recipes-wedge/oob-nic/oob-nic/src/ll_map.c b/meta-facebook/meta-wedge/recipes-wedge/oob-nic/oob-nic/src/ll_map.c
deleted file mode 100644
index 64e5069..0000000
--- a/meta-facebook/meta-wedge/recipes-wedge/oob-nic/oob-nic/src/ll_map.c
+++ /dev/null
@@ -1,225 +0,0 @@
-/*
- * Note: Original file from iproute2 package
- *
- * ll_map.c
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version
- * 2 of the License, or (at your option) any later version.
- *
- * Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru>
- *
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <syslog.h>
-#include <fcntl.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <string.h>
-#include <net/if.h>
-
-#include "libnetlink.h"
-#include "ll_map.h"
-#include "hlist.h"
-
-struct ll_cache {
- struct hlist_node idx_hash;
- struct hlist_node name_hash;
- unsigned flags;
- int index;
- unsigned short type;
- char name[IFNAMSIZ];
-};
-
-#define IDXMAP_SIZE 1024
-static struct hlist_head idx_head[IDXMAP_SIZE];
-static struct hlist_head name_head[IDXMAP_SIZE];
-
-static struct ll_cache *ll_get_by_index(unsigned index)
-{
- struct hlist_node *n;
- unsigned h = index & (IDXMAP_SIZE - 1);
-
- hlist_for_each(n, &idx_head[h]) {
- struct ll_cache *im
- = container_of(n, struct ll_cache, idx_hash);
- if (im->index == index)
- return im;
- }
-
- return NULL;
-}
-
-static unsigned namehash(const char *str)
-{
- unsigned hash = 5381;
-
- while (*str)
- hash = ((hash << 5) + hash) + *str++; /* hash * 33 + c */
-
- return hash;
-}
-
-static struct ll_cache *ll_get_by_name(const char *name)
-{
- struct hlist_node *n;
- unsigned h = namehash(name) & (IDXMAP_SIZE - 1);
-
- hlist_for_each(n, &name_head[h]) {
- struct ll_cache *im
- = container_of(n, struct ll_cache, name_hash);
-
- if (strncmp(im->name, name, IFNAMSIZ) == 0)
- return im;
- }
-
- return NULL;
-}
-
-int ll_remember_index(const struct sockaddr_nl *who,
- struct nlmsghdr *n, void *arg)
-{
- unsigned int h;
- const char *ifname;
- struct ifinfomsg *ifi = NLMSG_DATA(n);
- struct ll_cache *im;
- struct rtattr *tb[IFLA_MAX+1];
-
- if (n->nlmsg_type != RTM_NEWLINK && n->nlmsg_type != RTM_DELLINK)
- return 0;
-
- if (n->nlmsg_len < NLMSG_LENGTH(sizeof(ifi)))
- return -1;
-
- im = ll_get_by_index(ifi->ifi_index);
- if (n->nlmsg_type == RTM_DELLINK) {
- if (im) {
- hlist_del(&im->name_hash);
- hlist_del(&im->idx_hash);
- free(im);
- }
- return 0;
- }
-
- memset(tb, 0, sizeof(tb));
- parse_rtattr(tb, IFLA_MAX, IFLA_RTA(ifi), IFLA_PAYLOAD(n));
- ifname = rta_getattr_str(tb[IFLA_IFNAME]);
- if (ifname == NULL)
- return 0;
-
- if (im) {
- /* change to existing entry */
- if (strcmp(im->name, ifname) != 0) {
- hlist_del(&im->name_hash);
- h = namehash(ifname) & (IDXMAP_SIZE - 1);
- hlist_add_head(&im->name_hash, &name_head[h]);
- }
-
- im->flags = ifi->ifi_flags;
- return 0;
- }
-
- im = malloc(sizeof(*im));
- if (im == NULL)
- return 0;
- im->index = ifi->ifi_index;
- strcpy(im->name, ifname);
- im->type = ifi->ifi_type;
- im->flags = ifi->ifi_flags;
-
- h = ifi->ifi_index & (IDXMAP_SIZE - 1);
- hlist_add_head(&im->idx_hash, &idx_head[h]);
-
- h = namehash(ifname) & (IDXMAP_SIZE - 1);
- hlist_add_head(&im->name_hash, &name_head[h]);
-
- return 0;
-}
-
-const char *ll_idx_n2a(unsigned idx, char *buf)
-{
- const struct ll_cache *im;
-
- if (idx == 0)
- return "*";
-
- im = ll_get_by_index(idx);
- if (im)
- return im->name;
-
- if (if_indextoname(idx, buf) == NULL)
- snprintf(buf, IFNAMSIZ, "if%d", idx);
-
- return buf;
-}
-
-const char *ll_index_to_name(unsigned idx)
-{
- static char nbuf[IFNAMSIZ];
-
- return ll_idx_n2a(idx, nbuf);
-}
-
-int ll_index_to_type(unsigned idx)
-{
- const struct ll_cache *im;
-
- if (idx == 0)
- return -1;
-
- im = ll_get_by_index(idx);
- return im ? im->type : -1;
-}
-
-unsigned ll_index_to_flags(unsigned idx)
-{
- const struct ll_cache *im;
-
- if (idx == 0)
- return 0;
-
- im = ll_get_by_index(idx);
- return im ? im->flags : -1;
-}
-
-unsigned ll_name_to_index(const char *name)
-{
- const struct ll_cache *im;
- unsigned idx;
-
- if (name == NULL)
- return 0;
-
- im = ll_get_by_name(name);
- if (im)
- return im->index;
-
- idx = if_nametoindex(name);
- if (idx == 0)
- sscanf(name, "if%u", &idx);
- return idx;
-}
-
-void ll_init_map(struct rtnl_handle *rth)
-{
- static int initialized;
-
- if (initialized)
- return;
-
- if (rtnl_wilddump_request(rth, AF_UNSPEC, RTM_GETLINK) < 0) {
- perror("Cannot send dump request");
- exit(1);
- }
-
- if (rtnl_dump_filter(rth, ll_remember_index, NULL) < 0) {
- fprintf(stderr, "Dump terminated\n");
- exit(1);
- }
-
- initialized = 1;
-}
diff --git a/meta-facebook/meta-wedge/recipes-wedge/oob-nic/oob-nic/src/ll_map.h b/meta-facebook/meta-wedge/recipes-wedge/oob-nic/oob-nic/src/ll_map.h
deleted file mode 100644
index d74a46f..0000000
--- a/meta-facebook/meta-wedge/recipes-wedge/oob-nic/oob-nic/src/ll_map.h
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Note: Original file from iproute2 package
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-
-#ifndef __LL_MAP_H__
-#define __LL_MAP_H__ 1
-
-extern int ll_remember_index(const struct sockaddr_nl *who,
- struct nlmsghdr *n, void *arg);
-
-extern void ll_init_map(struct rtnl_handle *rth);
-extern unsigned ll_name_to_index(const char *name);
-extern const char *ll_index_to_name(unsigned idx);
-extern const char *ll_idx_n2a(unsigned idx, char *buf);
-extern int ll_index_to_type(unsigned idx);
-extern unsigned ll_index_to_flags(unsigned idx);
-
-#endif /* __LL_MAP_H__ */
diff --git a/meta-facebook/meta-wedge/recipes-wedge/oob-nic/oob-nic/src/main.c b/meta-facebook/meta-wedge/recipes-wedge/oob-nic/oob-nic/src/main.c
deleted file mode 100644
index 2dc1917..0000000
--- a/meta-facebook/meta-wedge/recipes-wedge/oob-nic/oob-nic/src/main.c
+++ /dev/null
@@ -1,204 +0,0 @@
-/*
- * Copyright 2014-present Facebook. All Rights Reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-#include <stdio.h>
-#include <unistd.h>
-#include <sys/select.h>
-#include <sys/time.h>
-#include <sys/errno.h>
-
-#include "nic.h"
-#include "intf.h"
-
-#include "openbmc/log.h"
-#include "facebook/wedge_eeprom.h"
-
-#define WAIT4PACKET_TIMEOUT 10000 /* 10ms */
-#define NO_RCV_CHECK_THRESHOLD 100 /* if not receiving pkt for 100 times (1s),
- * check the NIC status
- */
-
-static void io_loop(oob_nic *nic, oob_intf *intf, const uint8_t mac[6]) {
-
- fd_set rfds;
- int fd = oob_intf_get_fd(intf);
- struct timeval timeout;
- int rc;
- int n_fds;
- int n_io;
- char buf[NIC_PKT_SIZE_MAX];
- int no_rcv = 0;
- struct oob_nic_status_t sts;
-
- while (1) {
- memset(&timeout, 0, sizeof(timeout));
- timeout.tv_sec = 0;
- timeout.tv_usec = WAIT4PACKET_TIMEOUT;
-
- FD_ZERO(&rfds);
- FD_SET(fd, &rfds);
-
- n_fds = select(fd + 1, &rfds, NULL, NULL, &timeout);
- if (n_fds < 0) {
- rc = errno;
- LOG_ERR(rc, "Failed to select");
- continue;
- }
-
- /*
- * no matter what, receive packet from nic first, as the nic
- * has small amount of memory. Without read, the sending could
- * fail due to OOM.
- *
- * TODO: We might want to do something smart here to prevent attack or
- * just rx flooding. Disable the Receive Enable first, drain the buffer
- * with oob_nic_receive(), then Tx, and enable Receive Enable after.
- */
- for (n_io = 0; n_io < 16; n_io++) {
- rc = oob_nic_receive(nic, buf, sizeof(buf));
- if (rc <= 0) {
- no_rcv++;
- break;
- }
- oob_intf_send(intf, buf, rc);
- no_rcv = 0;
- }
-
- /*
- * if we didn't receive any packet for NO_RCV_CHECK_THRESHOLD times,
- * check the nic status
- */
- if (no_rcv >= NO_RCV_CHECK_THRESHOLD) {
- while(oob_nic_get_status(nic, &sts)) {
- usleep(1000);
- }
- LOG_INFO("Failed to receive packets for %d times. NIC status is "
- "%x.%x", NO_RCV_CHECK_THRESHOLD, sts.ons_byte1, sts.ons_byte2);
- /*
- * if the NIC went through initialization, or not set force up, need to
- * re-program the filters by calling oob_nic_start().
- */
- if ((sts.ons_byte1 & NIC_STATUS_D1_INIT)
- || !(sts.ons_byte1 & NIC_STATUS_D1_FORCE_UP)) {
- while(oob_nic_start(nic, mac)) {
- usleep(1000);
- }
- }
- no_rcv = 0;
- }
-
- if (n_fds > 0 && FD_ISSET(fd, &rfds)) {
- for (n_io = 0; n_io < 1; n_io++) {
- rc = oob_intf_receive(intf, buf, sizeof(buf));
- if (rc <= 0) {
- break;
- }
- oob_nic_send(nic, buf, rc);
- }
- }
- }
-}
-
-int main(int argc, const char **argv) {
-
- uint8_t mac[6];
- oob_nic *nic;
- oob_intf *intf;
- struct wedge_eeprom_st eeprom;
- int rc;
- int from_eeprom = 0;
-
- nic = oob_nic_open(0, 0x49);
- if (!nic) {
- return -1;
- }
-
- /* read EEPROM for the MAC */
- if (wedge_eeprom_parse(NULL, &eeprom) == 0) {
- uint16_t carry;
- int pos;
- int adj;
- /*
- * OOB MAC comes from this range. We pick the last MAC from the range to
- * use as OOB MAC.
- */
- if (eeprom.fbw_mac_size > 128) {
- LOG_ERR(EFAULT, "Extended MAC size (%d) is too large.",
- eeprom.fbw_mac_size);
- carry = 128;
- } else {
- carry = eeprom.fbw_mac_size;
- }
-
- /*
- * Due to various manufacture issues, some FC boards have MAC range overlap
- * between LEFT and RIGHT sides. A SW workaround is done below to use the
- * 8th (or 7th for right side FC) last MAC from the range for FC.
- */
- if (strncmp(eeprom.fbw_location, "LEFT", FBW_EEPROM_F_LOCATION) == 0) {
- adj = 8;
- } else if (strncmp(eeprom.fbw_location, "RIGHT", FBW_EEPROM_F_LOCATION)
- == 0) {
- adj = 7;
- } else {
- adj = 1;
- }
-
- if (carry < adj) {
- LOG_ERR(EFAULT, "Invalid extended MAC size: %d", eeprom.fbw_mac_size);
- } else {
- carry -= adj;
- memcpy(mac, eeprom.fbw_mac_base, sizeof(mac));
- for (pos = sizeof(mac) - 1; pos >= 0 && carry; pos--) {
- uint16_t tmp = mac[pos] + carry;
- mac[pos] = tmp & 0xFF;
- carry = tmp >> 8;
- }
- from_eeprom = 1;
- }
- }
-
- if (!from_eeprom) {
- while (oob_nic_get_mac(nic, mac)) {
- usleep(1000);
- }
- /*
- * increase the last byte of the mac by 1 and turn on the
- * local administered bit to use it as the oob nic mac
- */
- mac[0] |= 0x2;
- mac[5]++;
- }
-
- LOG_INFO("Retrieve MAC %x:%x:%x:%x:%x:%x from %s",
- mac[0], mac[1], mac[2], mac[3], mac[4], mac[5],
- (from_eeprom) ? "EEPROM" : "NIC");
-
- /* create the tap interface */
- intf = oob_intf_create("oob", mac);
- if (!intf) {
- return -1;
- }
-
- while (oob_nic_start(nic, mac)) {
- usleep(1000);
- }
-
- io_loop(nic, intf, mac);
-
- return 0;
-}
diff --git a/meta-facebook/meta-wedge/recipes-wedge/oob-nic/oob-nic/src/nic.c b/meta-facebook/meta-wedge/recipes-wedge/oob-nic/oob-nic/src/nic.c
deleted file mode 100644
index c5fa422..0000000
--- a/meta-facebook/meta-wedge/recipes-wedge/oob-nic/oob-nic/src/nic.c
+++ /dev/null
@@ -1,517 +0,0 @@
-/*
- * Copyright 2014-present Facebook. All Rights Reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-#include "nic.h"
-
-#include <arpa/inet.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/ioctl.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-
-#include "facebook/i2c-dev.h"
-#include "openbmc/log.h"
-
-#define ETHERTYPE_LLDP 0x88cc
-
-struct oob_nic_t {
- int on_bus;
- uint8_t on_addr;
- int on_file; /* the file descriptor */
- uint8_t on_mac[6]; /* the mac address assigned to this NIC */
-};
-
-oob_nic* oob_nic_open(int bus, uint8_t addr) {
- oob_nic *dev = NULL;
- char fn[32];
- int rc;
-
- /* address must be 7 bits maximum */
- if ((addr & 0x80)) {
- LOG_ERR(EINVAL, "Address 0x%x has the 8th bit", addr);
- return NULL;
- }
-
- dev = calloc(1, sizeof(*dev));
- if (!dev) {
- return NULL;
- }
- dev->on_bus = bus;
- dev->on_addr = addr;
-
- /* construct the device file name */
- snprintf(fn, sizeof(fn), "/dev/i2c-%d", bus);
- dev->on_file = open(fn, O_RDWR);
- if (dev->on_file == -1) {
- LOG_ERR(errno, "Failed to open i2c device %s", fn);
- goto err_out;
- }
-
- /* assign the device address */
- rc = ioctl(dev->on_file, I2C_SLAVE, dev->on_addr);
- if (rc < 0) {
- LOG_ERR(errno, "Failed to open slave @ address 0x%x", dev->on_addr);
- goto err_out;
- }
-
- return dev;
-
- err_out:
- oob_nic_close(dev);
- return NULL;
-}
-
-void oob_nic_close(oob_nic *dev) {
- if (!dev) {
- return;
- }
- if (dev->on_file != -1) {
- close(dev->on_file);
- }
- free(dev);
-}
-
-int oob_nic_get_mac(oob_nic *dev, uint8_t mac[6]) {
- int rc;
- uint8_t buf[64];
-
- rc = i2c_smbus_read_block_data(dev->on_file, NIC_READ_MAC_CMD, buf);
- if (rc < 0) {
- rc = errno;
- LOG_ERR(rc, "Failed to get MAC on %d-%x",
- dev->on_bus, dev->on_addr);
- return -rc;
- }
-
- if (rc != NIC_READ_MAC_RES_LEN) {
- LOG_ERR(EFAULT, "Unexpected response len (%d) for get MAC on %d-%x",
- rc, dev->on_bus, dev->on_addr);
- return -EFAULT;
- }
-
- if (buf[0] != NIC_READ_MAC_RES_OPT) {
- LOG_ERR(EFAULT, "Unexpected response opt code (0x%x) get MAC on %d-%x",
- buf[0], dev->on_bus, dev->on_addr);
- return -EFAULT;
- }
-
- memcpy(mac, &buf[1], 6);
-
- LOG_DBG("Get MAC on %d-%x: %x:%x:%x:%x:%x:%x", dev->on_bus, dev->on_addr,
- mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]);
- return 0;
-}
-
-int oob_nic_get_status(oob_nic *dev, oob_nic_status *status) {
- int rc;
- uint8_t buf[64];
-
- rc = i2c_smbus_read_block_data(dev->on_file, NIC_READ_STATUS_CMD, buf);
- if (rc < 0) {
- rc = errno;
- LOG_ERR(rc, "Failed to get status on %d-%x",
- dev->on_bus, dev->on_addr);
- return -rc;
- }
-
- if (rc != NIC_READ_STATUS_RES_LEN) {
- LOG_ERR(EFAULT, "Unexpected response len (%d) for get status on %d-%x",
- rc, dev->on_bus, dev->on_addr);
- return -EFAULT;
- }
-
- if (buf[0] != NIC_READ_STATUS_RES_OPT) {
- LOG_ERR(EFAULT, "Unexpected response opt code (0x%x) get status on %d-%x",
- buf[0], dev->on_bus, dev->on_addr);
- return -EFAULT;
- }
-
- memset(status, 0, sizeof(*status));
- status->ons_byte1 = buf[1];
- status->ons_byte2 = buf[2];
-
- LOG_VER("Get status on %d-%x: byte1:0x%x byte2:0x%x",
- dev->on_bus, dev->on_addr,
- status->ons_byte1, status->ons_byte2);
- return 0;
-}
-
-int oob_nic_receive(oob_nic *dev, uint8_t *buf, int len) {
-
- int rc = 0;
- uint8_t pkt[I2C_SMBUS_BLOCK_LARGE_MAX];
- uint8_t opt;
- int copied = 0;
- int to_copy;
- int expect_first = 1;
- int n_frags = 0;
-
-#define _COPY_DATA(n, data) do { \
- int to_copy; \
- if (copied >= len) { \
- break; \
- } \
- to_copy = (n < len - copied) ? n : len - copied; \
- if (to_copy) { \
- memcpy(buf + copied, data, to_copy); \
- } \
- copied += to_copy; \
-} while(0)
-
- do {
- rc = i2c_smbus_read_block_large_data(dev->on_file, NIC_READ_PKT_CMD, pkt);
- if (rc < 0) {
- rc = errno;
- LOG_ERR(rc, "Failed to get packet on %d-%x",
- dev->on_bus, dev->on_addr);
- goto err_out;
- }
- if (rc > I2C_SMBUS_BLOCK_LARGE_MAX) {
- LOG_ERR(EFAULT, "Too large i2c block (%d) received on %d-%x",
- rc, dev->on_bus, dev->on_addr);
- rc = EFAULT;
- goto err_out;
- }
- opt = pkt[0];
- switch (opt) {
- case NIC_READ_PKT_RES_FIRST_OPT:
- if (!expect_first) {
- rc = EFAULT;
- LOG_ERR(rc, "Received more than one buffer with FIRST set");
- goto err_out;
- }
- expect_first = 0;
- n_frags++;
- _COPY_DATA(rc - 1, &pkt[1]);
- break;
- case NIC_READ_PKT_RES_MIDDLE_OPT:
- if (expect_first) {
- rc = EFAULT;
- LOG_ERR(rc, "Received MIDDLE before getting FIRST");
- goto err_out;
- }
- _COPY_DATA(rc - 1, &pkt[1]);
- n_frags++;
- break;
- case NIC_READ_PKT_RES_LAST_OPT:
- if (expect_first) {
- rc = EFAULT;
- LOG_ERR(rc, "Received LAST before getting FIRST");
- goto err_out;
- }
- if (rc != NIC_READ_PKT_RES_LAST_LEN) {
- LOG_ERR(EFAULT, "Expect %d bytes (got %d) for LAST segement",
- NIC_READ_PKT_RES_LAST_LEN, rc);
- rc = EFAULT;
- goto err_out;
- }
- /* TODO: pkt status???? */
- break;
- case NIC_READ_STATUS_RES_OPT:
- /* that means no pkt available */
- if (!expect_first) {
- rc = EFAULT;
- LOG_ERR(rc, "Received STATUS in the middle of packet");
- goto err_out;
- }
- //LOG_VER("Received STATUS when receiving the packet");
- return 0;
- default:
- rc = EFAULT;
- LOG_ERR(rc, "Unexpected opt code 0x%x", opt);
- goto err_out;
- }
- } while (opt != NIC_READ_PKT_RES_LAST_OPT);
-
- LOG_VER("Received a packet with %d bytes in %d fragments", copied, n_frags);
- return copied;
-
- err_out:
- return -rc;
-#undef _COPY_DATA
-}
-
-int oob_nic_send(oob_nic *dev, const uint8_t *data, int len) {
-
- int rc;
- uint8_t to_send;
- int has_sent = 0;
- int is_first = 1;
- uint8_t cmd;
- int n_frags = 0;
-
- if (len <= 0 || len > NIC_PKT_SIZE_MAX) {
- rc = EINVAL;
- LOG_ERR(rc, "Invalid packet length %d", len);
- return -rc;
- }
-
- while (len) {
- to_send = (len < OOB_NIC_PKT_FRAGMENT_SIZE)
- ? len : OOB_NIC_PKT_FRAGMENT_SIZE;
-
- if (is_first) {
- if (to_send >= len) {
- /* this is the last pkt also */
- cmd = NIC_WRITE_PKT_SINGLE_CMD;
- } else {
- cmd = NIC_WRITE_PKT_FIRST_CMD;
- }
- is_first = 0;
- } else {
- if (to_send >= len) {
- /* this is the last pkt */
- cmd = NIC_WRITE_PKT_LAST_CMD;
- } else {
- cmd = NIC_WRITE_PKT_MIDDLE_CMD;
- }
- }
-
- rc = i2c_smbus_write_block_large_data(dev->on_file, cmd,
- to_send, data + has_sent);
- if (rc < 0) {
- rc = errno;
- LOG_ERR(rc, "Failed to sent packet with cmd 0x%x, has_sent=%d "
- "to_send=%d", cmd, has_sent, to_send);
- return -rc;
- }
-
- has_sent += to_send;
- len -= to_send;
- n_frags++;
- }
-
- LOG_VER("Sent a packet with %d bytes in %d fragments", has_sent, n_frags);
-
- return has_sent;
-}
-
-static int oob_nic_set_mng_ctrl(oob_nic *dev, const uint8_t *data, int len) {
- int rc;
-
- if (len <= 0) {
- rc = EINVAL;
- LOG_ERR(rc, "Invalid data length: %d", len);
- return -rc;
- }
-
- rc = i2c_smbus_write_block_data(dev->on_file, NIC_WRITE_MNG_CTRL_CMD,
- len, data);
- if (rc < 0) {
- rc = errno;
- LOG_ERR(rc, "Failed to send management control command for parameter # %d",
- data[0]);
- return -rc;
- }
-
- return 0;
-}
-
-static int oob_nic_set_force_up(oob_nic *dev, int enable) {
- uint8_t cmd[2];
-
- cmd[0] = NIC_MNG_CTRL_KEEP_LINK_UP_NUM;
- cmd[1] = enable
- ? NIC_MNG_CTRL_KEEP_LINK_UP_ENABLE : NIC_MNG_CTRL_KEEP_LINK_UP_DISABLE;
-
- LOG_DBG("Turn %s link force up", enable ? "on" : "off");
- return oob_nic_set_mng_ctrl(dev, cmd, sizeof(cmd));
-}
-
-static int oob_nic_setup_filters(oob_nic *dev, const uint8_t mac[6]) {
- int rc;
- uint32_t cmd32;
- uint8_t buf[32];
- uint8_t *cmd;
-
- /*
- * There are 8 filters in total (MDEF0-MDEF7). Any filter that has a
- * configuration will be applied. Any packet that matches any filter will
- * be passed to OOB by the main NIC.
- *
- * Each filter has two sets of bits, MDEF and MDEF_EXT. Each bit in the
- * filter represents a filter with its logical operation. For example,
- * NIC_FILTER_MDEF_MAC_AND_OFFSET(0) represent MAC filter 0 using AND
- * operation. So, in order to receive packets matching a specific MAC, MAC0
- * filter (NIC_FILTER_MAC_NUM:NIC_FILTER_MAC_PAIR0) must be programmed
- * with the specific MAC. Then set NIC_FILTER_MDEF_MAC_AND_OFFSET (for
- * AND) or NIC_FILTER_MDEF_MAC_OR_OFFSET (for OR) in one of the filters.
- */
-
- /*
- * Command to set MAC filter
- * Seven bytes are required to load the MAC address filters.
- * Data 2—MAC address filters pair number (3:0).
- * Data 3—MSB of MAC address.
- * ...
- * Data 8: LSB of MAC address.
- */
- /* set MAC filter to pair 0 */
- cmd = buf;
- *cmd++ = NIC_FILTER_MAC_NUM;
- *cmd++ = NIC_FILTER_MAC_PAIR0; /* pair 0 */
- memcpy(cmd, mac, 6);
- cmd += 6;
- rc = i2c_smbus_write_block_data(dev->on_file, NIC_WRITE_FILTER_CMD,
- cmd - buf, buf);
- if (rc < 0) {
- rc = errno;
- LOG_ERR(rc, "Failed to set MAC filter");
- return -rc;
- }
-
- /*
- * Command to enable filter
- *
- * 9 bytes to load the extended decision filters (MDEF_EXT & MDEF)
- * Data 2—MDEF filter index (valid values are 0...6)
- * Data 3—MSB of MDEF_EXT (DecisionFilter0)
- * ....
- * Data 6—LSB of MDEF_EXT (DecisionFilter0)
- * Data 7—MSB of MDEF (DecisionFilter0)
- * ....
- * Data 10—LSB of MDEF (DecisionFilter0)
- */
-
- /* enable MAC filter pair 0 on filter 0 */
- cmd = buf;
- *cmd++ = NIC_FILTER_DECISION_EXT_NUM;
- *cmd++ = NIC_FILTER_MDEF0;
- /* enable filter for traffic from network and host */
- cmd32 = htonl(NIC_FILTER_MDEF_BIT(NIC_FILTER_MDEF_EXT_NET_EN_OFFSET)
- | NIC_FILTER_MDEF_BIT(NIC_FILTER_MDEF_EXT_HOST_EN_OFFSET));
- memcpy(cmd, &cmd32, sizeof(cmd32));
- cmd += sizeof(cmd32);
- /* enable mac pair 0 */
- cmd32 = htonl(NIC_FILTER_MDEF_BIT_VAL(NIC_FILTER_MDEF_MAC_AND_OFFSET,
- NIC_FILTER_MAC_PAIR0));
- memcpy(cmd, &cmd32, sizeof(cmd32));
- cmd += sizeof(cmd32);
- rc = i2c_smbus_write_block_data(dev->on_file, NIC_WRITE_FILTER_CMD,
- cmd - buf, buf);
- if (rc < 0) {
- rc = errno;
- LOG_ERR(rc, "Failed to set MAC filter to MDEF 0");
- return -rc;
- }
-
- /* Program EtherType0 to match LLDP */
- cmd = buf;
- *cmd++ = NIC_FILTER_ETHERTYPE_NUM;
- *cmd++ = NIC_FILTER_ETHERTYPE0;
- cmd32 = htonl(ETHERTYPE_LLDP);
- memcpy(cmd, &cmd32, sizeof(cmd32));
- cmd += sizeof(cmd32);
- rc = i2c_smbus_write_block_data(dev->on_file, NIC_WRITE_FILTER_CMD,
- cmd - buf, buf);
- if (rc < 0) {
- rc = errno;
- LOG_ERR(rc, "Failed to program EtherType0 to match LLDP");
- return -rc;
- }
-
- /* enable ARP, ND, and EtheryType0 (OR) on filter 1 */
- cmd = buf;
- *cmd++ = NIC_FILTER_DECISION_EXT_NUM;
- *cmd++ = NIC_FILTER_MDEF1;
- /* enable filter for traffic from network and host, matching ethertype0 */
- cmd32 = htonl(NIC_FILTER_MDEF_BIT(NIC_FILTER_MDEF_EXT_NET_EN_OFFSET)
- | NIC_FILTER_MDEF_BIT(NIC_FILTER_MDEF_EXT_HOST_EN_OFFSET)
- | NIC_FILTER_MDEF_BIT_VAL(
- NIC_FILTER_MDEF_EXT_ETHTYPE_OR_OFFSET,
- NIC_FILTER_ETHERTYPE0));
- memcpy(cmd, &cmd32, sizeof(cmd32));
- cmd += sizeof(cmd32);
-
- /* enable ARP and ND */
- cmd32 = htonl(NIC_FILTER_MDEF_BIT(NIC_FILTER_MDEF_ARP_REQ_OR_OFFSET)
- | NIC_FILTER_MDEF_BIT(NIC_FILTER_MDEF_ARP_RES_OR_OFFSET)
- | NIC_FILTER_MDEF_BIT(NIC_FILTER_MDEF_NBG_OR_OFFSET));
- memcpy(cmd, &cmd32, sizeof(cmd32));
- cmd += sizeof(cmd32);
- rc = i2c_smbus_write_block_data(dev->on_file, NIC_WRITE_FILTER_CMD,
- cmd - buf, buf);
- if (rc < 0) {
- rc = errno;
- LOG_ERR(rc, "Failed to set ARP and ND filter to MDEF 1");
- return -rc;
- }
-
- /* make filter 0, matching MAC, to be mng only */
- cmd = buf;
- *cmd++ = NIC_FILTER_MNG_ONLY_NUM;
- cmd32 = htonl(NIC_FILTER_MNG_ONLY_FILTER0);
- memcpy(cmd, &cmd32, sizeof(cmd32));
- cmd += sizeof(cmd32);
- rc = i2c_smbus_write_block_data(dev->on_file, NIC_WRITE_FILTER_CMD,
- cmd - buf, buf);
- if (rc < 0) {
- rc = errno;
- LOG_ERR(rc, "Failed to enabled management only filter");
- return -rc;
- }
-
- return 0;
-}
-
-int oob_nic_start(oob_nic *dev, const uint8_t mac[6]) {
- int rc;
- uint8_t cmd;
-
- /* force the link up, no matter what the status of the main link */
- rc = oob_nic_set_force_up(dev, 1);
- if (rc != 0) {
- return rc;
- }
-
- oob_nic_setup_filters(dev, mac);
-
- /* first byte is the control */
- cmd = NIC_WRITE_RECV_ENABLE_EN
- | NIC_WRITE_RECV_ENABLE_STA
- | NIC_WRITE_RECV_ENABLE_NM_UNSUPP /* TODO, to support ALERT */
- | NIC_WRITE_RECV_ENABLE_RESERVED;
-
- rc = i2c_smbus_write_block_data(dev->on_file, NIC_WRITE_RECV_ENABLE_CMD,
- 1, &cmd);
- if (rc < 0) {
- rc = errno;
- LOG_ERR(rc, "Failed to start receive function");
- return -rc;
- }
- LOG_DBG("Started receive function");
- return 0;
-}
-
-int oob_nic_stop(oob_nic *dev) {
- int rc;
- uint8_t ctrl;
- /* don't set any enable bits, which turns off the receive func */
- ctrl = NIC_WRITE_RECV_ENABLE_RESERVED;
- rc = i2c_smbus_write_block_data(dev->on_file, NIC_WRITE_RECV_ENABLE_CMD,
- 1, &ctrl);
- if (rc < 0) {
- rc = errno;
- LOG_ERR(rc, "Failed to stop receive function");
- return -rc;
- }
- LOG_DBG("Stopped receive function");
- return 0;
-}
diff --git a/meta-facebook/meta-wedge/recipes-wedge/oob-nic/oob-nic/src/nic.h b/meta-facebook/meta-wedge/recipes-wedge/oob-nic/oob-nic/src/nic.h
deleted file mode 100644
index 1ac7ff8..0000000
--- a/meta-facebook/meta-wedge/recipes-wedge/oob-nic/oob-nic/src/nic.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Copyright 2014-present Facebook. All Rights Reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-#ifndef NIC_H
-#define NIC_H
-
-#include <stdint.h>
-
-#include "nic_defs.h"
-
-typedef struct oob_nic_t oob_nic;
-
-oob_nic* oob_nic_open(int bus, uint8_t addr);
-void oob_nic_close(oob_nic* dev);
-
-/* MAC */
-int oob_nic_get_mac(oob_nic *dev, uint8_t mac[6]);
-
-/* Status */
-typedef struct oob_nic_status_t oob_nic_status;
-int oob_nic_get_status(oob_nic *dev, oob_nic_status *status);
-
-int oob_nic_start(oob_nic *dev, const uint8_t mac[6]);
-int oob_nic_stop(oob_nic *dev);
-
-int oob_nic_send(oob_nic *dev, const uint8_t *data, int len);
-
-int oob_nic_receive(oob_nic *dev, uint8_t *buf, int len);
-
-#endif
diff --git a/meta-facebook/meta-wedge/recipes-wedge/oob-nic/oob-nic/src/nic_defs.h b/meta-facebook/meta-wedge/recipes-wedge/oob-nic/oob-nic/src/nic_defs.h
deleted file mode 100644
index 87574f0..0000000
--- a/meta-facebook/meta-wedge/recipes-wedge/oob-nic/oob-nic/src/nic_defs.h
+++ /dev/null
@@ -1,149 +0,0 @@
-/*
- * Copyright 2014-present Facebook. All Rights Reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-#ifndef NIC_DEFS_H
-#define NIC_DEFS_H
-
-#include <stdint.h>
-
-#define OOB_NIC_PKT_FRAGMENT_SIZE 240
-#define NIC_PKT_SIZE_MAX 1536
-
-/** Get System MAC Address */
-#define NIC_READ_MAC_CMD 0xD4
-#define NIC_READ_MAC_RES_OPT 0xD4
-#define NIC_READ_MAC_RES_LEN 7
-
-/** Read Status */
-#define NIC_READ_STATUS_CMD 0xDE
-#define NIC_READ_STATUS_RES_OPT 0xDD
-#define NIC_READ_STATUS_RES_LEN 3
-
-struct oob_nic_status_t {
- uint8_t ons_byte1;
- uint8_t ons_byte2;
-};
-
-#define NIC_STATUS_D1_POWER_DR 0x00
-#define NIC_STATUS_D1_POWER_D0U 0x01
-#define NIC_STATUS_D1_POWER_D0 0x10
-#define NIC_STATUS_D1_POWER_D3 0x11
-#define NIC_STATUS_D1_PORT_MSB (0x1 << 2)
-#define NIC_STATUS_D1_INIT (0x1 << 3)
-#define NIC_STATUS_D1_FORCE_UP (0x1 << 4)
-#define NIC_STATUS_D1_LINK (0x1 << 5)
-#define NIC_STATUS_D1_TCO_CMD_ABORT (0x1 << 6)
-#define NIC_STATUS_D1_PORT_LSB (0x1 << 7)
-
-#define NIC_STATUS_D2_ICR (0x1 << 1)
-#define NIC_STATUS_D2_IPI (0x1 << 2)
-#define NIC_STATUS_D2_DRV_VALID (0x1 << 3)
-
-/** Receive TCO Packet */
-#define NIC_READ_PKT_CMD 0xC0
-#define NIC_READ_PKT_RES_FIRST_OPT 0x90
-#define NIC_READ_PKT_RES_MIDDLE_OPT 0x10
-#define NIC_READ_PKT_RES_LAST_OPT 0x50
-#define NIC_READ_PKT_RES_LAST_LEN 17
-
-/** Transmit Packet */
-#define NIC_WRITE_PKT_SINGLE_CMD 0xC4
-#define NIC_WRITE_PKT_FIRST_CMD 0x84
-#define NIC_WRITE_PKT_MIDDLE_CMD 0x04
-#define NIC_WRITE_PKT_LAST_CMD 0x44
-
-/** Management Control */
-#define NIC_WRITE_MNG_CTRL_CMD 0xC1
-
-#define NIC_MNG_CTRL_KEEP_LINK_UP_NUM 0x00
-#define NIC_MNG_CTRL_KEEP_LINK_UP_ENABLE 0x01
-#define NIC_MNG_CTRL_KEEP_LINK_UP_DISABLE 0x00
-
-/** Update MNG RCV Filter Parameters */
-#define NIC_WRITE_FILTER_CMD 0xCC
-
-#define NIC_FILTER_MNG_ONLY_NUM 0xF
-#define NIC_FILTER_MNG_ONLY_FILTER0 (0x1)
-#define NIC_FILTER_MNG_ONLY_FILTER1 (0x1 << 1)
-#define NIC_FILTER_MNG_ONLY_FILTER2 (0x1 << 2)
-#define NIC_FILTER_MNG_ONLY_FILTER3 (0x1 << 3)
-#define NIC_FILTER_MNG_ONLY_FILTER4 (0x1 << 4)
-
-#define NIC_FILTER_MAC_NUM 0x66
-#define NIC_FILTER_MAC_PAIR0 0
-#define NIC_FILTER_MAC_PAIR1 1
-#define NIC_FILTER_MAC_PAIR2 2
-#define NIC_FILTER_MAC_PAIR3 3
-
-#define NIC_FILTER_ETHERTYPE_NUM 0x67
-#define NIC_FILTER_ETHERTYPE0 0
-#define NIC_FILTER_ETHERTYPE1 1
-#define NIC_FILTER_ETHERTYPE2 2
-#define NIC_FILTER_ETHERTYPE3 3
-
-#define NIC_FILTER_DECISION_EXT_NUM 0x68
-#define NIC_FILTER_MDEF0 0 /* index 0 */
-#define NIC_FILTER_MDEF1 1 /* index 1 */
-#define NIC_FILTER_MDEF2 2 /* index 2 */
-#define NIC_FILTER_MDEF3 3 /* index 3 */
-#define NIC_FILTER_MDEF4 4 /* index 4 */
-#define NIC_FILTER_MDEF5 5 /* index 5 */
-#define NIC_FILTER_MDEF6 6 /* index 6 */
-#define NIC_FILTER_MDEF7 7 /* index 7 */
-
-#define NIC_FILTER_MDEF_MAC_AND_OFFSET 0
-#define NIC_FILTER_MDEF_BCAST_AND_OFFSET 4
-#define NIC_FILTER_MDEF_VLAN_AND_OFFSET 5
-#define NIC_FILTER_MDEF_IPV4_AND_OFFSET 13
-#define NIC_FILTER_MDEF_IPV6_AND_OFFSET 17
-#define NIC_FILTER_MDEF_MAC_OR_OFFSET 21
-#define NIC_FILTER_MDEF_BCAST_OR_OFFSET 25
-#define NIC_FILTER_MDEF_MCAST_AND_OFFSET 26
-#define NIC_FILTER_MDEF_ARP_REQ_OR_OFFSET 27
-#define NIC_FILTER_MDEF_ARP_RES_OR_OFFSET 28
-#define NIC_FILTER_MDEF_NBG_OR_OFFSET 29
-#define NIC_FILTER_MDEF_PORT298_OR_OFFSET 30
-#define NIC_FILTER_MDEF_PORT26F_OR_OFFSET 31
-
-#define NIC_FILTER_MDEF_EXT_ETHTYPE_AND_OFFSET 0
-#define NIC_FILTER_MDEF_EXT_ETHTYPE_OR_OFFSET 8
-#define NIC_FILTER_MDEF_EXT_FLEX_PORT_OR_OFFSET 16
-#define NIC_FILTER_MDEF_EXT_FLEX_TCO_OR_OFFSET 24
-#define NIC_FILTER_MDEF_EXT_NCSI_DISABLE_OFFSET 28
-#define NIC_FILTER_MDEF_EXT_FLOW_CONTROL_DISCARD_OFFSET 29
-#define NIC_FILTER_MDEF_EXT_NET_EN_OFFSET 30
-#define NIC_FILTER_MDEF_EXT_HOST_EN_OFFSET 31
-
-#define NIC_FILTER_MDEF_BIT(offset) ((0x1) << (offset))
-#define NIC_FILTER_MDEF_BIT_VAL(offset, val) ((0x1) << ((offset) + (val)))
-
-/** Receive Enable */
-#define NIC_WRITE_RECV_ENABLE_CMD 0xCA
-#define NIC_WRITE_RECV_ENABLE_LEN_MAX 14
-
-#define NIC_WRITE_RECV_ENABLE_EN 0x1
-#define NIC_WRITE_RECV_ENABLE_ALL (0x1 << 1)
-#define NIC_WRITE_RECV_ENABLE_STA (0x1 << 2)
-#define NIC_WRITE_RECV_ENABLE_ARP_RES (0x1 << 3)
-#define NIC_WRITE_RECV_ENABLE_NM_ALERT (0x00 << 4)
-#define NIC_WRITE_RECV_ENABLE_NM_ASYNC (0x01 << 4)
-#define NIC_WRITE_RECV_ENABLE_NM_DIRECT (0x02 << 4)
-#define NIC_WRITE_RECV_ENABLE_NM_UNSUPP (0x03 << 4)
-#define NIC_WRITE_RECV_ENABLE_RESERVED (0x1 << 6)
-#define NIC_WRITE_RECV_ENABLE_CBDM (0x1 << 7)
-
-#endif
diff --git a/meta-facebook/meta-wedge/recipes-wedge/oob-nic/oob-nic_0.1.bb b/meta-facebook/meta-wedge/recipes-wedge/oob-nic/oob-nic_0.1.bb
deleted file mode 100644
index 82a5296..0000000
--- a/meta-facebook/meta-wedge/recipes-wedge/oob-nic/oob-nic_0.1.bb
+++ /dev/null
@@ -1,44 +0,0 @@
-# Copyright 2014-present Facebook. All Rights Reserved.
-#
-# This program file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program in a file named COPYING; if not, write to the
-# Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor,
-# Boston, MA 02110-1301 USA
-
-SUMMARY = "OOB Shared NIC driver"
-DESCRIPTION = "The shared-nic driver"
-SECTION = "base"
-PR = "r2"
-LICENSE = "GPLv2"
-LIC_FILES_CHKSUM = "file://main.c;beginline=4;endline=16;md5=da35978751a9d71b73679307c4d296ec"
-
-SRC_URI = "file://src \
- "
-
-S = "${WORKDIR}/src"
-
-DEPENDS += "openbmc-utils liblog libwedge-eeprom"
-
-RDEPENDS_${PN} += "libwedge-eeprom"
-
-do_install() {
- install -d ${D}${sbindir}
- install -m 755 oob-nic ${D}${sbindir}/oob-nic
- install -m 755 i2craw ${D}${sbindir}/i2craw
- install -d ${D}${sysconfdir}/init.d
- install -d ${D}${sysconfdir}/rcS.d
- install -m 755 etc/oob-nic.sh ${D}${sysconfdir}/init.d/oob-nic.sh
- update-rc.d -r ${D} oob-nic.sh start 80 S .
-}
-
-FILES_${PN} = " ${sbindir} ${sysconfdir} "
diff --git a/meta-facebook/meta-wedge/recipes-wedge/po-eeprom/files/Makefile b/meta-facebook/meta-wedge/recipes-wedge/po-eeprom/files/Makefile
deleted file mode 100644
index 0b3fd71..0000000
--- a/meta-facebook/meta-wedge/recipes-wedge/po-eeprom/files/Makefile
+++ /dev/null
@@ -1,26 +0,0 @@
-# Copyright 2014-present Facebook. All Rights Reserved.
-#
-# This program file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program in a file named COPYING; if not, write to the
-# Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor,
-# Boston, MA 02110-1301 USA
-
-all: po-eeprom
-
-po-eeprom: po-eeprom.o
- $(CC) -o $@ $^ $(LDFLAGS)
-
-.PHONY: clean
-
-clean:
- rm -rf *.o po-eeprom
diff --git a/meta-facebook/meta-wedge/recipes-wedge/po-eeprom/files/po-eeprom.c b/meta-facebook/meta-wedge/recipes-wedge/po-eeprom/files/po-eeprom.c
deleted file mode 100644
index 46debee..0000000
--- a/meta-facebook/meta-wedge/recipes-wedge/po-eeprom/files/po-eeprom.c
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * Copyright 2014-present Facebook. All Rights Reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-#include <stdio.h>
-#include <stdlib.h>
-#include <stdint.h>
-#include <unistd.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <errno.h>
-#include <sys/types.h>
-
-#define SERIAL_LEN 17
-
-usage()
-{
- fprintf(stderr, "Usage: po-eeprom filename [filename...]\n"
- "\twhere filename is the location of the PowerOne EEPROM, likely\n"
- "\t/sys/bus/i2c/drivers/at24/7-0051/eeprom or\n"
- "\t/sys/bus/i2c/drivers/at24/7-0052/eeprom\n");
- exit(2);
-}
-
-int safe_read(int fd, void *buf, size_t size, char *msg)
-{
- if (read(fd, buf, size) != size) {
- perror(msg);
- exit(3);
- }
-}
-
-int main(int argc, char **argv)
-{
- int fd;
- int file = 1;
- uint8_t size;
- uint8_t junk;
- uint16_t crc;
- char serial[SERIAL_LEN + 1];
-
- if (argc < 2)
- usage();
-
- while (file < argc) {
- fd = open(argv[file], O_RDONLY);
- if (fd < 0) {
- fprintf(stderr, "Couldn't open %s for EEPROM reading\n", argv[1]);
- exit(1);
- }
-
- safe_read(fd, &size, sizeof(size), "read size");
- safe_read(fd, &junk, sizeof(junk), "read junk");
- /*
- * Should probably check CRC here, PowerOne provided some code where
- * it looks like a pretty standard CCITT CRC16.
- */
- safe_read(fd, &crc, sizeof(crc), "read CRC len");
- safe_read(fd, serial, SERIAL_LEN, "read serial number");
-
- serial[SERIAL_LEN] = 0;
- printf("Serial number: %s\n", serial);
- close(fd);
- file++;
- }
-}
diff --git a/meta-facebook/meta-wedge/recipes-wedge/po-eeprom/po-eeprom_0.1.bb b/meta-facebook/meta-wedge/recipes-wedge/po-eeprom/po-eeprom_0.1.bb
deleted file mode 100644
index ad635dc..0000000
--- a/meta-facebook/meta-wedge/recipes-wedge/po-eeprom/po-eeprom_0.1.bb
+++ /dev/null
@@ -1,42 +0,0 @@
-# Copyright 2014-present Facebook. All Rights Reserved.
-#
-# This program file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program in a file named COPYING; if not, write to the
-# Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor,
-# Boston, MA 02110-1301 USA
-#
-
-SUMMARY = "PowerOne EEPROM Utilities"
-DESCRIPTION = "Util for PowerOne eeprom"
-SECTION = "base"
-PR = "r1"
-LICENSE = "GPLv2"
-LIC_FILES_CHKSUM = "file://po-eeprom.c;beginline=4;endline=16;md5=da35978751a9d71b73679307c4d296ec"
-
-SRC_URI = "file://po-eeprom.c \
- file://Makefile \
- "
-
-S = "${WORKDIR}"
-
-do_install() {
- install -d ${D}${bindir}
- install -m 0755 po-eeprom ${D}${bindir}/po-eeprom
-}
-
-FILES_${PN} = "${bindir}"
-
-# Inhibit complaints about .debug directories
-
-INHIBIT_PACKAGE_DEBUG_SPLIT = "1"
-INHIBIT_PACKAGE_STRIP = "1"
diff --git a/meta-facebook/meta-wedge/recipes-wedge/rackmon/rackmon/Makefile b/meta-facebook/meta-wedge/recipes-wedge/rackmon/rackmon/Makefile
deleted file mode 100644
index fa1e932..0000000
--- a/meta-facebook/meta-wedge/recipes-wedge/rackmon/rackmon/Makefile
+++ /dev/null
@@ -1,40 +0,0 @@
-# Copyright 2014-present Facebook. All Rights Reserved.
-#
-# This program file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program in a file named COPYING; if not, write to the
-# Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor,
-# Boston, MA 02110-1301 USA
-
-override CFLAGS+=-D_GNU_SOURCE -D_DEFAULT_SOURCE -D_POSIX_C_SOURCE=199309 -Wall -Werror -std=c99
-override LDFLAGS+=-pthread
-all: modbuscmd gpiowatch modbussim rackmond rackmondata
-
-rackmondata: rackmondata.c modbus.c
- $(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS)
-
-rackmond: rackmond.c modbus.c
- $(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS)
-
-modbuscmd: modbuscmd.c modbus.c
- $(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS)
-
-modbussim: modbussim.c modbus.c
- $(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS)
-
-gpiowatch: gpiowatch.c
- $(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS)
-
-.PHONY: clean
-
-clean:
- rm -rf *.o modbuscmd gpiowatch modbussim rackmond rackmondata
diff --git a/meta-facebook/meta-wedge/recipes-wedge/rackmon/rackmon/gpiowatch.c b/meta-facebook/meta-wedge/recipes-wedge/rackmon/rackmon/gpiowatch.c
deleted file mode 100644
index 11b5471..0000000
--- a/meta-facebook/meta-wedge/recipes-wedge/rackmon/rackmon/gpiowatch.c
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * Copyright 2014-present Facebook. All Rights Reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-
-#include <stdio.h>
-#include <string.h>
-#include <unistd.h>
-#include <stdlib.h>
-#include <errno.h>
-#include <fcntl.h>
-
-#define CHECK(x) { if((x) < 0) { \
- error = x; \
- goto cleanup; \
-} }
-
-#define CHECKNULL(x) { if((x) == NULL) { \
- error = -1; \
- goto cleanup; \
-} }
-
-typedef struct {
- int fd;
- int gpio;
- char value;
-} wgpio;
-
-int main(int argc, char **argv) {
- int error = 0;
- int nfds = argc - 1;
- int i = 0;
- int polliv = 10000;
- wgpio* wgpios = NULL;
-
- if(argc < 2) {
- fprintf(stderr, "Usage: %s <gpio num> [gpio num] [gpio num...]\n", argv[0]);
- exit(1);
- }
- if(getenv("POLL_US")) {
- polliv = atoi(getenv("POLL_US"));
- }
-
- wgpios = calloc(nfds, sizeof(wgpio));
- CHECKNULL(wgpios)
-
- fprintf(stderr, "Watching %d gpios:", nfds);
- for(i = 1; i < argc; i++) {
- char filename[255];
- int gpio_num = atoi(argv[i]);
- wgpios[i - 1].gpio = gpio_num;
- snprintf(filename, 255, "/sys/class/gpio/gpio%d/value", gpio_num);
- wgpios[i - 1].fd = open(filename, O_RDONLY);
- CHECK(wgpios[i - 1].fd);
- CHECK(read(wgpios[i - 1].fd, &(wgpios[i - 1].value), 1));
- fprintf(stderr, " %d (currently: %c)", gpio_num, wgpios[i - 1].value);
- }
- fprintf(stderr, "\n");
-
- do {
- usleep(polliv);
- for(i = 0; i < nfds; i++) {
- wgpio* w = &wgpios[i];
- char value;
- lseek(w->fd, 0, SEEK_SET);
- CHECK(read(w->fd, &value, 1));
- if(value != w->value) {
- printf("GPIO%d: %c -> %c\n", w->gpio, w->value, value);
- w->value = value;
- }
- }
- } while (1);
-
-cleanup:
- if(error != 0) {
- fprintf(stderr, "Error %d: %s\n", errno, strerror(errno));
- error = 1;
- }
- return error;
-}
diff --git a/meta-facebook/meta-wedge/recipes-wedge/rackmon/rackmon/hexfile.py b/meta-facebook/meta-wedge/recipes-wedge/rackmon/rackmon/hexfile.py
deleted file mode 100644
index c484fdf..0000000
--- a/meta-facebook/meta-wedge/recipes-wedge/rackmon/rackmon/hexfile.py
+++ /dev/null
@@ -1,174 +0,0 @@
-# The MIT License (MIT)
-# =====================
-#
-# Copyright (c) 2014 Ryan Sturmer
-#
-# Permission is hereby granted, free of charge, to any person obtaining a copy
-# of this software and associated documentation files (the "Software"), to deal
-# in the Software without restriction, including without limitation the rights
-# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-# copies of the Software, and to permit persons to whom the Software is
-# furnished to do so, subject to the following conditions:
-#
-# The above copyright notice and this permission notice shall be included in all
-# copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-# SOFTWARE.
-
-# https://github.com/ryansturmer/hexfile/blob/master/hexfile/core.py
-
-import itertools
-
-def short(msb,lsb):
- return (msb<<8) | lsb
-
-class HexFile(object):
- def __init__(self, segments):
- self.segments = segments
-
- def __getitem__(self, val):
- if isinstance(val, slice):
- address = val.start
- else:
- address = val
-
- for segment in self.segments:
- if address in segment:
- return segment[val]
-
- raise IndexError('No segment contains address 0x%x' % address)
-
- def __len__(self):
- return sum(map(len, self.segments))
-
- @property
- def size(self):
- return len(self)
-
- def __iter__(self):
- return itertools.chain(*self.segments)
-
- @staticmethod
- def load(filename):
- segments = [Segment(0)]
-
- with open(filename) as fp:
- lines = fp.readlines()
-
- extended_linear_address = 0
- current_address = 0
- end_of_file = False
-
- lineno = 0
- for line in lines:
- lineno += 1
- line = line.strip();
- if not line.startswith(':'):
- continue
-
- if end_of_file:
- raise Exception("Record found after end of file on line %d" % lineno)
-
- bytes = [int(line[i:i+2], 16) for i in range(1,len(line), 2)]
- byte_count = bytes[0]
- address = short(*bytes[1:3])
- record_type = bytes[3]
- checksum = bytes[-1]
- data = bytes[4:-1]
- computed_checksum = ((1 << 8)-(sum(bytes[:-1]) & 0xff)) & 0xff
-
- if(computed_checksum != checksum):
- raise Exception("Record checksum doesn't match on line %d" % lineno)
-
- if record_type == 0:
- if byte_count == len(data):
- current_address = (address | extended_linear_address)
- have_segment = False
- for segment in segments:
- if segment.end_address == current_address:
- segment.data.extend(data)
- have_segment = True
- break
- if not have_segment:
- segments.append(Segment(current_address, data))
- else:
- raise Exception("Data record reported size does not match actual size on line %d" % lineno)
- elif record_type == 1:
- end_of_file = True
- elif record_type == 4:
- if byte_count != 2 or len(data) != 2:
- raise Exception("Byte count misreported in extended linear address record on line %d" % lineno)
- extended_linear_address = short(*data) << 16
-
- else:
- raise Exception("Unknown record type: %s" % record_type)
- return HexFile(segments)
-
- def pretty_string(self, stride=16):
- retval = []
- for segment in self.segments:
- retval.append('Segment @ 0x%08x (%d bytes)' % (segment.start_address, segment.size))
- retval.append(segment.pretty_string(stride=stride))
- retval.append('')
- return '\n'.join(retval)
-
-def load(filename):
- return HexFile.load(filename)
-
-class Segment(object):
- def __init__(self, start_address, data = None):
- self.start_address = start_address
- self.data = data or []
-
- def pretty_string(self, stride=16):
- retval = []
- addresses = self.addresses
- ranges = [addresses[i:i+stride] for i in range(0, self.size, stride)]
- for r in ranges:
- retval.append('%08x ' % r[0] + ' '.join(['%02x' % self[addr] for addr in r]))
- return '\n'.join(retval)
-
- def __str__(self):
- return '<%d byte segment @ 0x%08x>' % (self.size, self.start_address)
- def __repr__(self):
- return str(self)
-
- @property
- def end_address(self):
- return self.start_address + len(self.data)
-
- @property
- def size(self):
- return len(self.data)
-
- def __contains__(self, address):
- return address >= self.start_address and address < self.end_address
-
- def __getitem__(self, address):
- if isinstance(address, slice):
- if address.start not in self or address.stop-1 not in self:
- raise IndexError('Address out of range for this segment')
- else:
- d = self.data[address.start-self.start_address:address.stop-self.start_address:address.step]
- start_address = address.start + self.start_address
- return Segment(start_address, d)
- else:
- if not address in self:
- raise IndexError("Address 0x%x is not in this segment" % address)
- return self.data[address-self.start_address]
-
- @property
- def addresses(self):
- return range(self.start_address, self.end_address)
-
- def __len__(self):
- return len(self.data)
-
- def __iter__(self):
- return iter(self.data)
diff --git a/meta-facebook/meta-wedge/recipes-wedge/rackmon/rackmon/modbus.c b/meta-facebook/meta-wedge/recipes-wedge/rackmon/rackmon/modbus.c
deleted file mode 100644
index 8fb0835..0000000
--- a/meta-facebook/meta-wedge/recipes-wedge/rackmon/rackmon/modbus.c
+++ /dev/null
@@ -1,352 +0,0 @@
-/*
- * Copyright 2014-present Facebook. All Rights Reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-
-#include <time.h>
-#include "modbus.h"
-#include <termios.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <stdlib.h>
-#include <stdint.h>
-#include <stdio.h>
-#include <string.h>
-#include <errno.h>
-#include <sys/ioctl.h>
-#include <sched.h>
-#include <pthread.h>
-
-int verbose = 0;
-
-#define TIOCSERWAITTEMT 0x5499
-int waitfd(int fd) {
- int loops = 0;
- ioctl(fd, TIOCSERWAITTEMT, DEFAULT_GPIO);
- while(1) {
- int lsr;
- int ret = ioctl(fd, TIOCSERGETLSR, &lsr);
- if(ret == -1) {
- fprintf(stderr, "Error checking ioctl: %s\n", strerror(errno));
- break;
- }
- if(lsr & TIOCSER_TEMT) break;
- // never should hit this with new ioctl
- loops++;
- }
- return loops;
-}
-
-void gpio_on(int fd) {
- lseek(fd, 0, SEEK_SET);
- write(fd, "1", 1);
-}
-
-void gpio_off(int fd) {
- lseek(fd, 0, SEEK_SET);
- write(fd, "0", 1);
-}
-
-void decode_hex_in_place(char* buf, size_t* len) {
- for(int i = 0; i < *len; i+=2) {
- sscanf(buf + i, "%2hhx", buf + (i / 2));
- }
- *len = *len / 2;
-}
-
-void append_modbus_crc16(char* buf, size_t* len) {
- uint16_t crc = modbus_crc16(buf, *len);
- dbg("[*] Append Modbus CRC16 %04x\n", crc);
- buf[(*len)++] = crc >> 8;
- buf[(*len)++] = crc & 0x00FF;
-}
-
-void print_hex(FILE* f, char* buf, size_t len) {
- for(int i = 0; i < len; i++)
- fprintf(f, "%02x ", buf[i]);
-}
-
-size_t read_wait(int fd, char* dst, size_t maxlen, int mdelay_us) {
- fd_set fdset;
- struct timeval timeout;
- char read_buf[16];
- size_t read_size = 0;
- size_t pos = 0;
- memset(dst, 0, maxlen);
- while(pos < maxlen) {
- FD_ZERO(&fdset);
- FD_SET(fd, &fdset);
- timeout.tv_sec = 0;
- timeout.tv_usec = mdelay_us;
- int rv = select(fd + 1, &fdset, NULL, NULL, &timeout);
- if(rv == -1) {
- perror("select()");
- } else if (rv == 0) {
- break;
- }
- read_size = read(fd, read_buf, 16);
- if(read_size < 0) {
- if(errno == EAGAIN) continue;
- fprintf(stderr, "read error: %s\n", strerror(errno));
- exit(1);
- }
- if((pos + read_size) <= maxlen) {
- memcpy(dst + pos, read_buf, read_size);
- pos += read_size;
- } else {
- return pos;
- fprintf(stderr, "Response buffer overflowed!\n");
- }
- }
- return pos;
-}
-
-/* From libmodbus, https://github.com/stephane/libmodbus
- * Under LGPL. */
-/* Table of CRC values for high-order byte */
-static const uint8_t table_crc_hi[] = {
- 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x01, 0xC0,
- 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41,
- 0x00, 0xC1, 0x81, 0x40, 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0,
- 0x80, 0x41, 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40,
- 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1,
- 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x01, 0xC0, 0x80, 0x41,
- 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1,
- 0x81, 0x40, 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41,
- 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x01, 0xC0,
- 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40, 0x00, 0xC1, 0x81, 0x40,
- 0x01, 0xC0, 0x80, 0x41, 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1,
- 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40,
- 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x01, 0xC0,
- 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40, 0x00, 0xC1, 0x81, 0x40,
- 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0,
- 0x80, 0x41, 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40,
- 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x01, 0xC0,
- 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41,
- 0x00, 0xC1, 0x81, 0x40, 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0,
- 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41,
- 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0,
- 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40, 0x00, 0xC1, 0x81, 0x40,
- 0x01, 0xC0, 0x80, 0x41, 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1,
- 0x81, 0x40, 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41,
- 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x01, 0xC0,
- 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40
-};
-
-/* Table of CRC values for low-order byte */
-static const uint8_t table_crc_lo[] = {
- 0x00, 0xC0, 0xC1, 0x01, 0xC3, 0x03, 0x02, 0xC2, 0xC6, 0x06,
- 0x07, 0xC7, 0x05, 0xC5, 0xC4, 0x04, 0xCC, 0x0C, 0x0D, 0xCD,
- 0x0F, 0xCF, 0xCE, 0x0E, 0x0A, 0xCA, 0xCB, 0x0B, 0xC9, 0x09,
- 0x08, 0xC8, 0xD8, 0x18, 0x19, 0xD9, 0x1B, 0xDB, 0xDA, 0x1A,
- 0x1E, 0xDE, 0xDF, 0x1F, 0xDD, 0x1D, 0x1C, 0xDC, 0x14, 0xD4,
- 0xD5, 0x15, 0xD7, 0x17, 0x16, 0xD6, 0xD2, 0x12, 0x13, 0xD3,
- 0x11, 0xD1, 0xD0, 0x10, 0xF0, 0x30, 0x31, 0xF1, 0x33, 0xF3,
- 0xF2, 0x32, 0x36, 0xF6, 0xF7, 0x37, 0xF5, 0x35, 0x34, 0xF4,
- 0x3C, 0xFC, 0xFD, 0x3D, 0xFF, 0x3F, 0x3E, 0xFE, 0xFA, 0x3A,
- 0x3B, 0xFB, 0x39, 0xF9, 0xF8, 0x38, 0x28, 0xE8, 0xE9, 0x29,
- 0xEB, 0x2B, 0x2A, 0xEA, 0xEE, 0x2E, 0x2F, 0xEF, 0x2D, 0xED,
- 0xEC, 0x2C, 0xE4, 0x24, 0x25, 0xE5, 0x27, 0xE7, 0xE6, 0x26,
- 0x22, 0xE2, 0xE3, 0x23, 0xE1, 0x21, 0x20, 0xE0, 0xA0, 0x60,
- 0x61, 0xA1, 0x63, 0xA3, 0xA2, 0x62, 0x66, 0xA6, 0xA7, 0x67,
- 0xA5, 0x65, 0x64, 0xA4, 0x6C, 0xAC, 0xAD, 0x6D, 0xAF, 0x6F,
- 0x6E, 0xAE, 0xAA, 0x6A, 0x6B, 0xAB, 0x69, 0xA9, 0xA8, 0x68,
- 0x78, 0xB8, 0xB9, 0x79, 0xBB, 0x7B, 0x7A, 0xBA, 0xBE, 0x7E,
- 0x7F, 0xBF, 0x7D, 0xBD, 0xBC, 0x7C, 0xB4, 0x74, 0x75, 0xB5,
- 0x77, 0xB7, 0xB6, 0x76, 0x72, 0xB2, 0xB3, 0x73, 0xB1, 0x71,
- 0x70, 0xB0, 0x50, 0x90, 0x91, 0x51, 0x93, 0x53, 0x52, 0x92,
- 0x96, 0x56, 0x57, 0x97, 0x55, 0x95, 0x94, 0x54, 0x9C, 0x5C,
- 0x5D, 0x9D, 0x5F, 0x9F, 0x9E, 0x5E, 0x5A, 0x9A, 0x9B, 0x5B,
- 0x99, 0x59, 0x58, 0x98, 0x88, 0x48, 0x49, 0x89, 0x4B, 0x8B,
- 0x8A, 0x4A, 0x4E, 0x8E, 0x8F, 0x4F, 0x8D, 0x4D, 0x4C, 0x8C,
- 0x44, 0x84, 0x85, 0x45, 0x87, 0x47, 0x46, 0x86, 0x82, 0x42,
- 0x43, 0x83, 0x41, 0x81, 0x80, 0x40
-};
-
-uint16_t modbus_crc16(char* buffer, size_t buffer_length) {
- uint8_t crc_hi = 0xFF; /* high CRC byte initialized */
- uint8_t crc_lo = 0xFF; /* low CRC byte initialized */
- unsigned int i; /* will index into CRC lookup */
-
- /* pass through message buffer */
- while (buffer_length--) {
- i = crc_hi ^ *((uint8_t*)(buffer++)); /* calculate the CRC */
- crc_hi = crc_lo ^ table_crc_hi[i];
- crc_lo = table_crc_lo[i];
- }
-
- return (crc_hi << 8 | crc_lo);
-}
-
-
-double ts_diff (struct timespec* begin, struct timespec* end) {
- return 1000.0 * (end->tv_sec) + (1e-6 * end->tv_nsec)
- - (1000.0 * (begin->tv_sec) + (1e-6 * begin->tv_nsec));
-}
-
-static long success = 0;
-static long crcfail = 0;
-static long timeout = 0;
-static long stat_wait = 0;
-
-int modbuscmd(modbus_req *req) {
- int error = 0;
- struct termios tio;
- char modbus_cmd[req->cmd_len + 2];
- size_t cmd_len = req->cmd_len;
-
- if (verbose)
- fprintf(stderr, "[*] Setting TTY flags!\n");
- memset(&tio, 0, sizeof(tio));
- // CREAD should be left *off* until we've confirmed THRE
- // to avoid catching false character starts
- cfsetspeed(&tio,B19200);
- tio.c_cflag |= PARENB;
- tio.c_cflag |= CLOCAL;
- tio.c_cflag |= CS8;
- tio.c_iflag |= INPCK;
- tio.c_cc[VMIN] = 1;
- tio.c_cc[VTIME] = 0;
- CHECK(tcsetattr(req->tty_fd,TCSANOW,&tio));
-
- memcpy(modbus_cmd, req->modbus_cmd, cmd_len);
- append_modbus_crc16(modbus_cmd, &cmd_len);
-
- // print command as sent
- if (verbose) {
- fprintf(stderr, "Will send: ");
- print_hex(stderr, modbus_cmd, cmd_len);
- fprintf(stderr, "\n");
- }
-
- dbg("[*] Writing!\n");
-
- // hoped adding the ioctl to do the switching would have alleviated the
- // need to do SCHED_FIFO, but we still get preempted between the write and
- // ioctl syscalls w/o it often enough to break f/w updates.
- struct sched_param sp;
- sp.sched_priority = 50;
- int policy = SCHED_FIFO;
- CHECKP(sched, pthread_setschedparam(pthread_self(), policy, &sp));
- // gpio on, write, wait, gpio off
- gpio_on(req->gpio_fd);
- struct timespec write_begin;
- struct timespec wait_begin;
- struct timespec wait_end;
- struct timespec read_end;
- clock_gettime(CLOCK_MONOTONIC_RAW, &write_begin);
- write(req->tty_fd, modbus_cmd, cmd_len);
- clock_gettime(CLOCK_MONOTONIC_RAW, &wait_begin);
- int waitloops = waitfd(req->tty_fd);
- clock_gettime(CLOCK_MONOTONIC_RAW, &wait_end);
- gpio_off(req->gpio_fd);
- sp.sched_priority = 0;
- // Enable UART read
- tio.c_cflag |= CREAD;
- CHECK(tcsetattr(req->tty_fd,TCSANOW,&tio));
- policy = SCHED_OTHER;
- CHECKP(sched, pthread_setschedparam(pthread_self(), policy, &sp));
-
- dbg("[*] waitfd loops: %d\n", waitloops);
- dbg("[*] reading any response...\n");
- // Read back response
- size_t mb_pos = 0;
- memset(req->dest_buf, 0, req->dest_limit);
- if(req->expected_len == 0) {
- req->expected_len = req->dest_limit;
- }
- if(req->expected_len > req->dest_limit) {
- return -1;
- }
- mb_pos = read_wait(req->tty_fd, req->dest_buf, req->expected_len, req->timeout);
- clock_gettime(CLOCK_MONOTONIC_RAW, &read_end);
- req->dest_len = mb_pos;
- if(mb_pos >= 4) {
- uint16_t crc = modbus_crc16(req->dest_buf, mb_pos - 2);
- dbg("Modbus response CRC: %04X\n ", crc);
- if((req->dest_buf[mb_pos - 2] == (crc >> 8)) &&
- (req->dest_buf[mb_pos - 1] == (crc & 0x00FF))) {
- dbg("CRC OK!\n");
- } else {
- dbg("BAD CRC :(\n");
- fprintf(stderr, "bad crc timings:");
- fprintf(stderr, " write: %.2f ms", ts_diff(&write_begin, &wait_begin));
- fprintf(stderr, " wait: %.2f ms", ts_diff(&wait_begin, &wait_end));
- fprintf(stderr, " read: %.2f ms\n", ts_diff(&wait_end, &read_end));
- if(!req->scan) {
- crcfail++;
- }
- if(verbose) {
- print_hex(stderr, req->dest_buf, mb_pos);
- }
- return MODBUS_BAD_CRC;
- }
- } else {
- fprintf(stderr, "timeout timings:");
- fprintf(stderr, " write: %.2f ms", ts_diff(&write_begin, &wait_begin));
- fprintf(stderr, " wait: %.2f ms", ts_diff(&wait_begin, &wait_end));
- fprintf(stderr, " wait: %d iters", waitloops);
- fprintf(stderr, " read: %.2f ms\n", ts_diff(&wait_end, &read_end));
- dbg("No response :(\n");
- if(!req->scan) {
- timeout++;
- }
- return MODBUS_RESPONSE_TIMEOUT;
- }
-
-cleanup:
- if(error != 0) {
- error = -1;
- fprintf(stderr, "%s\n", strerror(errno));
- } else {
- //fprintf(stderr, "success, timings:");
- //fprintf(stderr, " write: %.2f ms", ts_diff(&write_begin, &wait_begin));
- //fprintf(stderr, " wait: %.2f ms", ts_diff(&wait_begin, &wait_end));
- //fprintf(stderr, " read: %.2f ms -- ", ts_diff(&wait_end, &read_end));
- if(stat_wait == 0 && !req->scan) {
- fprintf(stderr, "success: %.2f%% crcfail %.2f%%, timeout %.2f%%\n",
- ((double) 100.0 * success / (success + crcfail + timeout)),
- ((double) 100.0 * crcfail / (success + crcfail + timeout)),
- ((double) 100.0 * timeout / (success + crcfail + timeout)));
- stat_wait = 1000;
- fprintf(stderr, "success timings:");
- fprintf(stderr, " write: %.2f ms", ts_diff(&write_begin, &wait_begin));
- fprintf(stderr, " wait: %.2f ms", ts_diff(&wait_begin, &wait_end));
- fprintf(stderr, " wait: %d iters", waitloops);
- fprintf(stderr, " read: %.2f ms\n", ts_diff(&wait_end, &read_end));
- } else if (!req->scan) {
- stat_wait--;
- }
- if(!req->scan) {
- success++;
- }
- }
- return 0;
-}
-
-const char* modbus_strerror(int mb_err) {
- if (mb_err < 0) {
- mb_err = -mb_err;
- }
- switch(mb_err) {
- case 4:
- return "timed out";
- case 5:
- return "crc check failed";
- default:
- return "unknown";
- }
-}
diff --git a/meta-facebook/meta-wedge/recipes-wedge/rackmon/rackmon/modbus.h b/meta-facebook/meta-wedge/recipes-wedge/rackmon/rackmon/modbus.h
deleted file mode 100644
index 1354feb..0000000
--- a/meta-facebook/meta-wedge/recipes-wedge/rackmon/rackmon/modbus.h
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * Copyright 2014-present Facebook. All Rights Reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-
-#ifndef MODBUS_H_
-#define MODBUS_H_
-#include <stddef.h>
-#include <stdint.h>
-#include <stdio.h>
-uint16_t modbus_crc16(char* buffer, size_t length);
-
-#define DEFAULT_TTY "/dev/ttyS3"
-#define DEFAULT_GPIO 45
-
-extern int verbose;
-#define dbg(...) if(verbose) { fprintf(stderr, __VA_ARGS__); }
-#define log(...) { fprintf(stderr, __VA_ARGS__); }
-
-#define CHECK(expr) { int _check = expr; if((_check) < 0) { \
- error = _check; \
- goto cleanup; \
-} }
-#define CHECKP(name, expr) { int _check = expr; if((_check) < 0) { \
- error = _check; \
- perror(#name); \
- goto cleanup; \
-} }
-#define BAIL(...) { \
- fprintf(stderr, __VA_ARGS__); \
- fflush(stderr); \
- error = -1; \
- goto cleanup; \
-}
-
-int waitfd(int fd);
-void gpio_on(int fd);
-void gpio_off(int fd);
-void decode_hex_in_place(char* buf, size_t* len);
-void append_modbus_crc16(char* buf, size_t* len);
-void print_hex(FILE* f, char* buf, size_t len);
-
-// Read until maxlen bytes or no bytes in mdelay_us microseconds
-size_t read_wait(int fd, char* dst, size_t maxlen, int mdelay_us);
-
-
-typedef struct _modbus_req {
- int tty_fd;
- int gpio_fd;
- const char *modbus_cmd;
- size_t cmd_len;
- int timeout;
- size_t expected_len;
- char *dest_buf;
- size_t dest_limit;
- size_t dest_len;
- int scan;
-} modbus_req;
-
-int modbuscmd(modbus_req *req);
-// Modbus errors
-
-#define MODBUS_RESPONSE_TIMEOUT -4
-#define MODBUS_BAD_CRC -5
-
-const char* modbus_strerror(int mb_err);
-
-// Modbus constants
-#define MODBUS_READ_HOLDING_REGISTERS 3
-
-
-#endif
diff --git a/meta-facebook/meta-wedge/recipes-wedge/rackmon/rackmon/modbuscmd.c b/meta-facebook/meta-wedge/recipes-wedge/rackmon/rackmon/modbuscmd.c
deleted file mode 100644
index 78f62a1..0000000
--- a/meta-facebook/meta-wedge/recipes-wedge/rackmon/rackmon/modbuscmd.c
+++ /dev/null
@@ -1,131 +0,0 @@
-/*
- * Copyright 2014-present Facebook. All Rights Reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-
-#include <errno.h>
-#include <fcntl.h>
-#include <getopt.h>
-#include <sched.h>
-#include <stdint.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-#include <sys/ioctl.h>
-#include <sys/socket.h>
-#include <sys/types.h>
-#include <sys/un.h>
-#include "modbus.h"
-#include "rackmond.h"
-
-void usage() {
- fprintf(stderr,
- "modbuscmd [-v] [-t <timeout in ms>] [-x <expected response length>] modbus_command\n"
- "\tmodbus command should be specified in hex\n"
- "\teg:\ta40300000008\n"
- "\tif an expected response length is provided, modbuscmd will stop receving and check crc immediately "
- "after receiving that many bytes\n");
- exit(1);
-}
-
-
-int main(int argc, char **argv) {
- int error = 0;
- char *modbus_cmd = NULL;
- size_t cmd_len = 0;
- int expected = 0;
- uint32_t timeout = 0;
- verbose = 0;
- rackmond_command *cmd = NULL;
- char *response = NULL;
- int clisock;
- uint16_t response_len_actual;
- struct sockaddr_un rackmond_addr;
-
- int opt;
- while((opt = getopt(argc, argv, "w:x:t:g:v")) != -1) {
- switch (opt) {
- case 'x':
- expected = atoi(optarg);
- break;
- case 't':
- timeout = atol(optarg);
- break;
- case 'v':
- verbose = 1;
- break;
- default:
- usage();
- break;
- }
- }
- if(optind < argc) {
- modbus_cmd = argv[optind];
- }
- if(modbus_cmd == NULL) {
- usage();
- }
-
- //convert hex to bytes
- cmd_len = strlen(modbus_cmd);
- if(cmd_len < 4) {
- fprintf(stderr, "Modbus command too short!\n");
- exit(1);
- }
- decode_hex_in_place(modbus_cmd, &cmd_len);
- cmd = malloc(sizeof(rackmond_command) + cmd_len);
- cmd->type = COMMAND_TYPE_RAW_MODBUS;
- cmd->raw_modbus.length = cmd_len;
- cmd->raw_modbus.custom_timeout = timeout;
- memcpy(cmd->raw_modbus.data, modbus_cmd, cmd_len);
- cmd->raw_modbus.expected_response_length = expected;
- response = malloc(expected ? expected : 1024);
- uint16_t wire_cmd_len = sizeof(rackmond_command) + cmd_len;
-
- clisock = socket(AF_UNIX, SOCK_STREAM, 0);
- CHECKP(socket, clisock);
- rackmond_addr.sun_family = AF_UNIX;
- strcpy(rackmond_addr.sun_path, "/var/run/rackmond.sock");
- int addr_len = strlen(rackmond_addr.sun_path) + sizeof(rackmond_addr.sun_family);
- CHECKP(connect, connect(clisock, (struct sockaddr*) &rackmond_addr, addr_len));
- CHECKP(send, send(clisock, &wire_cmd_len, sizeof(wire_cmd_len), 0));
- CHECKP(send, send(clisock, cmd, wire_cmd_len, 0));
- CHECKP(recv, recv(clisock, &response_len_actual, sizeof(response_len_actual), 0));
- if(response_len_actual == 0) {
- uint16_t errcode = 0;
- CHECKP(recv, recv(clisock, &errcode, sizeof(errcode), 0));
- fprintf(stderr, "modbus error: %d (%s)\n", errcode, modbus_strerror(errcode));
- error = 1;
- goto cleanup;
- }
- CHECKP(recv, recv(clisock, response, response_len_actual, 0));
- if(error == 0) {
- printf("Response: ");
- print_hex(stdout, response, response_len_actual);
- printf("\n");
- }
-cleanup:
- free(cmd);
- free(response);
- if(error != 0) {
- if(errno != 0) {
- fprintf(stderr, "errno err: %s\n", strerror(errno));
- }
- error = 1;
- }
- return error;
-}
diff --git a/meta-facebook/meta-wedge/recipes-wedge/rackmon/rackmon/modbussim.c b/meta-facebook/meta-wedge/recipes-wedge/rackmon/rackmon/modbussim.c
deleted file mode 100644
index e276501..0000000
--- a/meta-facebook/meta-wedge/recipes-wedge/rackmon/rackmon/modbussim.c
+++ /dev/null
@@ -1,181 +0,0 @@
-/*
- * Copyright 2014-present Facebook. All Rights Reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-
-#include <termios.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <stdlib.h>
-#include <stdint.h>
-#include <stdio.h>
-#include <string.h>
-#include <errno.h>
-#include <sys/ioctl.h>
-#include <getopt.h>
-#include "modbus.h"
-
-void usage() {
- fprintf(stderr,
- "modbussim [-v] [-t <tty>] [-g <gpio>] modbus_request modbus_reply\n"
- "\ttty defaults to %s\n"
- "\tgpio defaults to %d\n"
- "\tmodbus request/reply should be specified in hex\n"
- "\teg:\ta40300000008\n",
- DEFAULT_TTY, DEFAULT_GPIO);
- exit(1);
-}
-
-int main(int argc, char **argv) {
- int error = 0;
- int fd;
- struct termios tio;
- char gpio_filename[255];
- int gpio_fd = 0;
- int gpio_n = DEFAULT_GPIO;
- char *tty = DEFAULT_TTY;
- char *modbus_cmd = NULL;
- char *modbus_reply = NULL;
- size_t cmd_len = 0;
- size_t reply_len = 0;
- verbose = 0;
-
- int opt;
- while((opt = getopt(argc, argv, "t:g:v"))) {
- if (opt == -1) break;
- switch (opt) {
- case 't':
- tty = optarg;
- break;
- case 'g':
- gpio_n = atoi(optarg);
- break;
- case 'v':
- verbose = 1;
- break;
- default:
- usage();
- break;
- }
- }
- if(optind < argc) {
- modbus_cmd = argv[optind++];
- modbus_reply = argv[optind++];
- }
- if(modbus_cmd == NULL || modbus_reply == NULL) {
- usage();
- }
-
- if (verbose)
- fprintf(stderr, "[*] Opening TTY\n");
- fd = open(tty, O_RDWR | O_NOCTTY);
- CHECK(fd);
-
- if (verbose)
- fprintf(stderr, "[*] Opening GPIO %d\n", gpio_n);
- snprintf(gpio_filename, 255, "/sys/class/gpio/gpio%d/value", gpio_n);
- gpio_fd = open(gpio_filename, O_WRONLY | O_SYNC);
- CHECK(gpio_fd);
-
- if (verbose)
- fprintf(stderr, "[*] Setting TTY flags!\n");
- memset(&tio, 0, sizeof(tio));
- cfsetspeed(&tio,B19200);
- tio.c_cflag |= PARENB;
- tio.c_cflag |= CLOCAL;
- tio.c_cflag |= CS8;
- tio.c_iflag |= INPCK;
- tio.c_cc[VMIN] = 1;
- tio.c_cc[VTIME] = 0;
- CHECK(tcsetattr(fd,TCSANOW,&tio));
-
- //convert hex to bytes
- cmd_len = strlen(modbus_cmd);
- if(cmd_len < 2) {
- fprintf(stderr, "Command too short!\n");
- exit(1);
- }
- decode_hex_in_place(modbus_cmd, &cmd_len);
- append_modbus_crc16(modbus_cmd, &cmd_len);
- if (verbose) {
- fprintf(stderr, "expect: ");
- print_hex(stderr, modbus_cmd, cmd_len);
- fprintf(stderr, "\n");
- }
- reply_len = strlen(modbus_reply);
- decode_hex_in_place(modbus_reply, &reply_len);
- append_modbus_crc16(modbus_reply, &reply_len);
- // print full expected reply
- if (verbose) {
- fprintf(stderr, "reply: ");
- print_hex(stderr, modbus_reply, reply_len);
- fprintf(stderr, "\n");
- }
-
- // Enable UART read
- tio.c_cflag |= CREAD;
- CHECK(tcsetattr(fd,TCSANOW,&tio));
- gpio_off(gpio_fd);
-
- if(verbose)
- fprintf(stderr, "[*] Wait for matching command...\n");
-
- char modbus_buf[255];
- size_t mb_pos;
-wait_for_command:
- mb_pos = read_wait(fd, modbus_buf, sizeof(modbus_buf), 30000);
- if(mb_pos >= 4) {
- printf("Received: ");
- print_hex(stdout, modbus_buf, mb_pos);
- uint16_t crc = modbus_crc16(modbus_buf, mb_pos - 2);
- if((modbus_buf[mb_pos - 2] == (crc >> 8)) &&
- (modbus_buf[mb_pos - 1] == (crc & 0x00FF))) {
- if(verbose)
- fprintf(stderr, "CRC OK!\n");
- if(memcmp(modbus_buf, modbus_cmd, cmd_len) == 0) {
- fprintf(stderr, "Command matched!\n");
- } else {
- fprintf(stderr, "Got modbus cmd that didn't match.\n");
- goto wait_for_command;
- }
- } else {
- fprintf(stderr, "Got data that failed modbus CRC.\n");
- goto wait_for_command;
- }
- } else {
- goto wait_for_command;
- }
-
-
- if (verbose)
- fprintf(stderr, "[*] Writing reply!\n");
-
- // Disable UART read
- tio.c_cflag &= ~CREAD;
- CHECK(tcsetattr(fd,TCSANOW,&tio));
- // gpio on, write, wait, gpio off
- gpio_on(gpio_fd);
- write(fd, modbus_reply, reply_len);
- waitfd(fd);
- gpio_off(gpio_fd);
-
-cleanup:
- if(error != 0) {
- error = 1;
- fprintf(stderr, "%s\n", strerror(errno));
- }
- return error;
-}
diff --git a/meta-facebook/meta-wedge/recipes-wedge/rackmon/rackmon/psu-update-delta.py b/meta-facebook/meta-wedge/recipes-wedge/rackmon/rackmon/psu-update-delta.py
deleted file mode 100755
index 34a64f8..0000000
--- a/meta-facebook/meta-wedge/recipes-wedge/rackmon/rackmon/psu-update-delta.py
+++ /dev/null
@@ -1,319 +0,0 @@
-#!/usr/bin/env python
-from __future__ import print_function
-
-import os.path
-import os
-import fcntl
-import socket
-import struct
-import sys
-import argparse
-import traceback
-import json
-from tempfile import mkstemp
-
-import hexfile
-
-
-def auto_int(x):
- return int(x, 0)
-
-
-parser = argparse.ArgumentParser()
-parser.add_argument('--addr', type=auto_int, required=True,
- help="PSU Modbus Address")
-parser.add_argument('--statusfile', default=None,
- help="Write status to JSON file during process")
-parser.add_argument('--rmfwfile', action='store_true',
- help="Delete FW file after update completes")
-parser.add_argument('file', help="firmware file")
-
-status = {
- 'pid': os.getpid(),
- 'state': 'started'
-}
-
-statuspath = None
-
-def write_status():
- global status
- if statuspath is None:
- return
- tmppath = statuspath + '~'
- with open(tmppath, 'wb') as tfh:
- tfh.write(json.dumps(status))
- os.rename(tmppath, statuspath)
-
-def status_state(state):
- global status
- status['state'] = state
- write_status()
-
-class ModbusTimeout(Exception):
- pass
-
-
-class ModbusCRCFail(Exception):
- pass
-
-
-class ModbusUnknownError(Exception):
- pass
-
-
-class BadMEIResponse(Exception):
- pass
-
-
-def rackmon_command(cmd):
- srvpath = "/var/run/rackmond.sock"
- replydata = []
- if os.path.exists(srvpath):
- client = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
- client.connect(srvpath)
- cmdlen = struct.pack("@H", len(cmd))
- client.send(cmdlen)
- client.send(cmd)
- while True:
- data = client.recv(1024)
- if not data:
- break
- replydata.append(data)
- client.close()
- return ''.join(replydata)
-
-
-def pause_monitoring():
- COMMAND_TYPE_PAUSE_MONITORING = 0x04
- command = struct.pack("@Hxx", COMMAND_TYPE_PAUSE_MONITORING)
- result = rackmon_command(command)
- (res_n, ) = struct.unpack("@B", result)
- if res_n == 1:
- print("Monitoring was already paused when tried to pause")
- elif res_n == 0:
- print("Monitoring paused")
- else:
- print("Unknown response pausing monitoring: %d" % res_n)
-
-
-def resume_monitoring():
- COMMAND_TYPE_START_MONITORING = 0x05
- command = struct.pack("@Hxx", COMMAND_TYPE_START_MONITORING)
- result = rackmon_command(command)
- (res_n, ) = struct.unpack("@B", result)
- if res_n == 1:
- print("Monitoring was already running when tried to resume")
- elif res_n == 0:
- print("Monitoring resumed")
- else:
- print("Unknown response resuming monitoring: %d" % res_n)
-
-
-def modbuscmd(raw_cmd, expected=0, timeout=0):
- COMMAND_TYPE_RAW_MODBUS = 1
- send_command = struct.pack("@HxxHHL",
- COMMAND_TYPE_RAW_MODBUS,
- len(raw_cmd),
- expected,
- timeout) + raw_cmd
- result = rackmon_command(send_command)
- if len(result) == 0:
- raise ModbusUnknownError()
- (resp_len,) = struct.unpack("@H", result[:2])
- if resp_len == 0:
- (error, ) = struct.unpack("@H", result[2:4])
- if error == 4:
- raise ModbusTimeout()
- if error == 5:
- raise ModbusCRCFail()
- print("Unknown modbus error: " + str(error))
- raise ModbusUnknownError()
- return result[2:resp_len]
-
-
-def mei_command(addr, func_code, mei_type=0x64, data=None, timeout=0):
- i_data = data
- if i_data is None:
- i_data = ("\xFF" * 7)
- if len(i_data) < 7:
- i_data = i_data + ("\xFF" * (7 - len(i_data)))
- assert len(i_data) == 7
- command = struct.pack("BBBB", addr, 0x2b, mei_type, func_code) + i_data
- return modbuscmd(command, expected=13, timeout=timeout)
-
-
-def enter_bootloader(addr):
- try:
- print("Entering bootloader...")
- mei_command(addr, 0xFB, timeout=4000)
- except ModbusTimeout:
- print("Enter bootloader timed out (expected.)")
- pass
-
-
-def mei_expect(response, addr, data_pfx, error, success_mei_type=0x71):
- expected = struct.pack("BBB", addr, 0x2B, success_mei_type) + \
- data_pfx + ("\xFF" * (8 - len(data_pfx)))
- if response != expected:
- print(error + ", response: " + response.encode('hex'))
- raise BadMEIResponse()
-
-
-def start_programming(addr):
- print("Send start programming...")
- response = mei_command(addr, 0x70, timeout=10000)
- mei_expect(response, addr, "\xB0", "Start programming failed")
- print("Start programming succeeded.")
-
-
-def get_challenge(addr):
- print("Send get seed")
- response = mei_command(addr, 0x27, timeout=3000)
- expected = struct.pack("BBBB", addr, 0x2B, 0x71, 0x67)
- if response[:len(expected)] != expected:
- print("Bad response to get seed: " + response.encode('hex'))
- raise BadMEIResponse()
- challenge = response[len(expected):len(expected) + 4]
- print("Got seed: " + challenge.encode('hex'))
- return challenge
-
-
-def send_key(addr, key):
- print("Send key")
- response = mei_command(addr, 0x28, data=key, timeout=3000)
- mei_expect(response, addr, "\x68", "Start programming failed")
- print("Send key successful.")
-
-
-def delta_seccalckey(challenge):
- (seed, ) = struct.unpack(">L", challenge)
- for i in range(32):
- if seed & 1 != 0:
- seed = seed ^ 0xc758a5b6
- seed = (seed >> 1) & 0x7fffffff
- seed = seed ^ 0x06854137
- return struct.pack(">L", seed)
-
-
-def verify_flash(addr):
- print("Verifying program...")
- response = mei_command(addr, 0x76, timeout=60000)
- mei_expect(response, addr, "\xB6", "Program verification failed")
-
-
-def set_write_address(psu_addr, flash_addr):
- # print("Set write address to " + hex(flash_addr))
- data = struct.pack(">LB", flash_addr, 0xEA)
- response = mei_command(psu_addr, 0x61, data=data, timeout=3000)
- mei_expect(response, psu_addr, "\xA1\xEA", "Set address failed")
-
-
-def write_data(addr, data):
- assert(len(data) == 8)
- command = struct.pack(">BBB", addr, 0x2b, 0x65) + data
- response = modbuscmd(command, expected=13, timeout=3000)
- expected = struct.pack(">B", addr) +\
- "\x2b\x73\xf0\xaa\xff\xff\xff\xff\xff\xff"
- if response != expected:
- print("Bad response to writing data: " +
- response.encode('hex'))
- raise BadMEIResponse()
-
-
-def send_image(addr, fwimg):
- global statuspath
- total_chunks = sum([len(s) for s in fwimg.segments]) / 8
- sent_chunks = 0
- for s in fwimg.segments:
- if len(s) == 0:
- continue
- print("Sending " + str(s))
- set_write_address(addr, s.start_address)
- for i in xrange(0, len(s), 8):
- chunk = s.data[i:i+8]
- if len(chunk) < 8:
- chunk = chunk + ("\xFF" * (8 - len(chunk)))
- sent_chunks += 1
- # dont fill the restapi log with junk
- if statuspath is None:
- print("\r[%.2f%%] Sending chunk %d of %d..." %
- (sent_chunks * 100.0 / total_chunks,
- sent_chunks, total_chunks), end="")
- sys.stdout.flush()
- write_data(addr, str(bytearray(chunk)))
- status['flash_progress_percent'] = sent_chunks * 100.0 / total_chunks
- write_status()
- print("")
-
-
-def reset_psu(addr):
- print("Resetting PSU...")
- try:
- response = mei_command(addr, 0x72, timeout=10000)
- except ModbusTimeout:
- print("No reply from PSU reset (expected.)")
- return
- expected = struct.pack(">BBBB", addr, 0x2b, 0x71, 0xb2) +\
- ("\xFF" * 7)
- if response != expected:
- print("Bad response to unit reset request: " +
- response.encode('hex'))
- raise BadMEIResponse()
-
-
-def erase_flash(addr):
- print("Erasing flash... ")
- sys.stdout.flush()
- response = mei_command(addr, 0x65, timeout=30000)
- expected = struct.pack(">BBBB", addr, 0x2b, 0x71, 0xa5) +\
- ("\xFF" * 7)
- if response != expected:
- print("Bad response to erasing flash: " +
- response.encode('hex'))
- raise BadMEIResponse()
-
-
-def update_psu(addr, filename):
- status_state('pausing_monitoring')
- pause_monitoring()
- status_state('parsing_fw_file')
- fwimg = hexfile.load(filename)
- status_state('bootloader_handshake')
- enter_bootloader(addr)
- start_programming(addr)
- challenge = get_challenge(addr)
- send_key(addr, delta_seccalckey(challenge))
- status_state('erase_flash')
- erase_flash(addr)
- status_state('flashing')
- send_image(addr, fwimg)
- status_state('verifying')
- verify_flash(addr)
- status_state('resetting')
- reset_psu(addr)
- status_state('done')
-
-
-def main():
- args = parser.parse_args()
- global statuspath
- statuspath = args.statusfile
- print("statusfile %s" % statuspath)
- try:
- update_psu(args.addr, args.file)
- except Exception, e:
- print("Firmware update failed")
- global status
- status['exception'] = traceback.format_exc()
- status_state('failed')
- resume_monitoring()
- if args.rmfwfile:
- os.remove(args.file)
- sys.exit(1)
- resume_monitoring()
- if args.rmfwfile:
- os.remove(args.file)
- sys.exit(0)
-
-if __name__ == "__main__":
- main()
diff --git a/meta-facebook/meta-wedge/recipes-wedge/rackmon/rackmon/rackmon-config.py b/meta-facebook/meta-wedge/recipes-wedge/rackmon/rackmon/rackmon-config.py
deleted file mode 100644
index 130f26f..0000000
--- a/meta-facebook/meta-wedge/recipes-wedge/rackmon/rackmon/rackmon-config.py
+++ /dev/null
@@ -1,220 +0,0 @@
-from rackmond import configure_rackmond
-
-reglist = [
- {"begin": 0x0, #MFR_MODEL
- "length": 8},
- {"begin": 0x10, #MFR_DATE
- "length": 8},
- {"begin": 0x20, #FB Part #
- "length": 8},
- {"begin": 0x30, #HW Revision
- "length": 4},
- {"begin": 0x38, #FW Revision
- "length": 4},
- {"begin": 0x40, #MFR Serial #
- "length": 16},
- {"begin": 0x60, #Workorder #
- "length": 4},
- {"begin": 0x68, #PSU Status
- "length": 1,
- "keep": 10, # 10-sample ring buffer
- "flags": 1},
- {"begin": 0x69, #Battery Status
- "length": 1,
- "keep": 10, # 10-sample ring buffer
- "flags": 1},
- {"begin": 0x6B, #BBU Battery Mode
- "length": 1,
- "keep": 10, # 10-sample ring buffer
- "flags": 1},
- {"begin": 0x6C, #BBU Battery Status
- "length": 1,
- "keep": 10, # 10-sample ring buffer
- "flags": 1},
- {"begin": 0x6D, #BBU Cell Voltage 1
- "length": 1,
- "keep": 10},
- {"begin": 0x6E, #BBU Cell Voltage 2
- "length": 1,
- "keep": 10},
- {"begin": 0x6F, #BBU Cell Voltage 3
- "length": 1,
- "keep": 10},
- {"begin": 0x70, #BBU Cell Voltage 4
- "length": 1,
- "keep": 10},
- {"begin": 0x71, #BBU Cell Voltage 5
- "length": 1,
- "keep": 10},
- {"begin": 0x72, #BBU Cell Voltage 6
- "length": 1,
- "keep": 10},
- {"begin": 0x73, #BBU Cell Voltage 7
- "length": 1,
- "keep": 10},
- {"begin": 0x74, #BBU Cell Voltage 8
- "length": 1,
- "keep": 10},
- {"begin": 0x75, #BBU Cell Voltage 9
- "length": 1,
- "keep": 10},
- {"begin": 0x76, #BBU Cell Voltage 10
- "length": 1,
- "keep": 10},
- {"begin": 0x77, #BBU Cell Voltage 11
- "length": 1,
- "keep": 10},
- {"begin": 0x78, #BBU Cell Voltage 12
- "length": 1,
- "keep": 10},
- {"begin": 0x79, #BBU Cell Voltage 13
- "length": 1,
- "keep": 10},
- {"begin": 0x7A, #BBU Temp 1
- "length": 1,
- "keep": 10},
- {"begin": 0x7B, #BBU Temp 2
- "length": 1,
- "keep": 10},
- {"begin": 0x7C, #BBU Temp 3
- "length": 1,
- "keep": 10},
- {"begin": 0x7D, #BBU Temp 4
- "length": 1,
- "keep": 10},
- {"begin": 0x7E, #BBU Relative State of Charge
- "length": 1,
- "keep": 10},
- {"begin": 0x7F, #BBU Absolute State of Charge
- "length": 1,
- "keep": 10},
- {"begin": 0x80, #Input VAC
- "length": 1,
- "keep": 10},
- {"begin": 0x81, #BBU Battery Voltage
- "length": 1,
- "keep": 10},
- {"begin": 0x82, #Input Current AC
- "length": 1,
- "keep": 10},
- {"begin": 0x83, #BBU Battery Current
- "length": 1,
- "keep": 10},
- {"begin": 0x84, #Battery Voltage
- "length": 1,
- "keep": 10},
- {"begin": 0x85, #BBU Average Current
- "length": 1,
- "keep": 10},
- {"begin": 0x86, #Battery Current Output
- "length": 1},
- {"begin": 0x87, #BBU Remaining Capacity
- "length": 1,
- "keep": 10},
- {"begin": 0x88, #Battery Current Input
- "length": 1},
- {"begin": 0x89, #BBU Full Charge Capacity
- "length": 1,
- "keep": 10},
- {"begin": 0x8A, #Output Voltage (main converter)
- "length": 1,
- "keep": 10},
- {"begin": 0x8B, #BBU Run Time to Empty
- "length": 1,
- "keep": 10},
- {"begin": 0x8C, #Output Current (main converter)
- "length": 1,
- "keep": 10},
- {"begin": 0x8D, #BBU Average Time to Empty
- "length": 1,
- "keep": 10},
- {"begin": 0x8E, #IT Load Voltage Output
- "length": 1},
- {"begin": 0x8F, #BBU Charging Current
- "length": 1},
- {"begin": 0x90, #IT Load Current Output
- "length": 1},
- {"begin": 0x91, #BBU Charging Voltage
- "length": 1,
- "keep": 10},
- {"begin": 0x92, #Bulk Cap Voltage
- "length": 1},
- {"begin": 0x93, #BBU Cycle Count
- "length": 1,
- "keep": 10},
- {"begin": 0x94, #Input Power
- "length": 1,
- "keep": 10},
- {"begin": 0x95, #BBU Design Capacity
- "length": 1},
- {"begin": 0x96, #Output Power
- "length": 1,
- "keep": 10},
- {"begin": 0x97, #BBU Design Voltage
- "length": 1},
- {"begin": 0x98, #RPM Fan 0
- "length": 1},
- {"begin": 0x99, #BBU At Rate
- "length": 1},
- {"begin": 0x9A, #RPM Fan 1
- "length": 1},
- {"begin": 0x9B, #BBU At Rate Time to Full
- "length": 1,
- "keep": 10},
- {"begin": 0x9C, #BBU At Rate Time to Empty
- "length": 1,
- "keep": 10},
- {"begin": 0x9D, #BBU At Rate OK
- "length": 1,
- "keep": 10},
- {"begin": 0x9E, #Temp 0
- "length": 1},
- {"begin": 0x9F, #BBU Temp
- "length": 1},
- {"begin": 0xA0, #Temp 1
- "length": 1},
- {"begin": 0xA1, #BBU Max Error
- "length": 1},
- {"begin": 0xD0, #General Alarm Status Register
- "length": 1},
- {"begin": 0xD1, #PFC Alarm Status Register
- "length": 1},
- {"begin": 0xD2, #LLC Alarm Status Register
- "length": 1},
- {"begin": 0xD3, #Current Feed Alarm Status Register
- "length": 1},
- {"begin": 0xD4, #Auxiliary Alarm Status Register
- "length": 1},
- {"begin": 0xD5, #Battery Charger Alarm Status Register
- "length": 1},
- {"begin": 0xD7, #Temperature Alarm Status Register
- "length": 1},
- {"begin": 0xD8, #Fan Alarm Status Register
- "length": 1},
- {"begin": 0xD9, #Communication Alarm Status Register
- "length": 1},
- {"begin": 0x106, #BBU Specification Info
- "length": 1},
- {"begin": 0x107, #BBU Manufacturer Date
- "length": 1},
- {"begin": 0x108, #BBU Serial Number
- "length": 1},
- {"begin": 0x109, #BBU Device Chemistry
- "length": 2},
- {"begin": 0x10B, #BBU Manufacturer Data
- "length": 2},
- {"begin": 0x10D, #BBU Manufacturer Name
- "length": 8},
- {"begin": 0x115, #BBU Device Name
- "length": 8},
- {"begin": 0x11D, #FB Battery Status
- "length": 4},
- {"begin": 0x121, #SoH results
- "length": 1},
-]
-
-def main():
- configure_rackmond(reglist)
-
-if __name__ == "__main__":
- main()
diff --git a/meta-facebook/meta-wedge/recipes-wedge/rackmon/rackmon/rackmond.c b/meta-facebook/meta-wedge/recipes-wedge/rackmon/rackmon/rackmond.c
deleted file mode 100644
index cce3ba4..0000000
--- a/meta-facebook/meta-wedge/recipes-wedge/rackmon/rackmon/rackmond.c
+++ /dev/null
@@ -1,637 +0,0 @@
-#include "modbus.h"
-#include "rackmond.h"
-#include <string.h>
-#include <pthread.h>
-#include <stdio.h>
-#include <fcntl.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <sys/un.h>
-#include <errno.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <poll.h>
-#include <time.h>
-#include <stdarg.h>
-#include <syslog.h>
-#include <signal.h>
-
-#define MAX_ACTIVE_ADDRS 12
-#define REGISTER_PSU_STATUS 0x68
-
-struct _lock_holder {
- pthread_mutex_t *lock;
- int held;
-};
-
-#define lock_holder(holder_name, lock_expr) \
- struct _lock_holder holder_name; \
- holder_name.lock = lock_expr; \
- holder_name.held = 0;
-
-#define lock_take(holder_name) { \
- pthread_mutex_lock(holder_name.lock); \
- holder_name.held = 1; \
-}
-
-#define lock_release(holder_name) { \
- if(holder_name.held) { \
- pthread_mutex_unlock(holder_name.lock); \
- holder_name.held = 0; \
- } \
-}
-
-int scanning = 0;
-
-typedef struct _rs485_dev {
- // hold this for the duration of a command
- pthread_mutex_t lock;
- int tty_fd;
- int gpio_fd;
-} rs485_dev;
-
-typedef struct _register_req {
- uint16_t begin;
- int num;
-} register_req;
-
-typedef struct register_range_data {
- monitor_interval* i;
- void* mem_begin;
- size_t mem_pos;
-} register_range_data;
-
-typedef struct monitoring_data {
- uint8_t addr;
- register_range_data range_data[1];
-} monitoring_data;
-
-typedef struct _rackmond_data {
- // global rackmond lock
- pthread_mutex_t lock;
- // number of register read commands to send to each PSU
- int num_reqs;
- // register read commands (begin+length)
- register_req *reqs;
- monitoring_config *config;
-
- uint8_t num_active_addrs;
- uint8_t active_addrs[MAX_ACTIVE_ADDRS];
- monitoring_data* stored_data[MAX_ACTIVE_ADDRS];
- FILE *status_log;
-
- // timeout in nanosecs
- int modbus_timeout;
-
- int paused;
-
- rs485_dev rs485;
-} rackmond_data;
-
-rackmond_data world;
-
-char psu_address(int rack, int shelf, int psu) {
- int rack_a = ((rack & 3) << 3);
- int shelf_a = ((shelf & 1) << 2);
- int psu_a = (psu & 3);
- return 0xA0 | rack_a | shelf_a | psu_a;
-}
-
-int modbus_command(rs485_dev* dev, int timeout, char* command, size_t len, char* destbuf, size_t dest_limit, size_t expect) {
- int error = 0;
- lock_holder(devlock, &dev->lock);
- modbus_req req;
- req.tty_fd = dev->tty_fd;
- req.gpio_fd = dev->gpio_fd;
- req.modbus_cmd = command;
- req.cmd_len = len;
- req.dest_buf = destbuf;
- req.dest_limit = dest_limit;
- req.timeout = timeout;
- req.expected_len = expect != 0 ? expect : dest_limit;
- req.scan = scanning;
- lock_take(devlock);
- int cmd_error = modbuscmd(&req);
- CHECK(cmd_error);
-cleanup:
- lock_release(devlock);
- if (error >= 0) {
- return req.dest_len;
- }
-
- return error;
-}
-
-int read_registers(rs485_dev *dev, int timeout, uint8_t addr, uint16_t begin, uint16_t num, uint16_t* out) {
- int error = 0;
- // address, function, begin, length in # of regs
- char command[sizeof(addr) + 1 + sizeof(begin) + sizeof(num)];
- // address, function, length (1 byte), data (2 bytes per register), crc
- // (VLA)
- char response[sizeof(addr) + 1 + 1 + (2 * num) + 2];
- command[0] = addr;
- command[1] = MODBUS_READ_HOLDING_REGISTERS;
- command[2] = begin << 8;
- command[3] = begin & 0xFF;
- command[4] = num << 8;
- command[5] = num & 0xFF;
-
- int dest_len =
- modbus_command(
- dev, timeout,
- command, sizeof(addr) + 1 + sizeof(begin) + sizeof(num),
- response, sizeof(addr) + 1 + 1 + (2 * num) + 2, 0);
- CHECK(dest_len);
-
- if (dest_len >= 5) {
- memcpy(out, response + 3, num * 2);
- } else {
- log("Unexpected short but CRC correct response!\n");
- error = -1;
- goto cleanup;
- }
- if (response[0] != addr) {
- log("Got response for addr %02x when expected %02x\n", response[0], addr);
- error = -1;
- goto cleanup;
- }
- if (response[2] != (num * 2)) {
- log("Got %d register data bytes when expecting %d\n", response[2], (num * 2));
- error = -1;
- goto cleanup;
- }
-cleanup:
- return error;
-}
-
-int sub_uint8s(const void* a, const void* b) {
- return (*(uint8_t*)a) - (*(uint8_t*)b);
-}
-
-int check_active_psus() {
- int error = 0;
- lock_holder(worldlock, &world.lock);
- lock_take(worldlock);
- if (world.paused == 1) {
- usleep(1000);
- goto cleanup;
- }
- if (world.config == NULL) {
- lock_release(worldlock);
- usleep(5000);
- goto cleanup;
- }
- world.num_active_addrs = 0;
-
- scanning = 1;
- //fprintf(stderr, "Begin presence check: ");
- for(int rack = 0; rack < 3; rack++) {
- for(int shelf = 0; shelf < 2; shelf++) {
- for(int psu = 0; psu < 3; psu++) {
- char addr = psu_address(rack, shelf, psu);
- uint16_t status = 0;
- int err = read_registers(&world.rs485, world.modbus_timeout, addr, REGISTER_PSU_STATUS, 1, &status);
- if (err == 0) {
- world.active_addrs[world.num_active_addrs] = addr;
- world.num_active_addrs++;
- //fprintf(stderr, "%02x - active (%04x) ", addr, status);
- } else {
- dbg("%02x - %d; ", addr, err);
- }
- }
- }
- }
- //its the only stdlib sort
- qsort(world.active_addrs, world.num_active_addrs,
- sizeof(uint8_t), sub_uint8s);
-cleanup:
- scanning = 0;
- lock_release(worldlock);
- return error;
-}
-
-monitoring_data* alloc_monitoring_data(uint8_t addr) {
- size_t size = sizeof(monitoring_data) +
- sizeof(register_range_data) * world.config->num_intervals;
- for(int i = 0; i < world.config->num_intervals; i++) {
- monitor_interval *iv = &world.config->intervals[i];
- int pitch = sizeof(uint32_t) + (sizeof(uint16_t) * iv->len);
- int data_size = pitch * iv->keep;
- size += data_size;
- }
- monitoring_data* d = calloc(1, size);
- if (d == NULL) {
- log("Failed to allocate memory for sensor data.\n");
- return NULL;
- }
- d->addr = addr;
- void* mem = d;
- mem = mem + (sizeof(monitoring_data) +
- sizeof(register_range_data) * world.config->num_intervals);
- for(int i = 0; i < world.config->num_intervals; i++) {
- monitor_interval *iv = &world.config->intervals[i];
- int pitch = sizeof(uint32_t) + (sizeof(uint16_t) * iv->len);
- int data_size = pitch * iv->keep;
- d->range_data[i].i = iv;
- d->range_data[i].mem_begin = mem;
- d->range_data[i].mem_pos = 0;
- mem = mem + data_size;
- }
- return d;
-}
-
-int sub_storeptrs(const void* va, const void *vb) {
- //more *s than i like :/
- monitoring_data* a = *(monitoring_data**)va;
- monitoring_data* b = *(monitoring_data**)vb;
- //nulls to the end
- if (b == NULL && a == NULL) {
- return 0;
- }
- if (b == NULL) {
- return -1;
- }
- if (a == NULL) {
- return 1;
- }
- return a->addr - b->addr;
-}
-
-int alloc_monitoring_datas() {
- int error = 0;
- if (world.config == NULL) {
- goto cleanup;
- }
- qsort(world.stored_data, MAX_ACTIVE_ADDRS,
- sizeof(monitoring_data*), sub_storeptrs);
- int data_pos = 0;
- for(int i = 0; i < world.num_active_addrs; i++) {
- uint8_t addr = world.active_addrs[i];
- while(world.stored_data[data_pos] != NULL &&
- world.stored_data[data_pos]->addr != addr) {
- data_pos++;
- }
- if (world.stored_data[data_pos] == NULL) {
- log("Detected PSU at address 0x%02x\n", addr);
- //syslog(LOG_INFO, "Detected PSU at address 0x%02x", addr);
- world.stored_data[data_pos] = alloc_monitoring_data(addr);
- if (world.stored_data[data_pos] == NULL) {
- BAIL("allocation failed\n");
- }
- //reset search pos after alloc (post-sorted addrs may already be alloc'd, need to check again)
- data_pos = 0;
- continue;
- }
- if (world.stored_data[data_pos]->addr == addr) {
- continue;
- }
- BAIL("shouldn't get here!\n");
- }
-cleanup:
- return error;
-}
-
-void record_data(register_range_data* rd, uint32_t time, uint16_t* regs) {
- int n_regs = (rd->i->len);
- int pitch = sizeof(time) + (sizeof(uint16_t) * n_regs);
- int mem_size = pitch * rd->i->keep;
-
- memcpy(rd->mem_begin + rd->mem_pos, &time, sizeof(time));
- rd->mem_pos += sizeof(time);
- memcpy(rd->mem_begin + rd->mem_pos, regs, n_regs * sizeof(uint16_t));
- rd->mem_pos += n_regs * sizeof(uint16_t);
- rd->mem_pos = rd->mem_pos % mem_size;
-}
-
-int fetch_monitored_data() {
- int error = 0;
- int data_pos = 0;
- lock_holder(worldlock, &world.lock);
- lock_take(worldlock);
- if (world.paused == 1) {
- usleep(1000);
- goto cleanup;
- }
- if (world.config == NULL) {
- goto cleanup;
- }
- lock_release(worldlock);
-
- usleep(1000); // wait a sec btween PSUs to not overload RT scheduling
- // threshold
- while(world.stored_data[data_pos] != NULL && data_pos < MAX_ACTIVE_ADDRS) {
- uint8_t addr = world.stored_data[data_pos]->addr;
- //log("readpsu %02x\n", addr);
- for(int r = 0; r < world.config->num_intervals; r++) {
- register_range_data* rd = &world.stored_data[data_pos]->range_data[r];
- monitor_interval* i = rd->i;
- uint16_t regs[i->len];
- int err = read_registers(&world.rs485,
- world.modbus_timeout, addr, i->begin, i->len, regs);
- if (err) {
- log("Error %d reading %02x registers at %02x from %02x\n",
- err, i->len, i->begin, addr);
- continue;
- }
- struct timespec ts;
- clock_gettime(CLOCK_REALTIME, &ts);
- uint32_t timestamp = ts.tv_sec;
- if (rd->i->flags & MONITOR_FLAG_ONLY_CHANGES) {
- int pitch = sizeof(timestamp) + (sizeof(uint16_t) * i->len);
- int lastpos = rd->mem_pos - pitch;
- if (lastpos < 0) {
- lastpos = (pitch * rd->i->keep) - pitch;
- }
- if (!memcmp(rd->mem_begin + lastpos + sizeof(timestamp),
- regs, sizeof(uint16_t) * i->len) &&
- memcmp(rd->mem_begin, "\x00\x00\x00\x00", 4)) {
- continue;
- }
-
- if (world.status_log) {
- time_t rawt;
- struct tm* ti;
- time(&rawt);
- ti = localtime(&rawt);
- char timestr[80];
- strftime(timestr, sizeof(timestr), "%b %e %T", ti);
- fprintf(world.status_log,
- "%s: Change to status register %02x on address %02x. New value: %02x\n",
- timestr, i->begin, addr, regs[0]);
- fflush(world.status_log);
- }
-
- }
- lock_take(worldlock);
- record_data(rd, timestamp, regs);
- lock_release(worldlock);
- }
- data_pos++;
- }
-cleanup:
- lock_release(worldlock);
- return error;
-}
-
-// check for new psus every N rounds of sensor reads
-#define SEARCH_PSUS_EVERY 200
-void* monitoring_loop(void* arg) {
- (void) arg;
- int until_search = 0;
- world.status_log = fopen("/var/log/psu-status.log", "a+");
- while(1) {
- if (until_search == 0) {
- check_active_psus();
- alloc_monitoring_datas();
- until_search = SEARCH_PSUS_EVERY;
- } else {
- until_search--;
- }
- fetch_monitored_data();
- }
- return NULL;
-}
-
-int open_rs485_dev(const char* tty_filename, int gpio_num, rs485_dev *dev) {
- int error = 0;
- int tty_fd, gpio_fd;
- char gpio_filename[128];
- dbg("[*] Opening TTY\n");
- tty_fd = open(tty_filename, O_RDWR | O_NOCTTY);
- CHECK(tty_fd);
-
- dbg("[*] Opening GPIO %d\n", gpio_num);
- snprintf(gpio_filename, sizeof(gpio_filename), "/sys/class/gpio/gpio%d/value", gpio_num);
- gpio_fd = open(gpio_filename, O_WRONLY | O_SYNC);
- CHECK(gpio_fd);
-
- dev->tty_fd = tty_fd;
- dev->gpio_fd = gpio_fd;
- pthread_mutex_init(&dev->lock, NULL);
-cleanup:
- return error;
-}
-
-int do_command(int sock, rackmond_command* cmd) {
- int error = 0;
- lock_holder(worldlock, &world.lock);
- switch(cmd->type) {
- case COMMAND_TYPE_RAW_MODBUS:
- {
- uint16_t expected = cmd->raw_modbus.expected_response_length;
- int timeout = world.modbus_timeout;
- if (cmd->raw_modbus.custom_timeout) {
- //ms to us
- timeout = cmd->raw_modbus.custom_timeout * 1000;
- }
- if (expected == 0) {
- expected = 1024;
- }
- char response[expected];
- int response_len = modbus_command(
- &world.rs485, timeout,
- cmd->raw_modbus.data, cmd->raw_modbus.length,
- response, expected, expected);
- uint16_t response_len_wire = response_len;
- if(response_len < 0) {
- uint16_t error = -response_len;
- response_len_wire = 0;
- send(sock, &response_len_wire, sizeof(uint16_t), 0);
- send(sock, &error, sizeof(uint16_t), 0);
- break;
- }
- send(sock, &response_len_wire, sizeof(uint16_t), 0);
- send(sock, response, response_len, 0);
- break;
- }
- case COMMAND_TYPE_SET_CONFIG:
- {
- lock_take(worldlock);
- if (world.config != NULL) {
- BAIL("rackmond already configured\n");
- }
- size_t config_size = sizeof(monitoring_config) +
- (sizeof(monitor_interval) * cmd->set_config.config.num_intervals);
- world.config = calloc(1, config_size);
- memcpy(world.config, &cmd->set_config.config, config_size);
- syslog(LOG_INFO, "got configuration");
- lock_release(worldlock);
- break;
- }
- case COMMAND_TYPE_DUMP_DATA_JSON:
- {
- lock_take(worldlock);
- if (world.config == NULL) {
- send(sock, "[]", 2, 0);
- } else {
- struct timespec ts;
- clock_gettime(CLOCK_REALTIME, &ts);
- uint32_t now = ts.tv_sec;
- send(sock, "[", 1, 0);
- int data_pos = 0;
- while(world.stored_data[data_pos] != NULL && data_pos < MAX_ACTIVE_ADDRS) {
- dprintf(sock, "{\"addr\":%d,\"now\":%d,\"ranges\":[",
- world.stored_data[data_pos]->addr, now);
- for(int i = 0; i < world.config->num_intervals; i++) {
- uint32_t time;
- register_range_data *rd = &world.stored_data[data_pos]->range_data[i];
- char* mem_pos = rd->mem_begin;
- dprintf(sock,"{\"begin\":%d,\"readings\":[", rd->i->begin);
- // want to cut the list off early just before
- // the first entry with time == 0
- memcpy(&time, mem_pos, sizeof(time));
- for(int j = 0; j < rd->i->keep && time != 0; j++) {
- mem_pos += sizeof(time);
- dprintf(sock, "{\"time\":%d,\"data\":\"", time);
- for(int c = 0; c < rd->i->len * 2; c++) {
- dprintf(sock, "%02x", *mem_pos);
- mem_pos++;
- }
- send(sock, "\"}", 2, 0);
- memcpy(&time, mem_pos, sizeof(time));
- if (time == 0) {
- break;
- }
- if ((j+1) < rd->i->keep) {
- send(sock, ",", 1, 0);
- }
- }
- send(sock, "]}", 2, 0);
- if ((i+1) < world.config->num_intervals) {
- send(sock, ",", 1, 0);
- }
- }
- data_pos++;
- if (data_pos < MAX_ACTIVE_ADDRS && world.stored_data[data_pos] != NULL) {
- send(sock, "]},", 3, 0);
- } else {
- send(sock, "]}", 2, 0);
- }
- }
- send(sock, "]", 1, 0);
- }
- lock_release(worldlock);
- break;
- }
- case COMMAND_TYPE_PAUSE_MONITORING:
- {
- lock_take(worldlock);
- uint8_t was_paused = world.paused;
- world.paused = 1;
- send(sock, &was_paused, sizeof(was_paused), 0);
- lock_release(worldlock);
- break;
- }
- case COMMAND_TYPE_START_MONITORING:
- {
- lock_take(worldlock);
- uint8_t was_started = !world.paused;
- world.paused = 0;
- send(sock, &was_started, sizeof(was_started), 0);
- lock_release(worldlock);
- break;
- }
- default:
- CHECK(-1);
- }
-cleanup:
- lock_release(worldlock);
- return error;
-}
-
-typedef enum {
- CONN_WAITING_LENGTH,
- CONN_WAITING_BODY
-} rackmond_connection_state;
-
-// receive the command as a length prefixed block
-// (uint16_t, followed by data)
-// this is all over a local socket, won't be doing
-// endian flipping, clients should only be local procs
-// compiled for the same arch
-int handle_connection(int sock) {
- int error = 0;
- rackmond_connection_state state = CONN_WAITING_LENGTH;
- char bodybuf[1024];
- uint16_t expected_len = 0;
- struct pollfd pfd;
- int recvret = 0;
- pfd.fd = sock;
- pfd.events = POLLIN | POLLERR | POLLHUP;
- // if you don't do anything for a whole second we bail
-next:
- CHECKP(poll, poll(&pfd, 1, 1000));
- if (pfd.revents & (POLLERR | POLLHUP)) {
- goto cleanup;
- }
- switch(state) {
- case CONN_WAITING_LENGTH:
- recvret = recv(sock, &expected_len, 2, MSG_DONTWAIT);
- if (recvret == -1 && (errno == EAGAIN || errno == EWOULDBLOCK)) {
- goto next;
- }
- if (expected_len == 0 || expected_len > sizeof(bodybuf)) {
- // bad length; bail
- goto cleanup;
- }
- state = CONN_WAITING_BODY;
- goto next;
- break;
- case CONN_WAITING_BODY:
- recvret = recv(sock, &bodybuf, expected_len, MSG_DONTWAIT);
- if (recvret == -1 && (errno == EAGAIN || errno == EWOULDBLOCK)) {
- goto next;
- }
- CHECK(do_command(sock, (rackmond_command*) bodybuf));
- }
-cleanup:
- close(sock);
- if (error != 0) {
- fprintf(stderr, "Warning: possible error handling user connection (%d)\n", error);
- }
- return 0;
-}
-
-int main(int argc, char** argv) {
- if (getenv("RACKMOND_FOREGROUND") == NULL) {
- daemon(0, 0);
- }
- signal(SIGPIPE, SIG_IGN);
- int error = 0;
- world.paused = 0;
- world.modbus_timeout = 300000;
- if (getenv("RACKMOND_TIMEOUT") != NULL) {
- world.modbus_timeout = atoll(getenv("RACKMOND_TIMEOUT"));
- fprintf(stderr, "Timeout from env: %dms\n",
- (world.modbus_timeout / 1000));
- }
- world.config = NULL;
- pthread_mutex_init(&world.lock, NULL);
- verbose = getenv("RACKMOND_VERBOSE") != NULL ? 1 : 0;
- openlog("rackmond", 0, LOG_USER);
- syslog(LOG_INFO, "rackmon/modbus service starting");
- CHECK(open_rs485_dev(DEFAULT_TTY, DEFAULT_GPIO, &world.rs485));
- pthread_t monitoring_thread;
- pthread_create(&monitoring_thread, NULL, monitoring_loop, NULL);
- struct sockaddr_un local, client;
- int sock = socket(AF_UNIX, SOCK_STREAM, 0);
- strcpy(local.sun_path, "/var/run/rackmond.sock");
- local.sun_family = AF_UNIX;
- int socknamelen = sizeof(local.sun_family) + strlen(local.sun_path);
- unlink(local.sun_path);
- CHECKP(bind, bind(sock, (struct sockaddr *)&local, socknamelen));
- CHECKP(listen, listen(sock, 5));
- syslog(LOG_INFO, "rackmon/modbus service listening");
- while(1) {
- socklen_t clisocklen = sizeof(struct sockaddr_un);
- int clisock = accept(sock, (struct sockaddr*) &client, &clisocklen);
- CHECKP(accept, clisock);
- CHECK(handle_connection(clisock));
- }
-
-cleanup:
- if (error != 0) {
- error = 1;
- }
- return error;
-}
diff --git a/meta-facebook/meta-wedge/recipes-wedge/rackmon/rackmon/rackmond.h b/meta-facebook/meta-wedge/recipes-wedge/rackmon/rackmon/rackmond.h
deleted file mode 100644
index 2c0e8a0..0000000
--- a/meta-facebook/meta-wedge/recipes-wedge/rackmon/rackmon/rackmond.h
+++ /dev/null
@@ -1,46 +0,0 @@
-#include <stdint.h>
-
-//would've been nice to have thrift
-
-// Raw modbus command
-// Response is just the raw response data
-typedef struct raw_modbus_command {
- uint16_t length;
- uint16_t expected_response_length;
- uint32_t custom_timeout; // 0 for default
- char data[1];
-} raw_modbus_command;
-
-// only store new value if different from most recent
-// (for watching changes to status flags registers)
-#define MONITOR_FLAG_ONLY_CHANGES 0x1
-
-typedef struct monitor_interval {
- uint16_t begin;
- uint16_t len;
- uint16_t keep; // How long of a history to keep?
- uint16_t flags;
-} monitor_interval;
-
-typedef struct monitoring_config {
- uint16_t num_intervals;
- monitor_interval intervals[1];
-} monitoring_config;
-
-typedef struct set_config_command {
- monitoring_config config;
-} set_config_command;
-
-#define COMMAND_TYPE_RAW_MODBUS 0x01
-#define COMMAND_TYPE_SET_CONFIG 0x02
-#define COMMAND_TYPE_DUMP_DATA_JSON 0x03
-#define COMMAND_TYPE_PAUSE_MONITORING 0x04
-#define COMMAND_TYPE_START_MONITORING 0x05
-
-typedef struct rackmond_command {
- uint16_t type;
- union {
- raw_modbus_command raw_modbus;
- set_config_command set_config;
- };
-} rackmond_command;
diff --git a/meta-facebook/meta-wedge/recipes-wedge/rackmon/rackmon/rackmond.py b/meta-facebook/meta-wedge/recipes-wedge/rackmon/rackmon/rackmond.py
deleted file mode 100644
index 35dbaa5..0000000
--- a/meta-facebook/meta-wedge/recipes-wedge/rackmon/rackmon/rackmond.py
+++ /dev/null
@@ -1,26 +0,0 @@
-import struct
-import socket
-import os, os.path
-
-def configure_rackmond(reglist):
- COMMAND_TYPE_SET_CONFIG = 2
- config_command = struct.pack("@HxxH",
- COMMAND_TYPE_SET_CONFIG,
- len(reglist))
- for r in reglist:
- keep = 1
- if "keep" in r:
- keep = r["keep"]
- flags = 0
- if "flags" in r:
- flags = r["flags"]
- monitor_interval = struct.pack("@HHHH", r["begin"], r["length"], keep, flags)
- config_command += monitor_interval
-
- config_packet = struct.pack("H", len(config_command)) + config_command
- srvpath = "/var/run/rackmond.sock"
- if os.path.exists(srvpath):
- client = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
- client.connect(srvpath)
- client.send(config_packet)
-
diff --git a/meta-facebook/meta-wedge/recipes-wedge/rackmon/rackmon/rackmondata.c b/meta-facebook/meta-wedge/recipes-wedge/rackmon/rackmon/rackmondata.c
deleted file mode 100644
index 391b5be..0000000
--- a/meta-facebook/meta-wedge/recipes-wedge/rackmon/rackmon/rackmondata.c
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright 2014-present Facebook. All Rights Reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-
-#include <stdint.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <errno.h>
-#include <unistd.h>
-#include <sys/socket.h>
-#include <sys/types.h>
-#include <sys/un.h>
-#include "modbus.h"
-#include "rackmond.h"
-
-int main(int argc, char **argv) {
- int error = 0;
- rackmond_command cmd;
- int clisock;
- uint16_t wire_cmd_len = sizeof(cmd);
- struct sockaddr_un rackmond_addr;
- cmd.type = COMMAND_TYPE_DUMP_DATA_JSON;
- clisock = socket(AF_UNIX, SOCK_STREAM, 0);
- CHECKP(socket, clisock);
- rackmond_addr.sun_family = AF_UNIX;
- strcpy(rackmond_addr.sun_path, "/var/run/rackmond.sock");
- int addr_len = strlen(rackmond_addr.sun_path) + sizeof(rackmond_addr.sun_family);
- CHECKP(connect, connect(clisock, (struct sockaddr*) &rackmond_addr, addr_len));
- CHECKP(send, send(clisock, &wire_cmd_len, sizeof(wire_cmd_len), 0));
- CHECKP(send, send(clisock, &cmd, wire_cmd_len, 0));
- char readbuf[256];
- ssize_t n_read;
- while((n_read = read(clisock, readbuf, sizeof(readbuf))) > 0) {
- write(1, readbuf, n_read);
- }
-cleanup:
- if(error != 0) {
- if(errno != 0) {
- fprintf(stderr, "%s\n", strerror(errno));
- }
- error = 1;
- }
- return error;
-}
diff --git a/meta-facebook/meta-wedge/recipes-wedge/rackmon/rackmon/setup-rackmond.sh b/meta-facebook/meta-wedge/recipes-wedge/rackmon/rackmon/setup-rackmond.sh
deleted file mode 100644
index b592a35..0000000
--- a/meta-facebook/meta-wedge/recipes-wedge/rackmon/rackmon/setup-rackmond.sh
+++ /dev/null
@@ -1,20 +0,0 @@
-#!/bin/bash
-#
-# Copyright 2014-present Facebook. All Rights Reserved.
-#
-### BEGIN INIT INFO
-# Provides: setup-rackmond
-# Required-Start:
-# Required-Stop:
-# Default-Start: S
-# Default-Stop:
-# Short-Description: Start Rackmon service
-### END INIT INFO
-
-echo -n "Starting rackmon background service..."
-/usr/local/bin/rackmond
-echo "done."
-
-echo -n "Configuring rackmon service..."
-PYTHONPATH=/etc python /etc/rackmon-config.py
-echo "done."
diff --git a/meta-facebook/meta-wedge/recipes-wedge/rackmon/rackmon_0.1.bb b/meta-facebook/meta-wedge/recipes-wedge/rackmon/rackmon_0.1.bb
deleted file mode 100644
index c7e78c9..0000000
--- a/meta-facebook/meta-wedge/recipes-wedge/rackmon/rackmon_0.1.bb
+++ /dev/null
@@ -1,81 +0,0 @@
-# Copyright 2014-present Facebook. All Rights Reserved.
-#
-# This program file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program in a file named COPYING; if not, write to the
-# Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor,
-# Boston, MA 02110-1301 USA
-SUMMARY = "Rackmon Functionality"
-DESCRIPTION = "Rackmon Functionality"
-SECTION = "base"
-PR = "r1"
-LICENSE = "GPLv2"
-LIC_FILES_CHKSUM = "file://modbus.c;beginline=4;endline=16;md5=da35978751a9d71b73679307c4d296ec"
-
-DEPENDS_append = " update-rc.d-native"
-
-SRC_URI = "file://Makefile \
- file://modbuscmd.c \
- file://modbussim.c \
- file://modbus.c \
- file://modbus.h \
- file://gpiowatch.c \
- file://rackmond.c \
- file://rackmond.h \
- file://rackmondata.c \
- file://setup-rackmond.sh \
- file://rackmon-config.py \
- file://rackmond.py \
- file://psu-update-delta.py \
- file://hexfile.py \
- "
-
-S = "${WORKDIR}"
-
-binfiles = "modbuscmd \
- modbussim \
- gpiowatch \
- rackmond \
- rackmondata \
- psu-update-delta.py \
- hexfile.py \
- "
-
-#otherfiles = "README"
-
-pkgdir = "rackmon"
-
-do_install() {
- dst="${D}/usr/local/fbpackages/${pkgdir}"
- bin="${D}/usr/local/bin"
- install -d $dst
- install -d $bin
- for f in ${binfiles}; do
- install -m 755 $f ${dst}/$f
- ln -snf ../fbpackages/${pkgdir}/$f ${bin}/$f
- done
- install -d ${D}${sysconfdir}/init.d
- install -d ${D}${sysconfdir}/rcS.d
- install -m 755 setup-rackmond.sh ${D}${sysconfdir}/init.d/setup-rackmond.sh
- install -m 755 rackmon-config.py ${D}${sysconfdir}/rackmon-config.py
- install -m 755 rackmond.py ${D}${sysconfdir}/rackmond.py
- update-rc.d -r ${D} setup-rackmond.sh start 95 2 3 4 5 .
-}
-
-FBPACKAGEDIR = "${prefix}/local/fbpackages"
-
-FILES_${PN} = "${FBPACKAGEDIR}/rackmon ${prefix}/local/bin ${sysconfdir} "
-
-# Inhibit complaints about .debug directories for the rackmon binaries:
-
-INHIBIT_PACKAGE_DEBUG_SPLIT = "1"
-INHIBIT_PACKAGE_STRIP = "1"
diff --git a/meta-facebook/meta-wedge/recipes-wedge/rest-api/files/bmc_command.py b/meta-facebook/meta-wedge/recipes-wedge/rest-api/files/bmc_command.py
deleted file mode 100644
index d4dc877..0000000
--- a/meta-facebook/meta-wedge/recipes-wedge/rest-api/files/bmc_command.py
+++ /dev/null
@@ -1,112 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2014-present Facebook. All Rights Reserved.
-#
-# This program file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program in a file named COPYING; if not, write to the
-# Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor,
-# Boston, MA 02110-1301 USA
-#
-
-from __future__ import absolute_import
-from __future__ import division
-from __future__ import print_function
-from __future__ import unicode_literals
-
-import os
-import subprocess
-import select
-import sys
-import time
-
-DEFAULT_TIMEOUT = 10 #sec
-
-# Note: Python 3.0 supports communicate() with a timeout option.
-# If we upgrade to this version we will no longer need timed_communicate
-
-class TimeoutError(Exception):
- def __init__(self, output, error):
- super(TimeoutError, self).__init__('process timed out')
- self.output = output
- self.error = error
-
-class WaitTimeoutError(Exception):
- pass
-
-def kill_process(proc):
- proc.terminate()
- try:
- timed_wait(proc, 0.1)
- except WaitTimeoutError:
- proc.kill()
- try:
- timed_wait(proc, 0.1)
- except WaitTimeoutError:
- # This can happen if the process is stuck waiting inside a system
- # call for a long time. There isn't much we can do unless we want
- # to keep waiting forever. Just give up. The child process will
- # remain around as a zombie until we exit.
- pass
-
-def timed_wait(proc, timeout):
- # There unfortunately isn't a great way to wait for a process with a
- # timeout, other than polling. (Registering for SIGCHLD and sleeping might
- # be one option, but that's fragile and not thread-safe.)
- poll_interval = 0.1
- end_time = time.time() + timeout
- while True:
- if proc.poll() is not None:
- return
- time_left = max(end_time - time.time(), 0)
- if time_left <= 0:
- raise WaitTimeoutError()
- time.sleep(min(time_left, poll_interval))
-
-def timed_communicate(proc, timeout=DEFAULT_TIMEOUT):
- end_time = time.time() + timeout
-
- p = select.poll()
- outfd = proc.stdout.fileno()
- errfd = proc.stderr.fileno()
- p.register(outfd, select.POLLIN)
- p.register(errfd, select.POLLIN)
- results = {outfd: [], errfd: []}
- remaining_fds = set([outfd, errfd])
-
- bufsize = 4096
- while remaining_fds:
- time_left = max(end_time - time.time(), 0)
- r = p.poll(time_left * 1000) # poll() takes timeout in milliseconds
- if not r:
- kill_process(proc)
- raise TimeoutError(b''.join(results[outfd]),
- b''.join(results[errfd]))
- for fd, flags in r:
- # We didn't put the fds in non-blocking mode, but we know the fd
- # has data to read, so os.read() will return immediately.
- d = os.read(fd, bufsize)
- if d:
- results[fd].append(d)
- else:
- # EOF on this fd, stop listening on it
- p.unregister(fd)
- remaining_fds.remove(fd)
-
- try:
- timed_wait(proc, max(end_time - time.time(), 0))
- except WaitTimeoutError:
- kill_process(proc)
- raise TimeoutError(b''.join(results[outfd]),
- b''.join(results[errfd]))
-
- return b''.join(results[outfd]), b''.join(results[errfd])
diff --git a/meta-facebook/meta-wedge/recipes-wedge/rest-api/files/rest.py b/meta-facebook/meta-wedge/recipes-wedge/rest-api/files/rest.py
deleted file mode 100644
index af3e75d..0000000
--- a/meta-facebook/meta-wedge/recipes-wedge/rest-api/files/rest.py
+++ /dev/null
@@ -1,221 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2014-present Facebook. All Rights Reserved.
-#
-# This program file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program in a file named COPYING; if not, write to the
-# Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor,
-# Boston, MA 02110-1301 USA
-#
-
-from ctypes import *
-import bottle
-from cherrypy.wsgiserver import CherryPyWSGIServer
-from cherrypy.wsgiserver.ssl_pyopenssl import pyOpenSSLAdapter
-import datetime
-import logging
-import logging.config
-import json
-import ssl
-import socket
-import os
-import rest_fruid
-import rest_server
-import rest_sensors
-import rest_bmc
-import rest_gpios
-import rest_modbus
-import rest_slotid
-import rest_psu_update
-
-CONSTANTS = {
- 'certificate': '/usr/lib/ssl/certs/rest_server.pem',
- 'key': '/usr/lib/ssl/private/rest_server_key.pem',
-}
-
-LOGGER_CONF = {
- 'version': 1,
- 'disable_existing_loggers': False,
- 'formatters': {
- 'default': {
- 'format': '%(message)s'
- },
- },
- 'handlers': {
- 'file_handler': {
- 'level': 'INFO',
- 'formatter':'default',
- 'class': 'logging.handlers.RotatingFileHandler',
- 'filename':'/tmp/rest.log',
- 'maxBytes': 1048576,
- 'backupCount': 3,
- 'encoding': 'utf8'
- },
- },
- 'loggers': {
- '': {
- 'handlers': ['file_handler'],
- 'level': 'DEBUG',
- 'propagate': True,
- },
- }
-}
-
-# Handler for root resource endpoint
-@bottle.route('/api')
-def rest_api():
- result = {
- "Information": {
- "Description": "Wedge RESTful API Entry",
- },
- "Actions": [],
- "Resources": [ "sys"],
- }
-
- return result
-
-# Handler for sys resource endpoint
-@bottle.route('/api/sys')
-def rest_sys():
- result = {
- "Information": {
- "Description": "Wedge System",
- },
- "Actions": [],
- "Resources": [ "mb", "bmc", "server", "sensors", "gpios",
- "modbus_registers", "slotid"],
- }
-
- return result
-
-# Handler for sys/mb resource endpoint
-@bottle.route('/api/sys/mb')
-def rest_sys():
- result = {
- "Information": {
- "Description": "System Motherboard",
- },
- "Actions": [],
- "Resources": [ "fruid"],
- }
-
- return result
-
-# Handler for sys/mb/fruid resource endpoint
-@bottle.route('/api/sys/mb/fruid')
-def rest_fruid_hdl():
- return rest_fruid.get_fruid()
-
-# Handler for sys/bmc resource endpoint
-@bottle.route('/api/sys/bmc')
-def rest_bmc_hdl():
- return rest_bmc.get_bmc()
-
-# Handler for sys/server resource endpoint
-@bottle.route('/api/sys/server')
-def rest_server_hdl():
- return rest_server.get_server()
-
-# Handler for uServer resource endpoint
-@bottle.route('/api/sys/server', method='POST')
-def rest_server_act_hdl():
- data = json.load(request.body)
- return rest_server.server_action(data)
-
-# Handler for sensors resource endpoint
-@bottle.route('/api/sys/sensors')
-def rest_sensors_hdl():
- return rest_sensors.get_sensors()
-
-# Handler for sensors resource endpoint
-@bottle.route('/api/sys/gpios')
-def rest_gpios_hdl():
- return rest_gpios.get_gpios()
-
-@bottle.route('/api/sys/modbus_registers')
-def modbus_registers_hdl():
- return rest_modbus.get_modbus_registers()
-
-@bottle.route('/api/sys/psu_update')
-def psu_update_hdl():
- return rest_psu_update.get_jobs()
-
-@bottle.route('/api/sys/psu_update', method='POST')
-def psu_update_hdl():
- data = json.load(request.body)
- return rest_psu_update.begin_job(data)
-
-# Handler for sensors resource endpoint
-@bottle.route('/api/sys/slotid')
-def rest_slotid_hdl():
- return rest_slotid.get_slotid()
-
-# SSL Wrapper for Rest API
-class SSLCherryPyServer(bottle.ServerAdapter):
- def run(self, handler):
- server = CherryPyWSGIServer((self.host, self.port), handler)
- server.ssl_adapter = pyOpenSSLAdapter(CONSTANTS['certificate'], CONSTANTS['key'])
- try:
- server.start()
- finally:
- server.stop()
-
-
-def log_after_request():
- try:
- length = bottle.response.content_length
- except:
- try:
- length = len(bottle.response.body)
- except:
- length = 0
-
- logging.info('{} - - [{}] "{} {} {}" {} {}'.format(
- bottle.request.environ.get('REMOTE_ADDR'),
- datetime.datetime.now().strftime('%d/%b/%Y %H:%M:%S'),
- bottle.request.environ.get('REQUEST_METHOD'),
- bottle.request.environ.get('REQUEST_URI'),
- bottle.request.environ.get('SERVER_PROTOCOL'),
- bottle.response.status_code,
- length))
-
-
-# Error logging to log file
-class ErrorLogging(object):
- def write(self, err):
- logging.error(err)
-
-
-# Middleware to log the requests
-class LogMiddleware(object):
- def __init__(self, app):
- self.app = app
-
- def __call__(self, e, h):
- e['wsgi.errors'] = ErrorLogging()
- ret_val = self.app(e, h)
- log_after_request()
- return ret_val
-
-# overwrite the stderr and stdout to log to the file
-bottle._stderr = logging.error
-bottle._stdout = logging.info
-logging.config.dictConfig(LOGGER_CONF)
-
-bottle_app = LogMiddleware(bottle.app())
-# Use SSL if the certificate and key exists. Otherwise, run without SSL.
-if (os.access(CONSTANTS['key'], os.R_OK) and
- os.access(CONSTANTS['certificate'], os.R_OK)):
- bottle.run(host = "::", port= 8443, server=SSLCherryPyServer, app=bottle_app)
-else:
- bottle.run(host = "::", port = 8080, server='cherrypy', app=bottle_app)
diff --git a/meta-facebook/meta-wedge/recipes-wedge/rest-api/files/rest_bmc.py b/meta-facebook/meta-wedge/recipes-wedge/rest-api/files/rest_bmc.py
deleted file mode 100644
index c4f661e..0000000
--- a/meta-facebook/meta-wedge/recipes-wedge/rest-api/files/rest_bmc.py
+++ /dev/null
@@ -1,77 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2014-present Facebook. All Rights Reserved.
-#
-# This program file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program in a file named COPYING; if not, write to the
-# Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor,
-# Boston, MA 02110-1301 USA
-#
-
-
-from subprocess import *
-import re
-
-# Handler for FRUID resource endpoint
-def get_bmc():
- # Get BMC Reset Reason
- wdt_counter = Popen('devmem 0x1e785010', \
- shell=True, stdout=PIPE).stdout.read()
- wdt_counter = int(wdt_counter, 0)
-
- wdt_counter &= 0xff00
-
- if wdt_counter:
- por_flag = 0
- else:
- por_flag = 1
-
- if por_flag:
- reset_reason = "Power ON Reset"
- else:
- reset_reason = "User Initiated Reset or WDT Reset"
-
- # Get BMC's Up Time
- uptime = Popen('uptime', \
- shell=True, stdout=PIPE).stdout.read()
-
- # Get Usage information
- data = Popen('top -b n1', \
- shell=True, stdout=PIPE).stdout.read()
- adata = data.split('\n')
- mem_usage = adata[0]
- cpu_usage = adata[1]
-
- # Get OpenBMC version
- version = ""
- data = Popen('cat /etc/issue', \
- shell=True, stdout=PIPE).stdout.read()
- ver = re.search(r'v([\w\d._-]*)\s', data)
- if ver:
- version = ver.group(1)
-
- result = {
- "Information": {
- "Description": "Wedge BMC",
- "Reset Reason": reset_reason,
- "Uptime": uptime,
- "Memory Usage": mem_usage,
- "CPU Usage": cpu_usage,
- "OpenBMC Version": version,
- },
- "Actions": [],
- "Resources": [],
- }
-
- return result;
-
diff --git a/meta-facebook/meta-wedge/recipes-wedge/rest-api/files/rest_fruid.py b/meta-facebook/meta-wedge/recipes-wedge/rest-api/files/rest_fruid.py
deleted file mode 100644
index 3248e92..0000000
--- a/meta-facebook/meta-wedge/recipes-wedge/rest-api/files/rest_fruid.py
+++ /dev/null
@@ -1,89 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2014-present Facebook. All Rights Reserved.
-#
-# This program file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program in a file named COPYING; if not, write to the
-# Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor,
-# Boston, MA 02110-1301 USA
-#
-
-
-from ctypes import *
-
-# Handler for FRUID resource endpoint
-fru = CDLL("libwedge_eeprom.so")
-
-class FRU(Structure):
- _fields_ = [ ("fbw_version", c_ubyte),
- ("fbw_product_name", c_char * 13),
- ("fbw_product_number", c_char * 10),
- ("fbw_assembly_number", c_char * 15),
- ("fbw_facebook_pcba_number", c_char * 15),
- ("fbw_facebook_pcb_number", c_char * 15),
- ("fbw_odm_pcba_number", c_char * 14),
- ("fbw_odm_pcba_serial", c_char * 13),
- ("fbw_production_state", c_ubyte),
- ("fbw_product_version", c_ubyte),
- ("fbw_product_subversion", c_ubyte),
- ("fbw_product_serial", c_char * 13),
- ("fbw_product_asset", c_char * 13),
- ("fbw_system_manufacturer", c_char * 9),
- ("fbw_system_manufacturing_date", c_char * 10),
- ("fbw_pcb_manufacturer", c_char * 9),
- ("fbw_assembled", c_char * 9),
- ("fbw_local_mac", c_ubyte * 6),
- ("fbw_mac_base", c_ubyte * 6),
- ("fbw_dummy", c_char),
- ("fbw_mac_size", c_ushort),
- ("fbw_location", c_char * 9),
- ("fbw_crc8", c_ubyte) ]
-
-def get_fruid():
- myfru = FRU()
- p_myfru = pointer(myfru)
- fru.wedge_eeprom_parse(None, p_myfru)
-
- mac2str = lambda mac: ':'.join(['{:02X}'.format(b) for b in mac])
-
- fruinfo = { "Version": myfru.fbw_version,
- "Product Name": myfru.fbw_product_name,
- "Product Part Number": myfru.fbw_product_number,
- "System Assembly Part Number": myfru.fbw_assembly_number,
- "Facebook PCBA Part Number": myfru.fbw_facebook_pcba_number,
- "Facebook PCB Part Number": myfru.fbw_facebook_pcb_number,
- "ODM PCBA Part Number": myfru.fbw_odm_pcba_number,
- "ODM PCBA Serial Number": myfru.fbw_odm_pcba_serial,
- "Product Production State": myfru.fbw_production_state,
- "Product Version": myfru.fbw_product_version,
- "Product Sub-Version": myfru.fbw_product_subversion,
- "Product Serial Number": myfru.fbw_product_serial,
- "Product Asset Tag": myfru.fbw_product_asset,
- "System Manufacturer": myfru.fbw_system_manufacturer,
- "System Manufacturing Date": myfru.fbw_system_manufacturing_date,
- "PCB Manufacturer": myfru.fbw_pcb_manufacturer,
- "Assembled At": myfru.fbw_assembled,
- "Local MAC": mac2str(myfru.fbw_local_mac),
- "Extended MAC Base": mac2str(myfru.fbw_mac_base),
- "Extended MAC Address Size": myfru.fbw_mac_size,
- "Location on Fabric": myfru.fbw_location,
- "CRC8": hex((myfru.fbw_crc8))
- }
-
- result = {
- "Information": fruinfo,
- "Actions": [],
- "Resources": [],
- }
-
- return result
diff --git a/meta-facebook/meta-wedge/recipes-wedge/rest-api/files/rest_gpios.py b/meta-facebook/meta-wedge/recipes-wedge/rest-api/files/rest_gpios.py
deleted file mode 100644
index 340c5c3..0000000
--- a/meta-facebook/meta-wedge/recipes-wedge/rest-api/files/rest_gpios.py
+++ /dev/null
@@ -1,56 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2014-present Facebook. All Rights Reserved.
-#
-# This program file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program in a file named COPYING; if not, write to the
-# Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor,
-# Boston, MA 02110-1301 USA
-#
-
-from rest_fruid import get_fruid
-
-WEDGES = ["Wedge-AC-F", "Wedge-DC-F"]
-
-
-def read_gpio_sysfs(gpio):
- with open('/sys/class/gpio/gpio%d/value' % gpio, 'r') as f:
- val_string = f.read()
- if val_string == '1\n':
- return 1
- if val_string == '0\n':
- return 0
- return None
-
-
-def read_wedge_back_ports():
- bhinfo = { "port_1": { "pin_1": read_gpio_sysfs(120),
- "pin_2": read_gpio_sysfs(121),
- "pin_3": read_gpio_sysfs(122),
- "pin_4": read_gpio_sysfs(123)
- },
- "port_2": { "pin_1": read_gpio_sysfs(124),
- "pin_2": read_gpio_sysfs(125),
- "pin_3": read_gpio_sysfs(126),
- "pin_4": read_gpio_sysfs(52)
- }
- }
- return bhinfo
-
-
-def get_gpios():
- fruinfo = get_fruid()
- gpioinfo = {}
- if fruinfo["Information"]["Product Name"] in WEDGES:
- gpioinfo["back_ports"] = read_wedge_back_ports()
- return gpioinfo
diff --git a/meta-facebook/meta-wedge/recipes-wedge/rest-api/files/rest_modbus.py b/meta-facebook/meta-wedge/recipes-wedge/rest-api/files/rest_modbus.py
deleted file mode 100644
index 9d213fc..0000000
--- a/meta-facebook/meta-wedge/recipes-wedge/rest-api/files/rest_modbus.py
+++ /dev/null
@@ -1,28 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2014-present Facebook. All Rights Reserved.
-#
-# This program file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program in a file named COPYING; if not, write to the
-# Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor,
-# Boston, MA 02110-1301 USA
-#
-
-import subprocess
-from subprocess import Popen
-
-# Handler for sensors resource endpoint
-def get_modbus_registers():
- p = Popen('/usr/local/bin/rackmondata', stdout=subprocess.PIPE)
- out, err = p.communicate()
- return out
diff --git a/meta-facebook/meta-wedge/recipes-wedge/rest-api/files/rest_psu_update.py b/meta-facebook/meta-wedge/recipes-wedge/rest-api/files/rest_psu_update.py
deleted file mode 100644
index d0e57c7..0000000
--- a/meta-facebook/meta-wedge/recipes-wedge/rest-api/files/rest_psu_update.py
+++ /dev/null
@@ -1,81 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2014-present Facebook. All Rights Reserved.
-#
-# This program file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program in a file named COPYING; if not, write to the
-# Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor,
-# Boston, MA 02110-1301 USA
-#
-
-import subprocess
-from subprocess import Popen
-import os
-import os.path
-import json
-import uuid
-import urllib2
-from tempfile import mkstemp
-from bottle import HTTPError
-
-UPDATE_JOB_DIR = '/var/rackmond/update_jobs'
-UPDATERS = {'delta': '/usr/local/bin/psu-update-delta.py'}
-
-def get_jobs():
- jobs = []
- if not os.path.exists(UPDATE_JOB_DIR):
- os.makedirs(UPDATE_JOB_DIR)
- for f in os.listdir(UPDATE_JOB_DIR):
- fullpath = os.path.join(UPDATE_JOB_DIR, f)
- if f.endswith('.json') and os.path.isfile(fullpath):
- with open(fullpath, 'r') as fh:
- jdata = json.load(fh)
- jdata['job_id'] = os.path.splitext(f)[0]
- jobs.append(jdata)
- return {'jobs': jobs}
-
-updater_process = None
-def begin_job(jobdesc):
- global updater_process
- if updater_process is not None:
- if updater_process.poll() is not None:
- # Update complete
- updater_process = None
- else:
- body = {'error': 'update_already_running',
- 'pid': updater_process.pid }
- raise HTTPError(409, body)
- job_id = str(uuid.uuid1())
- (fwfd, fwfilepath) = mkstemp()
- if not os.path.exists(UPDATE_JOB_DIR):
- os.makedirs(UPDATE_JOB_DIR)
- statusfilepath = os.path.join(UPDATE_JOB_DIR, str(job_id) + '.json')
- status = {'pid': 0,
- 'state': 'fetching' }
- with open(statusfilepath, 'wb') as sfh:
- sfh.write(json.dumps(status))
- fwdata = urllib2.urlopen(jobdesc['fw_url'])
- with os.fdopen(fwfd, 'wb') as fwfile:
- fwfile.write(fwdata.read())
- fwfile.flush()
- updater = UPDATERS[jobdesc.get('updater', 'delta')]
- updater_process = Popen([updater,
- '--addr', str(jobdesc['address']),
- '--statusfile', statusfilepath,
- '--rmfwfile',
- fwfilepath])
- status = {'pid': updater_process.pid,
- 'state': 'starting' }
- with open(statusfilepath, 'wb') as sfh:
- sfh.write(json.dumps(status))
- return {'job_id': job_id, 'pid': updater_process.pid}
diff --git a/meta-facebook/meta-wedge/recipes-wedge/rest-api/files/rest_sensors.py b/meta-facebook/meta-wedge/recipes-wedge/rest-api/files/rest_sensors.py
deleted file mode 100644
index 382513b..0000000
--- a/meta-facebook/meta-wedge/recipes-wedge/rest-api/files/rest_sensors.py
+++ /dev/null
@@ -1,57 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2014-present Facebook. All Rights Reserved.
-#
-# This program file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program in a file named COPYING; if not, write to the
-# Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor,
-# Boston, MA 02110-1301 USA
-#
-
-import json
-import re
-import subprocess
-import bmc_command
-
-# Handler for sensors resource endpoint
-def get_sensors():
- result = []
- proc = subprocess.Popen(['sensors'],
- stdout=subprocess.PIPE,
- stderr=subprocess.PIPE)
- try:
- data, err = bmc_command.timed_communicate(proc)
- except bmc_command.TimeoutError as ex:
- data = ex.output
- err = ex.error
-
- data = re.sub(r'\(.+?\)', '', data)
- for edata in data.split('\n\n'):
- adata = edata.split('\n', 1)
- sresult = {}
- if (len(adata) < 2):
- break;
- sresult['name'] = adata[0]
- for sdata in adata[1].split('\n'):
- tdata = sdata.split(':')
- if (len(tdata) < 2):
- continue
- sresult[tdata[0].strip()] = tdata[1].strip()
- result.append(sresult)
-
- fresult = {
- "Information": result,
- "Actions": [],
- "Resources": [],
- }
- return fresult
diff --git a/meta-facebook/meta-wedge/recipes-wedge/rest-api/files/rest_server.py b/meta-facebook/meta-wedge/recipes-wedge/rest-api/files/rest_server.py
deleted file mode 100644
index 0acba27..0000000
--- a/meta-facebook/meta-wedge/recipes-wedge/rest-api/files/rest_server.py
+++ /dev/null
@@ -1,68 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2014-present Facebook. All Rights Reserved.
-#
-# This program file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program in a file named COPYING; if not, write to the
-# Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor,
-# Boston, MA 02110-1301 USA
-#
-
-
-import os
-from subprocess import *
-
-# Handler for uServer resource endpoint
-def get_server():
- ret = Popen('/usr/local/bin/wedge_power.sh status', \
- shell=True, stdout=PIPE).stdout.read()
- status = ret.rsplit()[-1]
-
- result = {
- "Information": { "status": status },
- "Actions": ["power-on", "power-off", "power-reset"],
- "Resources": [],
- }
-
- return result
-
-def server_action(data):
- if data["action"] == 'power-on':
- ret = Popen('/usr/local/bin/wedge_power.sh status', \
- shell=True, stdout=PIPE).stdout.read()
- status = ret.rsplit()[-1]
- if status == 'on':
- res = 'failure'
- reason = 'already on'
- else:
- ret = Popen('/usr/local/bin/wedge_power.sh on', \
- shell=True, stdout=PIPE).stdout.read()
- res = "success"
- elif data["action"] == 'power-off':
- ret = Popen('/usr/local/bin/wedge_power.sh off', \
- shell=True, stdout=PIPE).stdout.read()
- res = "success"
- elif data["action"] == 'power-reset':
- ret = Popen('/usr/local/bin/wedge_power.sh reset', \
- shell=True, stdout=PIPE).stdout.read()
- res = "success"
- else:
- res = 'failure'
- reason = 'invalid action'
-
- if res == 'failure':
- result = { "result": res, "reason": reason}
- else:
- result = { "result": res }
-
- return result
diff --git a/meta-facebook/meta-wedge/recipes-wedge/rest-api/files/rest_slotid.py b/meta-facebook/meta-wedge/recipes-wedge/rest-api/files/rest_slotid.py
deleted file mode 100644
index ee407ac..0000000
--- a/meta-facebook/meta-wedge/recipes-wedge/rest-api/files/rest_slotid.py
+++ /dev/null
@@ -1,33 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2014-present Facebook. All Rights Reserved.
-#
-# This program file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program in a file named COPYING; if not, write to the
-# Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor,
-# Boston, MA 02110-1301 USA
-#
-
-import subprocess
-
-# Handler for sensors resource endpoint
-def get_slotid():
- p = subprocess.Popen('source /usr/local/bin/openbmc-utils.sh;'
- 'wedge_slot_id $(wedge_board_type)',
- shell=True, stdout=subprocess.PIPE)
- out, err = p.communicate()
- try:
- slot = int(out.strip('\n'))
- except:
- slot = 0
- return { 'slotid' : slot }
diff --git a/meta-facebook/meta-wedge/recipes-wedge/rest-api/files/setup-rest-api.sh b/meta-facebook/meta-wedge/recipes-wedge/rest-api/files/setup-rest-api.sh
deleted file mode 100644
index 2b274dc..0000000
--- a/meta-facebook/meta-wedge/recipes-wedge/rest-api/files/setup-rest-api.sh
+++ /dev/null
@@ -1,79 +0,0 @@
-#!/bin/sh
-#
-# Copyright 2014-present Facebook. All Rights Reserved.
-#
-# This program file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program in a file named COPYING; if not, write to the
-# Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor,
-# Boston, MA 02110-1301 USA
-#
-
-### BEGIN INIT INFO
-# Provides: setup-rest-api
-# Required-Start:
-# Required-Stop:
-# Default-Start: S
-# Default-Stop:
-# Short-Description: Set REST API handler
-### END INIT INFO
-
-# source function library
-. /etc/init.d/functions
-
-ACTION="$1"
-CMD="/usr/local/bin/rest.py"
-case "$ACTION" in
- start)
- echo -n "Setting up REST API handler: "
- pid=$(ps | grep -v grep | grep $CMD | awk '{print $1}')
- if [ $pid ]; then
- echo "already running"
- else
- $CMD > /tmp/rest_start.log 2>&1 &
- echo "done."
- fi
- ;;
- stop)
- echo -n "Stopping REST API handler: "
- pid=$(ps | grep -v grep | grep $CMD | awk '{print $1}')
- if [ $pid ]; then
- kill $pid
- fi
- echo "done."
- ;;
- restart)
- echo -n "Restarting REST API handler: "
- pid=$(ps | grep -v grep | grep $CMD | awk '{print $1}')
- if [ $pid ]; then
- kill $pid
- fi
- sleep 1
- $CMD > /tmp/rest_start.log 2>&1 &
- echo "done."
- ;;
- status)
- if [[ -n $(ps | grep -v grep | grep $CMD | awk '{print $1}') ]]; then
- echo "REST API handler is running"
- else
- echo "REST API is stopped"
- fi
- ;;
- *)
- N=${0##*/}
- N=${N#[SK]??}
- echo "Usage: $N {start|stop|status|restart}" >&2
- exit 1
- ;;
-esac
-
-exit 0
diff --git a/meta-facebook/meta-wedge/recipes-wedge/rest-api/rest-api_0.1.bb b/meta-facebook/meta-wedge/recipes-wedge/rest-api/rest-api_0.1.bb
deleted file mode 100644
index 2ed3f7f..0000000
--- a/meta-facebook/meta-wedge/recipes-wedge/rest-api/rest-api_0.1.bb
+++ /dev/null
@@ -1,71 +0,0 @@
-# Copyright 2014-present Facebook. All Rights Reserved.
-#
-# This program file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program in a file named COPYING; if not, write to the
-# Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor,
-# Boston, MA 02110-1301 USA
-SUMMARY = "Rest API Daemon"
-DESCRIPTION = "Daemon to handle RESTful interface."
-SECTION = "base"
-PR = "r1"
-LICENSE = "GPLv2"
-LIC_FILES_CHKSUM = "file://rest.py;beginline=5;endline=18;md5=0b1ee7d6f844d472fa306b2fee2167e0"
-
-
-DEPENDS_append = " update-rc.d-native"
-
-SRC_URI = "file://setup-rest-api.sh \
- file://rest.py \
- file://rest_bmc.py \
- file://rest_fruid.py \
- file://rest_gpios.py \
- file://rest_server.py \
- file://rest_sensors.py \
- file://rest_modbus.py \
- file://rest_slotid.py \
- file://rest_psu_update.py \
- file://bmc_command.py \
- "
-
-S = "${WORKDIR}"
-
-binfiles = "rest.py rest_bmc.py rest_fruid.py rest_gpios.py rest_server.py rest_sensors.py bmc_command.py rest_modbus.py rest_slotid.py rest_psu_update.py setup-rest-api.sh"
-
-pkgdir = "rest-api"
-
-do_install() {
- dst="${D}/usr/local/fbpackages/${pkgdir}"
- bin="${D}/usr/local/bin"
- install -d $dst
- install -d $bin
- for f in ${binfiles}; do
- install -m 755 $f ${dst}/$f
- ln -snf ../fbpackages/${pkgdir}/$f ${bin}/$f
- done
- for f in ${otherfiles}; do
- install -m 644 $f ${dst}/$f
- done
- install -d ${D}${sysconfdir}/init.d
- install -d ${D}${sysconfdir}/rcS.d
- install -m 755 setup-rest-api.sh ${D}${sysconfdir}/init.d/setup-rest-api.sh
- update-rc.d -r ${D} setup-rest-api.sh start 95 2 3 4 5 .
-}
-
-FBPACKAGEDIR = "${prefix}/local/fbpackages"
-
-FILES_${PN} = "${FBPACKAGEDIR}/rest-api ${prefix}/local/bin ${sysconfdir} "
-
-# Inhibit complaints about .debug directories for the fand binary:
-
-INHIBIT_PACKAGE_DEBUG_SPLIT = "1"
-INHIBIT_PACKAGE_STRIP = "1"
diff --git a/meta-facebook/meta-wedge/recipes-wedge/sensor-setup/files/sensor-setup.sh b/meta-facebook/meta-wedge/recipes-wedge/sensor-setup/files/sensor-setup.sh
deleted file mode 100644
index 0027828..0000000
--- a/meta-facebook/meta-wedge/recipes-wedge/sensor-setup/files/sensor-setup.sh
+++ /dev/null
@@ -1,52 +0,0 @@
-#!/bin/sh
-#
-# Copyright 2014-present Facebook. All Rights Reserved.
-#
-# This program file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program in a file named COPYING; if not, write to the
-# Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor,
-# Boston, MA 02110-1301 USA
-#
-
-### BEGIN INIT INFO
-# Provides: sensor-setup
-# Required-Start: power-on
-# Required-Stop:
-# Default-Start: S
-# Default-Stop:
-# Short-Description: Power on micro-server
-### END INIT INFO
-
-# Eventually, this will be used to configure the various (mostly
-# i2c-based) sensors, once we have a kernel version that supports
-# doing this more dynamically.
-#
-# For now, we're using it to install the lm75 and pmbus module so that it
-# can detect the fourth temperature sensor, which is located
-# on the uServer, which doesn't get power until power-on executes.
-#
-# Similarly, the pmbus sensor seems to have an easier time of
-# detecting the NCP4200 buck converters after poweron. This has not
-# been carefully explored.
-
-modprobe lm75
-modprobe pmbus
-
-# Enable the ADC inputs; adc5 - adc9 should be connected to
-# 1V, 1.03V, 5V, 3.3V, and 2.5V.
-
-echo 1 > /sys/devices/platform/ast_adc.0/adc5_en
-echo 1 > /sys/devices/platform/ast_adc.0/adc6_en
-echo 1 > /sys/devices/platform/ast_adc.0/adc7_en
-echo 1 > /sys/devices/platform/ast_adc.0/adc8_en
-echo 1 > /sys/devices/platform/ast_adc.0/adc9_en
diff --git a/meta-facebook/meta-wedge/recipes-wedge/sensor-setup/sensor-setup_0.1.bb b/meta-facebook/meta-wedge/recipes-wedge/sensor-setup/sensor-setup_0.1.bb
deleted file mode 100644
index 1b0f937..0000000
--- a/meta-facebook/meta-wedge/recipes-wedge/sensor-setup/sensor-setup_0.1.bb
+++ /dev/null
@@ -1,38 +0,0 @@
-# Copyright 2014-present Facebook. All Rights Reserved.
-#
-# This program file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program in a file named COPYING; if not, write to the
-# Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor,
-# Boston, MA 02110-1301 USA
-SUMMARY = "Configure the sensors"
-DESCRIPTION = "The script configure sensors"
-SECTION = "base"
-PR = "r1"
-LICENSE = "GPLv2"
-LIC_FILES_CHKSUM = "file://sensor-setup.sh;beginline=5;endline=18;md5=0b1ee7d6f844d472fa306b2fee2167e0"
-
-DEPENDS_append = " update-rc.d-native"
-
-SRC_URI = "file://sensor-setup.sh \
- "
-
-S = "${WORKDIR}"
-
-do_install() {
- install -d ${D}${sysconfdir}/init.d
- install -d ${D}${sysconfdir}/rcS.d
- install -m 755 sensor-setup.sh ${D}${sysconfdir}/init.d/sensor-setup.sh
- update-rc.d -r ${D} sensor-setup.sh start 90 S .
-}
-
-FILES_${PN} = " ${sysconfdir} "
diff --git a/meta-facebook/meta-wedge/recipes-wedge/sms-kcsd/sms-kcsd/Makefile b/meta-facebook/meta-wedge/recipes-wedge/sms-kcsd/sms-kcsd/Makefile
deleted file mode 100644
index dba9dbb..0000000
--- a/meta-facebook/meta-wedge/recipes-wedge/sms-kcsd/sms-kcsd/Makefile
+++ /dev/null
@@ -1,26 +0,0 @@
-# Copyright 2014-present Facebook. All Rights Reserved.
-#
-# This program file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program in a file named COPYING; if not, write to the
-# Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor,
-# Boston, MA 02110-1301 USA
-
-all: sms-kcsd
-
-sms-kcsd: sms-kcsd.c
- $(CC) -pthread -lalert_control -lipmi -std=c99 -o $@ $^ $(LDFLAGS)
-
-.PHONY: clean
-
-clean:
- rm -rf *.o sms-kcsd
diff --git a/meta-facebook/meta-wedge/recipes-wedge/sms-kcsd/sms-kcsd/setup-sms-kcs.sh b/meta-facebook/meta-wedge/recipes-wedge/sms-kcsd/sms-kcsd/setup-sms-kcs.sh
deleted file mode 100644
index b4234a4..0000000
--- a/meta-facebook/meta-wedge/recipes-wedge/sms-kcsd/sms-kcsd/setup-sms-kcs.sh
+++ /dev/null
@@ -1,32 +0,0 @@
-#!/bin/sh
-#
-# Copyright 2014-present Facebook. All Rights Reserved.
-#
-# This program file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program in a file named COPYING; if not, write to the
-# Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor,
-# Boston, MA 02110-1301 USA
-#
-
-### BEGIN INIT INFO
-# Provides: setup-sms-kcs
-# Required-Start:
-# Required-Stop:
-# Default-Start: S
-# Default-Stop:
-# Short-Description: Set SMS KCS handler
-### END INIT INFO
-
-echo -n "Setup SMS KCS message handler... "
-/usr/local/bin/sms-kcsd
-echo "done."
diff --git a/meta-facebook/meta-wedge/recipes-wedge/sms-kcsd/sms-kcsd/sms-kcsd.c b/meta-facebook/meta-wedge/recipes-wedge/sms-kcsd/sms-kcsd/sms-kcsd.c
deleted file mode 100644
index a264fb7..0000000
--- a/meta-facebook/meta-wedge/recipes-wedge/sms-kcsd/sms-kcsd/sms-kcsd.c
+++ /dev/null
@@ -1,144 +0,0 @@
-/*
- * sms-kcsd
- *
- * Copyright 2014-present Facebook. All Rights Reserved.
- *
- * Daemon to monitor traffic coming from sms-kcs interface
- * and respond to the command using IPMI stack
- *
- * TODO: Determine if the daemon is already started.
- * TODO: Cache the file descriptors instead of fopen/fclose everytime
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <errno.h>
-#include <syslog.h>
-#include <facebook/alert_control.h>
-#include <facebook/ipmi.h>
-
-
-#define PATH_SMS_KCS "/sys/bus/i2c/drivers/panther_plus/4-0040/sms_kcs"
-#define MAX_ALERT_CONTROL_RETRIES 3
-
-typedef struct {
- unsigned char fbid;
- unsigned char length;
- unsigned char buf[];
-} kcs_msg_t;
-
-/*
- * Function to check if there is any new KCS message available
- * TODO: Will be replaced by interrupt-driven approach
- */
-static bool
-is_new_kcs_msg(void) {
- return is_alert_present(FBID_SMS_KCS);
-}
-
-/*
- * KCS Message Handler:
- * - Reads the incoming request on KCS channel
- * - Invokes IPMI handler to provide response
- * - Writes reply back to KCS channel
- */
-static int
-handle_kcs_msg(void) {
- FILE *fp;
- kcs_msg_t *msg;
- unsigned char rbuf[256] = {0};
- unsigned char tbuf[256] = {0};
- unsigned char tlen = 0;
- int count = 0;
- int i = 0;
-
- // Reads incoming request
- fp = fopen(PATH_SMS_KCS, "r");
- if (!fp) {
- syslog(LOG_ALERT, "failed to open file %s\n", PATH_SMS_KCS);
- return -1;
- }
-
- count = fread(rbuf, sizeof(unsigned char), sizeof(rbuf), fp);
- if (count == 0) {
- syslog(LOG_INFO, "fread returns zero bytes\n");
- fclose(fp);
- return -1;
- }
-
- fclose(fp);
-
- msg = (kcs_msg_t*)rbuf;
-
- // Invoke IPMI handler
- ipmi_handle(msg->buf, msg->length, &tbuf[1], &tlen);
-
- // Fill the length as returned by IPMI stack
- tbuf[0] = tlen;
-
- //Write Reply back to KCS channel
- fp = fopen(PATH_SMS_KCS, "w");
- if (!fp) {
- syslog(LOG_ALERT, "failed to open file %s\n", PATH_SMS_KCS);
- return -1;
- }
-
- count = fwrite(tbuf, sizeof(unsigned char), tlen+1, fp);
- if (count != tlen+1) {
- syslog(LOG_ALERT, "fwrite returns: %d, expected: %d\n", count, tlen+1);
- fclose(fp);
- return -1;
- }
-
- fclose(fp);
-
- return 0;
-}
-
-/*
- * Daemon Main loop
- */
-int main(int argc, char **argv) {
- int i;
- int ret;
- daemon(1, 0);
- openlog("sms-kcs", LOG_CONS, LOG_DAEMON);
-
- // Enable alert for SMS KCS Function Block
- for (i = 0; i < MAX_ALERT_CONTROL_RETRIES; i++) {
- ret = alert_control(FBID_SMS_KCS, FLAG_ENABLE);
- if (!ret) {
- break;
- }
- sleep(2);
- }
-
- // Exit with error in case we can not set the Alert
- if(ret) {
- syslog(LOG_ALERT, "Can not enable SMS KCS Alert\n");
- exit(-1);
- }
-
- // Forever loop to poll and process KCS messages
- while (1) {
- if (is_new_kcs_msg()) {
- handle_kcs_msg();
- }
- sleep(1);
- }
-}
diff --git a/meta-facebook/meta-wedge/recipes-wedge/sms-kcsd/sms-kcsd_0.1.bb b/meta-facebook/meta-wedge/recipes-wedge/sms-kcsd/sms-kcsd_0.1.bb
deleted file mode 100644
index 812d815..0000000
--- a/meta-facebook/meta-wedge/recipes-wedge/sms-kcsd/sms-kcsd_0.1.bb
+++ /dev/null
@@ -1,61 +0,0 @@
-# Copyright 2014-present Facebook. All Rights Reserved.
-#
-# This program file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program in a file named COPYING; if not, write to the
-# Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor,
-# Boston, MA 02110-1301 USA
-SUMMARY = "SMS KCS Daemon"
-DESCRIPTION = "Daemon to handle SMS KCS interface."
-SECTION = "base"
-PR = "r1"
-LICENSE = "GPLv2"
-LIC_FILES_CHKSUM = "file://sms-kcsd.c;beginline=12;endline=24;md5=da35978751a9d71b73679307c4d296ec"
-
-
-DEPENDS_append = " update-rc.d-native"
-
-DEPENDS += "libalert-control"
-DEPENDS += "libipmi"
-
-SRC_URI = "file://Makefile \
- file://setup-sms-kcs.sh \
- file://sms-kcsd.c \
- "
-
-S = "${WORKDIR}"
-
-binfiles = "sms-kcsd"
-
-pkgdir = "sms-kcsd"
-
-do_install() {
- dst="${D}/usr/local/fbpackages/${pkgdir}"
- bin="${D}/usr/local/bin"
- install -d $dst
- install -d $bin
- install -m 755 sms-kcsd ${dst}/sms-kcsd
- ln -snf ../fbpackages/${pkgdir}/sms-kcsd ${bin}/sms-kcsd
- install -d ${D}${sysconfdir}/init.d
- install -d ${D}${sysconfdir}/rcS.d
- install -m 755 setup-sms-kcs.sh ${D}${sysconfdir}/init.d/setup-sms-kcs.sh
- update-rc.d -r ${D} setup-sms-kcs.sh start 65 S .
-}
-
-FBPACKAGEDIR = "${prefix}/local/fbpackages"
-
-FILES_${PN} = "${FBPACKAGEDIR}/sms-kcsd ${prefix}/local/bin ${sysconfdir} "
-
-# Inhibit complaints about .debug directories for the fand binary:
-
-INHIBIT_PACKAGE_DEBUG_SPLIT = "1"
-INHIBIT_PACKAGE_STRIP = "1"
diff --git a/meta-facebook/meta-wedge/recipes-wedge/usb-console/files/usbcons.sh b/meta-facebook/meta-wedge/recipes-wedge/usb-console/files/usbcons.sh
deleted file mode 100755
index de284bb..0000000
--- a/meta-facebook/meta-wedge/recipes-wedge/usb-console/files/usbcons.sh
+++ /dev/null
@@ -1,80 +0,0 @@
-#! /bin/sh
-#
-# Copyright 2014-present Facebook. All Rights Reserved.
-#
-# This program file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program in a file named COPYING; if not, write to the
-# Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor,
-# Boston, MA 02110-1301 USA
-#
-
-### BEGIN INIT INFO
-# Provides: usbcons
-# Required-Start:
-# Required-Stop:
-# Default-Start: S
-# Default-Stop: 0 6
-# Short-Description: Creates a virtual USB serial device and starts a console
-# on it.
-#
-### END INIT INFO
-
-PATH=/sbin:/bin:/usr/sbin:/usr/bin
-NAME=usbcons
-PIDFILE=/run/usbcons.pid
-DESC="USB Serial Console"
-
-# source function library
-. /etc/init.d/functions
-
-STOPPER=
-ACTION="$1"
-
-case "$ACTION" in
- start)
- # Ability to prevent this from starting by editing cmdline in u-boot.
- # Keeping this here until I get gadget switching working properly. (t4906522)
- if grep "nousbcons" /proc/cmdline > /dev/null 2>&1
- then
- echo "USB Console Disabled."
- exit 0
- fi
- echo -n "Starting $DESC: "
- /usr/local/bin/usbmon.sh > /dev/null 2>&1 &
- echo "$NAME."
- ;;
- stop)
- echo -n "Stopping $DESC: "
- killall usbmon.sh
- echo "$NAME."
- ;;
- restart|force-reload)
- echo -n "Restarting $DESC: "
- killall usbmon.sh
- sleep 1
- /usr/local/bin/usbmon.sh > /dev/null 2>&1 &
- echo "$NAME."
- ;;
- status)
- status $DAEMON
- exit $?
- ;;
- *)
- N=${0##*/}
- N=${N#[SK]??}
- echo "Usage: $N {start|stop|status|restart|force-reload}" >&2
- exit 1
- ;;
-esac
-
-exit 0
diff --git a/meta-facebook/meta-wedge/recipes-wedge/usb-console/files/usbmon.sh b/meta-facebook/meta-wedge/recipes-wedge/usb-console/files/usbmon.sh
deleted file mode 100755
index 2e1ee67..0000000
--- a/meta-facebook/meta-wedge/recipes-wedge/usb-console/files/usbmon.sh
+++ /dev/null
@@ -1,34 +0,0 @@
-#!/bin/sh
-#
-# Copyright 2014-present Facebook. All Rights Reserved.
-#
-# This program file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program in a file named COPYING; if not, write to the
-# Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor,
-# Boston, MA 02110-1301 USA
-#
-
-modprobe g_cdc host_addr=02:00:00:00:00:02 dev_addr=02:00:00:00:00:01
-# For g-ether interface, if the remote side brings down the interface, BMC side
-# still treats it as up. In this case, all packets through usb0 (i.e. NDP) will
-# be queued in the kernel for this interface. Ether interface has the default
-# TX queue length as 1000, which means there could be up to 1000 package queued
-# in kernel for that. In our case, kmalloc-192 is exhausted when 298 packets
-# are queued.
-# To solve this issue, we change the TX queue length for usb0 to 64 to avoid
-# memory exhaust.
-ifconfig usb0 txqueuelen 64
-while true; do
- getty /dev/ttyGS0 57600
- sleep 1
-done
diff --git a/meta-facebook/meta-wedge/recipes-wedge/usb-console/usb-console_0.1.bb b/meta-facebook/meta-wedge/recipes-wedge/usb-console/usb-console_0.1.bb
deleted file mode 100644
index c934f46..0000000
--- a/meta-facebook/meta-wedge/recipes-wedge/usb-console/usb-console_0.1.bb
+++ /dev/null
@@ -1,42 +0,0 @@
-# Copyright 2014-present Facebook. All Rights Reserved.
-#
-# This program file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program in a file named COPYING; if not, write to the
-# Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor,
-# Boston, MA 02110-1301 USA
-SUMMARY = "Set up a USB serial console"
-DESCRIPTION = "Sets up a USB serial console"
-SECTION = "base"
-PR = "r1"
-LICENSE = "GPLv2"
-LIC_FILES_CHKSUM = "file://usbcons.sh;beginline=5;endline=18;md5=0b1ee7d6f844d472fa306b2fee2167e0"
-
-DEPENDS_append = " update-rc.d-native"
-
-SRC_URI = "file://usbcons.sh \
- file://usbmon.sh \
- "
-
-S = "${WORKDIR}"
-
-do_install() {
- install -d ${D}${sysconfdir}/init.d
- install -d ${D}${sysconfdir}/rcS.d
- install -m 755 usbcons.sh ${D}${sysconfdir}/init.d/usbcons.sh
- update-rc.d -r ${D} usbcons.sh start 90 S .
- localbindir="${D}/usr/local/bin"
- install -d ${localbindir}
- install -m 755 usbmon.sh ${localbindir}/usbmon.sh
-}
-
-FILES_${PN} = " ${sysconfdir} /usr/local"
diff --git a/meta-facebook/meta-wedge/recipes-wedge/wedge-eeprom/files/lib/Makefile b/meta-facebook/meta-wedge/recipes-wedge/wedge-eeprom/files/lib/Makefile
deleted file mode 100644
index 8c05686..0000000
--- a/meta-facebook/meta-wedge/recipes-wedge/wedge-eeprom/files/lib/Makefile
+++ /dev/null
@@ -1,27 +0,0 @@
-# Copyright 2014-present Facebook. All Rights Reserved.
-#
-# This program file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program in a file named COPYING; if not, write to the
-# Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor,
-# Boston, MA 02110-1301 USA
-
-lib: libwedge_eeprom.so
-
-libwedge_eeprom.so: wedge_eeprom.c
- $(CC) $(CFLAGS) -fPIC -c -o wedge_eeprom.o wedge_eeprom.c
- $(CC) -shared -o libwedge_eeprom.so wedge_eeprom.o -lc
-
-.PHONY: clean
-
-clean:
- rm -rf *.o libwedge_eeprom.so
diff --git a/meta-facebook/meta-wedge/recipes-wedge/wedge-eeprom/files/lib/wedge_eeprom.c b/meta-facebook/meta-wedge/recipes-wedge/wedge-eeprom/files/lib/wedge_eeprom.c
deleted file mode 100644
index 7e9b50d..0000000
--- a/meta-facebook/meta-wedge/recipes-wedge/wedge-eeprom/files/lib/wedge_eeprom.c
+++ /dev/null
@@ -1,419 +0,0 @@
-/*
- * Copyright 2014-present Facebook. All Rights Reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-
-#include "wedge_eeprom.h"
-
-#include <assert.h>
-#include <errno.h>
-#include <stdio.h>
-#include <string.h>
-
-#include <openbmc/log.h>
-
-#ifndef FBW_EEPROM_FILE
-#define FBW_EEPROM_FILE "/sys/class/i2c-adapter/i2c-6/6-0050/eeprom"
-#endif
-
-#define FBW_EEPROM_VERSION0 0
-#define FBW_EEPROM_V0_SIZE 162
-#define FBW_EEPROM_VERSION1 1
-#define FBW_EEPROM_V1_SIZE 174
-
-/*
- * The eeprom size is 8K, we only use 157 bytes for v1 format.
- * Read 256 for now.
- */
-#define FBW_EEPROM_SIZE 256
-
-
-static inline uint8_t fbw_crc8(uint8_t crc, uint8_t data)
-{
- /* donot verify crc now, always return 0 */
- return 0;
-}
-
-static uint8_t fbw_crc8_buf(const uint8_t *buf, int len)
-{
- uint8_t crc = 0;
- int i;
-
- for (i = 0, crc = 0; i < len; i++) {
- crc = fbw_crc8(crc, buf[i]);
- }
-
- return crc;
-}
-
-static inline void fbw_copy_uint8(uint8_t *val, const uint8_t** src,
- int src_len)
-{
- assert(src_len >= sizeof(*val));
- *val = **src;
- (*src) += src_len;
-}
-
-static inline void fbw_copy_uint16(uint16_t *val, const uint8_t** src,
- int src_len)
-{
- assert(src_len >= sizeof(*val));
- *val = (**src) | ((*(*src + 1)) << 8);
- (*src) += src_len;
-}
-
-static inline void fbw_copy_uint32(uint32_t *val, const uint8_t** src,
- int src_len)
-{
- assert(src_len >= sizeof(*val));
- *val = (**src)
- | ((*(*src + 1)) << 8)
- | ((*(*src + 2)) << 16)
- | ((*(*src + 3)) << 24);
- (*src) += src_len;
-}
-
-static inline void fbw_strcpy(char *dst, int dst_len,
- const uint8_t **src, int src_len)
-{
- assert(dst_len >= src_len + 1); /* larger because of '\0' */
- strncpy(dst, (char *)*src, src_len);
- dst[src_len + 1] = '\0';
- (*src) += src_len;
-}
-
-static inline void fbw_copy_product_number(
- char *dst, int dst_len, const uint8_t **src, int src_len)
-{
- int i;
- const uint8_t *cur = *src;
- /* 8 letter in the format of XX-XXXXXX, 2 additional letters */
- assert(dst_len >= src_len + 2);
- for (i = 0; i < 2; i++) {
- *dst++ = *cur++;
- }
- *dst++ = '-';
- for (i = 0; i < 6; i++) {
- *dst++ = *cur++;
- }
- *dst = '\0';
- (*src) += src_len;
-}
-
-static inline void fbw_copy_assembly_number(
- char *dst, int dst_len, const uint8_t **src, int src_len)
-{
- int i;
- const uint8_t *cur = *src;
- /* 11 letter in the format of XXX-XXXXXX-XX, 3 additional letters */
- assert(dst_len >= src_len + 3);
- for (i = 0; i < 3; i++) {
- *dst++ = *cur++;
- }
- *dst++ = '-';
- for (i = 0; i < 6; i++) {
- *dst++ = *cur++;
- }
- *dst++ = '-';
- for (i = 0; i < 2; i++) {
- *dst++ = *cur++;
- }
- *dst = '\0';
- (*src) += src_len;
-}
-
-static inline void fbw_copy_facebook_pcb_part(
- char *dst, int dst_len, const uint8_t **src, int src_len)
-{
- int i;
- const uint8_t *cur = *src;
- /* 11 letter in the format of XXX-XXXXXX-XX, 3 additional letters */
- assert(dst_len >= src_len + 3);
- for (i = 0; i < 3; i++) {
- *dst++ = *cur++;
- }
- *dst++ = '-';
- for (i = 0; i < 6; i++) {
- *dst++ = *cur++;
- }
- *dst++ = '-';
- for (i = 0; i < 2; i++) {
- *dst++ = *cur++;
- }
- *dst = '\0';
- (*src) += src_len;
-}
-
-static inline void fbw_copy_date(
- char *dst, int dst_len, const uint8_t **src, int src_len)
-{
- const uint8_t *cur = *src;
- uint16_t year;
- uint8_t month;
- uint8_t day;
- /* mm-dd-yy in output */
- assert(dst_len >= 9);
- /* input is 4 bytes YY YY MM DD */
- assert(src_len >= 4);
- fbw_copy_uint16(&year, &cur, 2);
- fbw_copy_uint8(&month, &cur, 1);
- fbw_copy_uint8(&day, &cur, 1);
- snprintf(dst, dst_len, "%02d-%02d-%02d", month % 13, day % 32, year % 100);
- (*src) += src_len;
-}
-
-static inline uint8_t _a2v(const uint8_t *a)
-{
- uint8_t v = *a;
- if ('0' <= v && v <= '9') {
- return v - '0';
- }
- if ('a' <= v && v <= 'z') {
- return v - 'a' + 10;
- }
- if ('A' <= v && v <= 'Z') {
- return v - 'A' + 10;
- }
- return 0;
-}
-
-static inline void fbw_copy_mac(
- uint8_t* dst, int dst_len, const uint8_t **src, int src_len)
-{
- int i;
- const uint8_t *cur = *src;
-
- assert(dst_len >= 6);
- assert(src_len >= 12);
-
- for (i = 0; i < 6; i++) {
- *dst = (_a2v(cur) << 4) | _a2v(cur + 1);
- dst++;
- cur +=2 ;
- }
- (*src) += src_len;
-}
-
-static int fbw_parse_buffer(
- const uint8_t *buf, int len, struct wedge_eeprom_st *eeprom) {
- int rc = 0;
- const uint8_t* cur = buf;
- uint16_t magic;
- int crc_len;
- uint8_t crc8;
-
- memset(eeprom, 0, sizeof(*eeprom));
-
- /* make sure the magic number */
- fbw_copy_uint16(&magic, &cur, FBW_EEPROM_F_MAGIC);
- if (magic != 0xfbfb) {
- rc = EFAULT;
- LOG_ERR(rc, "Unexpected magic word 0x%x", magic);
- goto out;
- }
-
- /* confirm the version number, only version is supported */
- fbw_copy_uint8(&eeprom->fbw_version, &cur, FBW_EEPROM_F_VERSION);
- if ((eeprom->fbw_version != FBW_EEPROM_VERSION0) &&
- (eeprom->fbw_version != FBW_EEPROM_VERSION1)) {
- rc = EFAULT;
- LOG_ERR(rc, "Unsupported version number %u", eeprom->fbw_version);
- goto out;
- } else {
- if (eeprom->fbw_version == FBW_EEPROM_VERSION0) {
- crc_len = FBW_EEPROM_V0_SIZE;
- } else if (eeprom->fbw_version == FBW_EEPROM_VERSION1) {
- crc_len = FBW_EEPROM_V1_SIZE;
- }
- assert(crc_len <= len);
- }
-
- /* check CRC */
- crc8 = fbw_crc8_buf(buf, crc_len);
- if (crc8 != 0) {
- rc = EFAULT;
- LOG_ERR(rc, "CRC check failed");
- goto out;
- }
-
- /* Product name: ASCII for 12 characters */
- fbw_strcpy(eeprom->fbw_product_name,
- sizeof(eeprom->fbw_product_name),
- &cur, FBW_EEPROM_F_PRODUCT_NAME);
-
- /* Product Part #: 8 byte data shown as XX-XXXXXXX */
- fbw_copy_product_number(eeprom->fbw_product_number,
- sizeof(eeprom->fbw_product_number),
- &cur, FBW_EEPROM_F_PRODUCT_NUMBER);
-
- /* System Assembly Part Number: XXX-XXXXXX-XX */
- fbw_copy_assembly_number(eeprom->fbw_assembly_number,
- sizeof(eeprom->fbw_assembly_number),
- &cur, FBW_EEPROM_F_ASSEMBLY_NUMBER);
-
- /* Facebook PCBA Part Number: XXX-XXXXXXX-XX */
- fbw_copy_facebook_pcb_part(eeprom->fbw_facebook_pcba_number,
- sizeof(eeprom->fbw_facebook_pcba_number),
- &cur, FBW_EEPROM_F_FACEBOOK_PCBA_NUMBER);
-
- /* Facebook PCBA Part Number: XXX-XXXXXXX-XX */
- if (eeprom->fbw_version >= FBW_EEPROM_VERSION1) {
- fbw_copy_facebook_pcb_part(eeprom->fbw_facebook_pcb_number,
- sizeof(eeprom->fbw_facebook_pcb_number),
- &cur, FBW_EEPROM_F_FACEBOOK_PCB_NUMBER);
- }
-
- /* ODM PCB Part Number: XXXXXXXXXXXX */
- fbw_strcpy(eeprom->fbw_odm_pcba_number,
- sizeof(eeprom->fbw_odm_pcba_number),
- &cur, FBW_EEPROM_F_ODM_PCBA_NUMBER);
-
- /* ODM PCB Serial Number: XXXXXXXXXXXX */
- fbw_strcpy(eeprom->fbw_odm_pcba_serial,
- sizeof(eeprom->fbw_odm_pcba_serial),
- &cur, FBW_EEPROM_F_ODM_PCBA_SERIAL);
-
- /* Product Production State */
- fbw_copy_uint8(&eeprom->fbw_production_state,
- &cur, FBW_EEPROM_F_PRODUCT_STATE);
-
- /* Product Version */
- fbw_copy_uint8(&eeprom->fbw_product_version,
- &cur, FBW_EEPROM_F_PRODUCT_VERSION);
-
- /* Product Sub Version */
- fbw_copy_uint8(&eeprom->fbw_product_subversion,
- &cur, FBW_EEPROM_F_PRODUCT_SUBVERSION);
-
- /* Product Serial Number: XXXXXXXX */
- fbw_strcpy(eeprom->fbw_product_serial,
- sizeof(eeprom->fbw_product_serial),
- &cur, FBW_EEPROM_F_PRODUCT_SERIAL);
-
- /* Product Assert Tag: XXXXXXXX */
- fbw_strcpy(eeprom->fbw_product_asset,
- sizeof(eeprom->fbw_product_asset),
- &cur, FBW_EEPROM_F_PRODUCT_ASSET);
-
- /* System Manufacturer: XXXXXXXX */
- fbw_strcpy(eeprom->fbw_system_manufacturer,
- sizeof(eeprom->fbw_system_manufacturer),
- &cur, FBW_EEPROM_F_SYSTEM_MANUFACTURER);
-
- /* System Manufacturing Date: mm-dd-yy */
- fbw_copy_date(eeprom->fbw_system_manufacturing_date,
- sizeof(eeprom->fbw_system_manufacturing_date),
- &cur, FBW_EEPROM_F_SYSTEM_MANU_DATE);
-
- /* PCB Manufacturer: XXXXXXXXX */
- fbw_strcpy(eeprom->fbw_pcb_manufacturer,
- sizeof(eeprom->fbw_pcb_manufacturer),
- &cur, FBW_EEPROM_F_PCB_MANUFACTURER);
-
- /* Assembled At: XXXXXXXX */
- fbw_strcpy(eeprom->fbw_assembled,
- sizeof(eeprom->fbw_assembled),
- &cur, FBW_EEPROM_F_ASSEMBLED);
-
- /* Local MAC Address */
- fbw_copy_mac(eeprom->fbw_local_mac,
- sizeof(eeprom->fbw_local_mac),
- &cur, FBW_EEPROM_F_LOCAL_MAC);
-
- /* Extended MAC Address */
- fbw_copy_mac(eeprom->fbw_mac_base,
- sizeof(eeprom->fbw_mac_base),
- &cur, FBW_EEPROM_F_EXT_MAC_BASE);
-
- /* Extended MAC Address Size */
- fbw_copy_uint16(&eeprom->fbw_mac_size,
- &cur,FBW_EEPROM_F_EXT_MAC_SIZE);
-
- /* Location on Fabric: "LEFT"/"RIGHT", "WEDGE", "LC" */
- fbw_strcpy(eeprom->fbw_location,
- sizeof(eeprom->fbw_location),
- &cur, FBW_EEPROM_F_LOCATION);
-
- /* CRC8 */
- fbw_copy_uint8(&eeprom->fbw_crc8,
- &cur, FBW_EEPROM_F_CRC8);
-
- assert((cur - buf) <= len);
-
- out:
- return rc;
-}
-
-int wedge_eeprom_parse(const char *fn, struct wedge_eeprom_st *eeprom)
-{
- int rc = 0;
- uint32_t len;
- FILE *fin;
- char buf[FBW_EEPROM_SIZE];
-
- if (!eeprom) {
- return -EINVAL;
- }
-
- if (!fn) {
- fn = FBW_EEPROM_FILE;
- }
-
- fin = fopen(fn, "r");
- if (fin == NULL) {
- rc = errno;
- LOG_ERR(rc, "Failed to open %s", FBW_EEPROM_FILE);
- goto out;
- }
-
- /* check the file size */
- rc = fseek(fin, 0, SEEK_END);
- if (rc) {
- rc = errno;
- LOG_ERR(rc, "Failed to seek to the end of %s", FBW_EEPROM_FILE);
- goto out;
- }
-
- len = ftell(fin);
- if (len < FBW_EEPROM_SIZE) {
- rc = ENOSPC;
- LOG_ERR(rc, "File '%s' is too small (%u < %u)", FBW_EEPROM_FILE,
- len, FBW_EEPROM_SIZE);
- goto out;
- }
-
- /* go back to the beginning of the file */
- rewind(fin);
-
- rc = fread(buf, 1, sizeof(buf), fin);
- if (rc < sizeof(buf)) {
- LOG_ERR(ENOSPC, "Failed to complete the read. Only got %d", rc);
- rc = ENOSPC;
- goto out;
- }
-
- rc = fbw_parse_buffer((const uint8_t *)buf, sizeof(buf), eeprom);
- if (rc) {
- goto out;
- }
-
- out:
- if (fin) {
- fclose(fin);
- }
-
- return -rc;
-}
diff --git a/meta-facebook/meta-wedge/recipes-wedge/wedge-eeprom/files/lib/wedge_eeprom.h b/meta-facebook/meta-wedge/recipes-wedge/wedge-eeprom/files/lib/wedge_eeprom.h
deleted file mode 100644
index 8aa012f..0000000
--- a/meta-facebook/meta-wedge/recipes-wedge/wedge-eeprom/files/lib/wedge_eeprom.h
+++ /dev/null
@@ -1,125 +0,0 @@
-/*
- * Copyright 2014-present Facebook. All Rights Reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-#ifndef FBW_EEPROM_H
-#define FBW_EEPROM_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <stdint.h>
-
-#define FBW_EEPROM_F_MAGIC 2
-#define FBW_EEPROM_F_VERSION 1
-#define FBW_EEPROM_F_PRODUCT_NAME 12
-#define FBW_EEPROM_F_PRODUCT_NUMBER 8
-#define FBW_EEPROM_F_ASSEMBLY_NUMBER 12
-#define FBW_EEPROM_F_FACEBOOK_PCBA_NUMBER 12
-#define FBW_EEPROM_F_FACEBOOK_PCB_NUMBER 12
-#define FBW_EEPROM_F_ODM_PCBA_NUMBER 13
-#define FBW_EEPROM_F_ODM_PCBA_SERIAL 12
-#define FBW_EEPROM_F_PRODUCT_STATE 1
-#define FBW_EEPROM_F_PRODUCT_VERSION 1
-#define FBW_EEPROM_F_PRODUCT_SUBVERSION 1
-#define FBW_EEPROM_F_PRODUCT_SERIAL 12
-#define FBW_EEPROM_F_PRODUCT_ASSET 12
-#define FBW_EEPROM_F_SYSTEM_MANUFACTURER 8
-#define FBW_EEPROM_F_SYSTEM_MANU_DATE 4
-#define FBW_EEPROM_F_PCB_MANUFACTURER 8
-#define FBW_EEPROM_F_ASSEMBLED 8
-#define FBW_EEPROM_F_LOCAL_MAC 12
-#define FBW_EEPROM_F_EXT_MAC_BASE 12
-#define FBW_EEPROM_F_EXT_MAC_SIZE 2
-#define FBW_EEPROM_F_LOCATION 8
-#define FBW_EEPROM_F_CRC8 1
-
-struct wedge_eeprom_st {
- /* version number of the eeprom. Must be the first element */
- uint8_t fbw_version;
-
- /* Product Name */
- char fbw_product_name[FBW_EEPROM_F_PRODUCT_NAME + 1];
-
- /* Top Level 20 - Product Part Number: XX-XXXXXX */
- char fbw_product_number[FBW_EEPROM_F_PRODUCT_NUMBER + 2];
-
- /* System Assembly Part Number XXX-XXXXXX-XX */
- char fbw_assembly_number[FBW_EEPROM_F_ASSEMBLY_NUMBER + 3];
-
- /* Facebook PCBA Part Number: XXX-XXXXXXX-XX */
- char fbw_facebook_pcba_number[FBW_EEPROM_F_FACEBOOK_PCBA_NUMBER + 3];
-
- /* Facebook PCB Part Number: XXX-XXXXXXX-XX */
- char fbw_facebook_pcb_number[FBW_EEPROM_F_FACEBOOK_PCB_NUMBER + 3];
-
- /* ODM PCB Part Number: XXXXXXXXXXXX */
- char fbw_odm_pcba_number[FBW_EEPROM_F_ODM_PCBA_NUMBER + 1];
-
- /* ODM PCB Serial Number: XXXXXXXXXXXX */
- char fbw_odm_pcba_serial[FBW_EEPROM_F_ODM_PCBA_SERIAL + 1];
-
- /* Product Production State */
- uint8_t fbw_production_state;
-
- /* Product Version */
- uint8_t fbw_product_version;
-
- /* Product Sub Version */
- uint8_t fbw_product_subversion;
-
- /* Product Serial Number: XXXXXXXX */
- char fbw_product_serial[FBW_EEPROM_F_PRODUCT_SERIAL + 1];
-
- /* Product Asset Tag: XXXXXXXX */
- char fbw_product_asset[FBW_EEPROM_F_PRODUCT_ASSET + 1];
-
- /* System Manufacturer: XXXXXXXX */
- char fbw_system_manufacturer[FBW_EEPROM_F_SYSTEM_MANUFACTURER + 1];
-
- /* System Manufacturing Date: mm-dd-yy */
- uint8_t fbw_system_manufacturing_date[10];
-
- /* PCB Manufacturer: XXXXXXXXX */
- char fbw_pcb_manufacturer[FBW_EEPROM_F_PCB_MANUFACTURER + 1];
-
- /* Assembled At: XXXXXXXX */
- char fbw_assembled[FBW_EEPROM_F_ASSEMBLED + 1];
-
- /* Local MAC Address */
- uint8_t fbw_local_mac[6];
-
- /* Extended MAC Address */
- uint8_t fbw_mac_base[6];
-
- /* Extended MAC Address Size */
- uint16_t fbw_mac_size;
-
- /* Location on Fabric: "LEFT"/"RIGHT", "WEDGE", "LC" */
- char fbw_location[FBW_EEPROM_F_LOCATION + 1];
-
- /* CRC8 */
- uint8_t fbw_crc8;
-};
-
-int wedge_eeprom_parse(const char *fn, struct wedge_eeprom_st *eeprom);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/meta-facebook/meta-wedge/recipes-wedge/wedge-eeprom/files/utils/Makefile b/meta-facebook/meta-wedge/recipes-wedge/wedge-eeprom/files/utils/Makefile
deleted file mode 100644
index f2aeadc..0000000
--- a/meta-facebook/meta-wedge/recipes-wedge/wedge-eeprom/files/utils/Makefile
+++ /dev/null
@@ -1,26 +0,0 @@
-# Copyright 2014-present Facebook. All Rights Reserved.
-#
-# This program file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program in a file named COPYING; if not, write to the
-# Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor,
-# Boston, MA 02110-1301 USA
-
-utils: weutil
-
-weutil: weutil.o
- $(CC) $(LDFLAGS) -o $@ $^ -lwedge_eeprom
-
-.PHONY: clean
-
-clean:
- rm -rf *.o weutil
diff --git a/meta-facebook/meta-wedge/recipes-wedge/wedge-eeprom/files/utils/weutil.c b/meta-facebook/meta-wedge/recipes-wedge/wedge-eeprom/files/utils/weutil.c
deleted file mode 100644
index 49d7174..0000000
--- a/meta-facebook/meta-wedge/recipes-wedge/wedge-eeprom/files/utils/weutil.c
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Copyright 2014-present Facebook. All Rights Reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-
-#include <errno.h>
-#include <stdio.h>
-
-#include <facebook/wedge_eeprom.h>
-#include <openbmc/log.h>
-
-int main(int argc, const char *argv[])
-{
- const char *fn;
- struct wedge_eeprom_st eeprom;
- int rc;
-
- if (argc >= 2) {
- fn = argv[1];
- } else {
- fn = NULL;
- }
-
- rc = wedge_eeprom_parse(fn, &eeprom);
- if (rc) {
- fprintf(stderr, "Failed to parse %s EEPROM\n", fn ? fn : "default");
- return -1;
- }
-
- printf("Wedge EEPROM %s:\n", fn ? fn : "");
- printf("Version: %d\n", eeprom.fbw_version);
- printf("Product Name: %s\n", eeprom.fbw_product_name);
- printf("Product Part Number: %s\n", eeprom.fbw_product_number);
- printf("System Assembly Part Number: %s\n", eeprom.fbw_assembly_number);
- printf("Facebook PCBA Part Number: %s\n", eeprom.fbw_facebook_pcba_number);
- printf("Facebook PCB Part Number: %s\n", eeprom.fbw_facebook_pcb_number);
- printf("ODM PCBA Part Number: %s\n", eeprom.fbw_odm_pcba_number);
- printf("ODM PCBA Serial Number: %s\n", eeprom.fbw_odm_pcba_serial);
- printf("Product Production State: %d\n", eeprom.fbw_production_state);
- printf("Product Version: %d\n", eeprom.fbw_product_version);
- printf("Product Sub-Version: %d\n", eeprom.fbw_product_subversion);
- printf("Product Serial Number: %s\n", eeprom.fbw_product_serial);
- printf("Product Asset Tag: %s\n", eeprom.fbw_product_asset);
- printf("System Manufacturer: %s\n", eeprom.fbw_system_manufacturer);
- printf("System Manufacturing Date: %s\n",
- eeprom.fbw_system_manufacturing_date);
- printf("PCB Manufacturer: %s\n", eeprom.fbw_pcb_manufacturer);
- printf("Assembled At: %s\n", eeprom.fbw_assembled);
- printf("Local MAC: %02X:%02X:%02X:%02X:%02X:%02X\n",
- eeprom.fbw_local_mac[0], eeprom.fbw_local_mac[1],
- eeprom.fbw_local_mac[2], eeprom.fbw_local_mac[3],
- eeprom.fbw_local_mac[4], eeprom.fbw_local_mac[5]);
- printf("Extended MAC Base: %02X:%02X:%02X:%02X:%02X:%02X\n",
- eeprom.fbw_mac_base[0], eeprom.fbw_mac_base[1],
- eeprom.fbw_mac_base[2], eeprom.fbw_mac_base[3],
- eeprom.fbw_mac_base[4], eeprom.fbw_mac_base[5]);
- printf("Extended MAC Address Size: %d\n", eeprom.fbw_mac_size);
- printf("Location on Fabric: %s\n", eeprom.fbw_location);
- printf("CRC8: 0x%x\n", eeprom.fbw_crc8);
-
- return 0;
-}
diff --git a/meta-facebook/meta-wedge/recipes-wedge/wedge-eeprom/libwedge-eeprom_0.1.bb b/meta-facebook/meta-wedge/recipes-wedge/wedge-eeprom/libwedge-eeprom_0.1.bb
deleted file mode 100644
index 6f62557..0000000
--- a/meta-facebook/meta-wedge/recipes-wedge/wedge-eeprom/libwedge-eeprom_0.1.bb
+++ /dev/null
@@ -1,40 +0,0 @@
-# Copyright 2014-present Facebook. All Rights Reserved.
-#
-# This program file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program in a file named COPYING; if not, write to the
-# Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor,
-# Boston, MA 02110-1301 USA
-SUMMARY = "Wedge EEPROM Library"
-DESCRIPTION = "library for wedge eeprom"
-SECTION = "base"
-PR = "r1"
-LICENSE = "GPLv2"
-LIC_FILES_CHKSUM = "file://wedge_eeprom.c;beginline=4;endline=16;md5=da35978751a9d71b73679307c4d296ec"
-
-SRC_URI = "file://lib \
- "
-
-DEPENDS += "liblog"
-
-S = "${WORKDIR}/lib"
-
-do_install() {
- install -d ${D}${libdir}
- install -m 0644 libwedge_eeprom.so ${D}${libdir}/libwedge_eeprom.so
-
- install -d ${D}${includedir}/facebook
- install -m 0644 wedge_eeprom.h ${D}${includedir}/facebook/wedge_eeprom.h
-}
-
-FILES_${PN} = "${libdir}/libwedge_eeprom.so"
-FILES_${PN}-dev = "${includedir}/facebook/wedge_eeprom.h"
diff --git a/meta-facebook/meta-wedge/recipes-wedge/wedge-eeprom/wedge-eeprom_0.1.bb b/meta-facebook/meta-wedge/recipes-wedge/wedge-eeprom/wedge-eeprom_0.1.bb
deleted file mode 100644
index ea41a98..0000000
--- a/meta-facebook/meta-wedge/recipes-wedge/wedge-eeprom/wedge-eeprom_0.1.bb
+++ /dev/null
@@ -1,38 +0,0 @@
-# Copyright 2014-present Facebook. All Rights Reserved.
-#
-# This program file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program in a file named COPYING; if not, write to the
-# Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor,
-# Boston, MA 02110-1301 USA
-SUMMARY = "Wedge EEPROM Utilities"
-DESCRIPTION = "Util for wedge eeprom"
-SECTION = "base"
-PR = "r1"
-LICENSE = "GPLv2"
-LIC_FILES_CHKSUM = "file://weutil.c;beginline=4;endline=16;md5=da35978751a9d71b73679307c4d296ec"
-
-SRC_URI = "file://utils \
- "
-
-S = "${WORKDIR}/utils"
-
-do_install() {
- install -d ${D}${bindir}
- install -m 0755 weutil ${D}${bindir}/weutil
-}
-
-RDEPENDS_${PN} = "libwedge-eeprom"
-
-DEPENDS += "libwedge-eeprom"
-
-FILES_${PN} = "${bindir}"
diff --git a/meta-facebook/meta-wedge100/conf/bblayers.conf.sample b/meta-facebook/meta-wedge100/conf/bblayers.conf.sample
deleted file mode 100644
index 5b69b43..0000000
--- a/meta-facebook/meta-wedge100/conf/bblayers.conf.sample
+++ /dev/null
@@ -1,23 +0,0 @@
-# LAYER_CONF_VERSION is increased each time build/conf/bblayers.conf
-# changes incompatibly
-LCONF_VERSION = "6"
-
-BBPATH = "${TOPDIR}"
-BBFILES ?= ""
-
-BBLAYERS ?= " \
- ##OEROOT##/meta \
- ##OEROOT##/meta-yocto \
- ##OEROOT##/meta-yocto-bsp \
- ##OEROOT##/meta-openembedded/meta-oe \
- ##OEROOT##/meta-openembedded/meta-networking \
- ##OEROOT##/meta-openembedded/meta-python \
- ##OEROOT##/meta-openbmc \
- ##OEROOT##/meta-openbmc/meta-aspeed \
- ##OEROOT##/meta-openbmc/meta-facebook/meta-wedge \
- ##OEROOT##/meta-openbmc/meta-facebook/meta-wedge100 \
- "
-BBLAYERS_NON_REMOVABLE ?= " \
- ##OEROOT##/meta \
- ##OEROOT##/meta-yocto \
- "
diff --git a/meta-facebook/meta-wedge100/conf/conf-notes.txt b/meta-facebook/meta-wedge100/conf/conf-notes.txt
deleted file mode 100644
index becc2df..0000000
--- a/meta-facebook/meta-wedge100/conf/conf-notes.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-Common targets are:
- wedge100-image
diff --git a/meta-facebook/meta-wedge100/conf/layer.conf b/meta-facebook/meta-wedge100/conf/layer.conf
deleted file mode 100644
index 63e14cb..0000000
--- a/meta-facebook/meta-wedge100/conf/layer.conf
+++ /dev/null
@@ -1,10 +0,0 @@
-# We have a conf and classes directory, add to BBPATH
-BBPATH .= ":${LAYERDIR}"
-
-# We have recipes-* directories, add to BBFILES
-BBFILES += "${LAYERDIR}/recipes-*/*/*.bb \
- ${LAYERDIR}/recipes-*/*/*.bbappend"
-
-BBFILE_COLLECTIONS += "wedge100"
-BBFILE_PATTERN_wedge100 = "^${LAYERDIR}/"
-BBFILE_PRIORITY_wedge100 = "10"
diff --git a/meta-facebook/meta-wedge100/conf/local.conf.sample b/meta-facebook/meta-wedge100/conf/local.conf.sample
deleted file mode 100644
index c322b71..0000000
--- a/meta-facebook/meta-wedge100/conf/local.conf.sample
+++ /dev/null
@@ -1,145 +0,0 @@
-#
-# Local configuration file for building the OpenBMC image.
-#
-
-# Always look for packages first in our own local package mirror
-SOURCE_MIRROR_URL ?= "file://${TOPDIR}/../meta-openbmc/source_mirror/"
-INHERIT += "own-mirrors"
-
-# Save local tarballs for all packages we download.
-# This can be used to update our mirror directory above.
-BB_GENERATE_MIRROR_TARBALLS = "1"
-
-# The following setting will prevent bitbake from downloading anything over the
-# network. This can be used to ensure that we get everything from a local
-# file:// mirror.
-#
-# Comment this out if you do need to download new packages from the internet.
-# However, once you have downloaded the package you should check them into our
-# mirror repository so that other developers will always get it from the mirror
-# repo.
-BB_NO_NETWORK = "fb-only"
-
-# Parallelism Options
-#
-# How many tasks bitbake should run in parallel:
-BB_NUMBER_THREADS ?= "${@oe.utils.cpu_count()}"
-# How many processes make should run in parallel:
-PARALLEL_MAKE ?= "-j ${@oe.utils.cpu_count()}"
-
-# Machine Selection
-MACHINE ??= "wedge100"
-
-# Build directory locationds.
-#
-#DL_DIR ?= "${TOPDIR}/downloads"
-#SSTATE_DIR ?= "${TOPDIR}/sstate-cache"
-#TMPDIR = "${TOPDIR}/tmp"
-
-#
-# Default policy config
-# We could eventually create our own distro config if desired,
-# but for now we use the standard poky distro settings.
-#
-DISTRO ?= "poky"
-
-# Use RPM packages
-PACKAGE_CLASSES ?= "package_rpm"
-
-# Extra image features.
-# Currently we do not enable anything extra here.
-#EXTRA_IMAGE_FEATURES = ""
-
-# We build on CentOS 6.3.
-# Don't complain about it, even though it isn't in poky's default
-# list of supported distros.
-SANITY_TESTED_DISTROS_append ?= " CentOS-6.3 \n "
-
-#
-# Additional image features
-#
-# The following is a list of additional classes to use when building images which
-# enable extra features. Some available options which can be included in this variable
-# are:
-# - 'buildstats' collect build statistics
-# - 'image-mklibs' to reduce shared library files size for an image
-# - 'image-prelink' in order to prelink the filesystem image
-# - 'image-swab' to perform host system intrusion detection
-# NOTE: if listing mklibs & prelink both, then make sure mklibs is before prelink
-# NOTE: mklibs also needs to be explicitly enabled for a given image, see local.conf.extended
-USER_CLASSES ?= "buildstats image-mklibs image-prelink"
-
-#
-# Interactive shell configuration
-#
-# Under certain circumstances the system may need input from you and to do this it
-# can launch an interactive shell. It needs to do this since the build is
-# multithreaded and needs to be able to handle the case where more than one parallel
-# process may require the user's attention. The default is iterate over the available
-# terminal types to find one that works.
-#
-# Examples of the occasions this may happen are when resolving patches which cannot
-# be applied, to use the devshell or the kernel menuconfig
-#
-# Supported values are auto, gnome, xfce, rxvt, screen, konsole (KDE 3.x only), none
-# Note: currently, Konsole support only works for KDE 3.x due to the way
-# newer Konsole versions behave
-#OE_TERMINAL = "auto"
-# By default disable interactive patch resolution (tasks will just fail instead):
-PATCHRESOLVE = "noop"
-
-#
-# Disk Space Monitoring during the build
-#
-# Monitor the disk space during the build. If there is less that 1GB of space or less
-# than 100K inodes in any key build location (TMPDIR, DL_DIR, SSTATE_DIR), gracefully
-# shutdown the build. If there is less that 100MB or 1K inodes, perform a hard abort
-# of the build. The reason for this is that running completely out of space can corrupt
-# files and damages the build in ways which may not be easily recoverable.
-BB_DISKMON_DIRS = "\
- STOPTASKS,${TMPDIR},1G,100K \
- STOPTASKS,${DL_DIR},1G,100K \
- STOPTASKS,${SSTATE_DIR},1G,100K \
- ABORT,${TMPDIR},100M,1K \
- ABORT,${DL_DIR},100M,1K \
- ABORT,${SSTATE_DIR},100M,1K"
-
-#
-# Shared-state files from other locations
-#
-# As mentioned above, shared state files are prebuilt cache data objects which can
-# used to accelerate build time. This variable can be used to configure the system
-# to search other mirror locations for these objects before it builds the data itself.
-#
-# This can be a filesystem directory, or a remote url such as http or ftp. These
-# would contain the sstate-cache results from previous builds (possibly from other
-# machines). This variable works like fetcher MIRRORS/PREMIRRORS and points to the
-# cache locations to check for the shared objects.
-# NOTE: if the mirror uses the same structure as SSTATE_DIR, you need to add PATH
-# at the end as shown in the examples below. This will be substituted with the
-# correct path within the directory structure.
-#SSTATE_MIRRORS ?= "\
-#file://.* http://someserver.tld/share/sstate/PATH;downloadfilename=PATH \n \
-#file://.* file:///some/local/dir/sstate/PATH"
-
-
-# CONF_VERSION is increased each time build/conf/ changes incompatibly and is used to
-# track the version of this file when it was generated. This can safely be ignored if
-# this doesn't mean anything to you.
-CONF_VERSION = "1"
-
-
-# Update root password to '0penBmc' and change the root shell back to bash.
-# This default root password is used at the ODM and system integrator. It will be
-# changed during provisioning at the datacenter.
-INHERIT += "extrausers"
-
-EXTRA_USERS_PARAMS = " \
- usermod -s /bin/bash root; \
- usermod -p '\$1\$UGMqyqdG\$FZiylVFmRRfl9Z0Ue8G7e/' root; \
- "
-
-OLDEST_KERNEL = "2.6.28"
-
-INHERIT += "blacklist"
-PNBLACKLIST[glibc] = "glibc 2.21 does not work with our kernel 2.6.28"
diff --git a/meta-facebook/meta-wedge100/conf/machine/wedge100.conf b/meta-facebook/meta-wedge100/conf/machine/wedge100.conf
deleted file mode 100644
index 2416809..0000000
--- a/meta-facebook/meta-wedge100/conf/machine/wedge100.conf
+++ /dev/null
@@ -1,18 +0,0 @@
-#@TYPE: Machine
-#@NAME: Wedge100
-#@DESCRIPTION: Machine configuration for Facebook Wedge100
-
-UBOOT_MACHINE_wedge100 = "wedge100_config"
-
-require conf/machine/include/ast1250.inc
-
-# configuration for preferred version of packages
-PREFERRED_VERSION_libipmi = "0.1"
-PREFERRED_VERSION_ipmid = "0.1"
-PREFERRED_VERSION_rest-api = "0.1"
-
-MACHINE_ESSENTIAL_EXTRA_RDEPENDS += "kernel-module-i2c-dev-sysfs"
-MACHINE_ESSENTIAL_EXTRA_RDEPENDS += "kernel-module-cpld"
-MACHINE_ESSENTIAL_EXTRA_RDEPENDS += "kernel-module-com-e-driver"
-
-TCLIBC = 'eglibc'
diff --git a/meta-facebook/meta-wedge100/recipes-core/fan-ctrl/fan-ctrl/get_fan_speed.sh b/meta-facebook/meta-wedge100/recipes-core/fan-ctrl/fan-ctrl/get_fan_speed.sh
deleted file mode 100755
index 042a72f..0000000
--- a/meta-facebook/meta-wedge100/recipes-core/fan-ctrl/fan-ctrl/get_fan_speed.sh
+++ /dev/null
@@ -1,59 +0,0 @@
-#!/bin/sh
-#
-# Copyright 2015-present Facebook. All Rights Reserved.
-#
-# This program file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program in a file named COPYING; if not, write to the
-# Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor,
-# Boston, MA 02110-1301 USA
-#
-usage() {
- echo "Usage: $0 [Fan Unit (1..5)]" >&2
-}
-
-FAN_DIR=/sys/class/i2c-adapter/i2c-8/8-0033
-
-show_pwm()
-{
- pwm="${FAN_DIR}/fantray${1}_pwm"
- val=$(cat $pwm | head -n 1)
- echo "$((val * 100 / 31))%"
-}
-
-show_rpm()
-{
- front_rpm="${FAN_DIR}/fan$((($1 * 2 - 1)))_input"
- rear_rpm="${FAN_DIR}/fan$((($1 * 2)))_input"
- echo "$(cat $front_rpm), $(cat $rear_rpm)"
-}
-
-set -e
-
-# refer to the comments in init_pwn.sh regarding
-# the fan unit and tacho mapping
-if [ "$#" -eq 0 ]; then
- FANS="1 2 3 4 5"
-elif [ "$#" -eq 1 ]; then
- if [ $1 -gt 5 ]; then
- usage
- exit 1
- fi
- FANS="$1"
-else
- usage
- exit 1
-fi
-
-for fan in $FANS; do
- echo "Fan $fan RPMs: $(show_rpm $fan), ($(show_pwm $fan))"
-done
diff --git a/meta-facebook/meta-wedge100/recipes-core/fan-ctrl/fan-ctrl/set_fan_speed.sh b/meta-facebook/meta-wedge100/recipes-core/fan-ctrl/fan-ctrl/set_fan_speed.sh
deleted file mode 100755
index ff5a584..0000000
--- a/meta-facebook/meta-wedge100/recipes-core/fan-ctrl/fan-ctrl/set_fan_speed.sh
+++ /dev/null
@@ -1,46 +0,0 @@
-#!/bin/sh
-#
-# Copyright 2015-present Facebook. All Rights Reserved.
-#
-# This program file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program in a file named COPYING; if not, write to the
-# Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor,
-# Boston, MA 02110-1301 USA
-#
-usage() {
- echo "Usage: $0 <PERCENT (0..100)> <Fan Unit (1..5)> " >&2
-}
-
-FAN_DIR=/sys/class/i2c-adapter/i2c-8/8-0033
-
-set -e
-
-if [ "$#" -ne 2 ] && [ "$#" -ne 1 ]; then
- usage
- exit 1
-fi
-
-if [ "$#" -eq 1 ]; then
- FANS="1 2 3 4 5"
-else
- FANS="$2"
-fi
-
-# Convert the percentage to our 1/32th unit (0-31).
-unit=$(( ( $1 * 31 ) / 100 ))
-
-for fan in $FANS; do
- pwm="${FAN_DIR}/fantray${fan}_pwm"
- echo "$unit" > $pwm
- echo "Successfully set fan ${fan} speed to $1%"
-done
diff --git a/meta-facebook/meta-wedge100/recipes-core/fan-ctrl/fan-ctrl/setup-fan.sh b/meta-facebook/meta-wedge100/recipes-core/fan-ctrl/fan-ctrl/setup-fan.sh
deleted file mode 100644
index 26691dc..0000000
--- a/meta-facebook/meta-wedge100/recipes-core/fan-ctrl/fan-ctrl/setup-fan.sh
+++ /dev/null
@@ -1,33 +0,0 @@
-#!/bin/sh
-#
-# Copyright 2014-present Facebook. All Rights Reserved.
-#
-# This program file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program in a file named COPYING; if not, write to the
-# Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor,
-# Boston, MA 02110-1301 USA
-#
-
-### BEGIN INIT INFO
-# Provides: setup-fan
-# Required-Start: board-id
-# Required-Stop:
-# Default-Start: S
-# Default-Stop:
-# Short-Description: Set fan speed
-### END INIT INFO
-
-echo -n "Setup fan speed... "
-/usr/local/bin/set_fan_speed.sh 50
-/usr/local/bin/fand
-echo "done."
diff --git a/meta-facebook/meta-wedge100/recipes-core/fan-ctrl/fan-ctrl_0.1.bbappend b/meta-facebook/meta-wedge100/recipes-core/fan-ctrl/fan-ctrl_0.1.bbappend
deleted file mode 100644
index ff5f2d5..0000000
--- a/meta-facebook/meta-wedge100/recipes-core/fan-ctrl/fan-ctrl_0.1.bbappend
+++ /dev/null
@@ -1,46 +0,0 @@
-# Copyright 2015-present Facebook. All Rights Reserved.
-#
-# This program file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program in a file named COPYING; if not, write to the
-# Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor,
-# Boston, MA 02110-1301 USA
-
-DEPENDS_append = " update-rc.d-native"
-
-FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
-SRC_URI += "file://get_fan_speed.sh \
- file://set_fan_speed.sh \
- file://setup-fan.sh \
- "
-
-S = "${WORKDIR}"
-
-binfiles = " \
- get_fan_speed.sh \
- set_fan_speed.sh \
- fand \
- "
-
-CXXFLAGS_prepend = "-DCONFIG_WEDGE100 "
-
-do_install() {
- bin="${D}/usr/local/bin"
- install -d $bin
- for f in ${binfiles}; do
- install -m 755 $f ${bin}/$f
- done
- install -d ${D}${sysconfdir}/init.d
- install -d ${D}${sysconfdir}/rcS.d
- install -m 755 setup-fan.sh ${D}${sysconfdir}/init.d/setup-fan.sh
- update-rc.d -r ${D} setup-fan.sh start 91 S .
-}
diff --git a/meta-facebook/meta-wedge100/recipes-core/images/wedge100-image.bb b/meta-facebook/meta-wedge100/recipes-core/images/wedge100-image.bb
deleted file mode 100644
index 291ebf0..0000000
--- a/meta-facebook/meta-wedge100/recipes-core/images/wedge100-image.bb
+++ /dev/null
@@ -1,82 +0,0 @@
-inherit aspeed_uboot_image
-
-# /dev
-require recipes-core/images/aspeed-dev.inc
-
-# Base this image on core-image-minimal
-include recipes-core/images/core-image-minimal.bb
-
-# Changing the image compression from gz to lzma achieves 30% saving (~3M).
-# However, the current u-boot does not have lzma enabled. Stick to gz
-# until we generate a new u-boot image.
-IMAGE_FSTYPES += "cpio.lzma.u-boot"
-UBOOT_IMAGE_ENTRYPOINT = "0x40800000"
-
-PYTHON_PKGS = " \
- python-core \
- python-io \
- python-json \
- python-shell \
- python-subprocess \
- python-argparse \
- python-ctypes \
- python-datetime \
- python-email \
- python-threading \
- python-mime \
- python-pickle \
- python-misc \
- python-netserver \
- "
-
-NTP_PKGS = " \
- ntp \
- ntp-utils \
- sntp \
- ntpdate \
- "
-
-# Include modules in rootfs
-IMAGE_INSTALL += " \
- kernel-modules \
- u-boot \
- u-boot-fw-utils \
- openbmc-utils \
- openbmc-gpio \
- fan-ctrl \
- rackmon \
- watchdog-ctrl \
- i2c-tools \
- sensor-setup \
- usb-console \
- oob-nic \
- lldp-util \
- lmsensors-sensors \
- wedge-eeprom \
- sms-kcsd \
- rest-api \
- bottle \
- ipmid \
- po-eeprom \
- bitbang \
- ${PYTHON_PKGS} \
- ${NTP_PKGS} \
- iproute2 \
- dhcp-client \
- jbi \
- flashrom \
- cherryPy \
- "
-
-IMAGE_FEATURES += " \
- ssh-server-openssh \
- tools-debug \
- "
-
-DISTRO_FEATURES += " \
- ext2 \
- ipv6 \
- nfs \
- usbgadget \
- usbhost \
- "
diff --git a/meta-facebook/meta-wedge100/recipes-core/sysvinit/sysvinit-inittab_%.bbappend b/meta-facebook/meta-wedge100/recipes-core/sysvinit/sysvinit-inittab_%.bbappend
deleted file mode 100644
index 6d4deb3..0000000
--- a/meta-facebook/meta-wedge100/recipes-core/sysvinit/sysvinit-inittab_%.bbappend
+++ /dev/null
@@ -1,5 +0,0 @@
-# ttyS0 is UART5, connected through SYSCPLD, to debug board, if GPIOE0 is 1
-# ttyS1 is UART1, connected through SYSCPLD, to micro-server console, if GPIOE0 is 1
-# ttyS2 is UART3, connected to the front panel Console port
-# ttyS3 is UART4, connected through SYSCPLD, to rackmon RS485
-SERIAL_CONSOLES = "57600;ttyS0 9600;ttyS2"
diff --git a/meta-facebook/meta-wedge100/recipes-kernel/com-e-mod/files/COPYING b/meta-facebook/meta-wedge100/recipes-kernel/com-e-mod/files/COPYING
deleted file mode 100644
index 6d45519..0000000
--- a/meta-facebook/meta-wedge100/recipes-kernel/com-e-mod/files/COPYING
+++ /dev/null
@@ -1,340 +0,0 @@
- GNU GENERAL PUBLIC LICENSE
- Version 2, June 1991
-
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.
- 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
- Preamble
-
- The licenses for most software are designed to take away your
-freedom to share and change it. By contrast, the GNU General Public
-License is intended to guarantee your freedom to share and change free
-software--to make sure the software is free for all its users. This
-General Public License applies to most of the Free Software
-Foundation's software and to any other program whose authors commit to
-using it. (Some other Free Software Foundation software is covered by
-the GNU Library General Public License instead.) You can apply it to
-your programs, too.
-
- When we speak of free software, we are referring to freedom, not
-price. Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-this service if you wish), that you receive source code or can get it
-if you want it, that you can change the software or use pieces of it
-in new free programs; and that you know you can do these things.
-
- To protect your rights, we need to make restrictions that forbid
-anyone to deny you these rights or to ask you to surrender the rights.
-These restrictions translate to certain responsibilities for you if you
-distribute copies of the software, or if you modify it.
-
- For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must give the recipients all the rights that
-you have. You must make sure that they, too, receive or can get the
-source code. And you must show them these terms so they know their
-rights.
-
- We protect your rights with two steps: (1) copyright the software, and
-(2) offer you this license which gives you legal permission to copy,
-distribute and/or modify the software.
-
- Also, for each author's protection and ours, we want to make certain
-that everyone understands that there is no warranty for this free
-software. If the software is modified by someone else and passed on, we
-want its recipients to know that what they have is not the original, so
-that any problems introduced by others will not reflect on the original
-authors' reputations.
-
- Finally, any free program is threatened constantly by software
-patents. We wish to avoid the danger that redistributors of a free
-program will individually obtain patent licenses, in effect making the
-program proprietary. To prevent this, we have made it clear that any
-patent must be licensed for everyone's free use or not licensed at all.
-
- The precise terms and conditions for copying, distribution and
-modification follow.
-
- GNU GENERAL PUBLIC LICENSE
- TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
- 0. This License applies to any program or other work which contains
-a notice placed by the copyright holder saying it may be distributed
-under the terms of this General Public License. The "Program", below,
-refers to any such program or work, and a "work based on the Program"
-means either the Program or any derivative work under copyright law:
-that is to say, a work containing the Program or a portion of it,
-either verbatim or with modifications and/or translated into another
-language. (Hereinafter, translation is included without limitation in
-the term "modification".) Each licensee is addressed as "you".
-
-Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope. The act of
-running the Program is not restricted, and the output from the Program
-is covered only if its contents constitute a work based on the
-Program (independent of having been made by running the Program).
-Whether that is true depends on what the Program does.
-
- 1. You may copy and distribute verbatim copies of the Program's
-source code as you receive it, in any medium, provided that you
-conspicuously and appropriately publish on each copy an appropriate
-copyright notice and disclaimer of warranty; keep intact all the
-notices that refer to this License and to the absence of any warranty;
-and give any other recipients of the Program a copy of this License
-along with the Program.
-
-You may charge a fee for the physical act of transferring a copy, and
-you may at your option offer warranty protection in exchange for a fee.
-
- 2. You may modify your copy or copies of the Program or any portion
-of it, thus forming a work based on the Program, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
- a) You must cause the modified files to carry prominent notices
- stating that you changed the files and the date of any change.
-
- b) You must cause any work that you distribute or publish, that in
- whole or in part contains or is derived from the Program or any
- part thereof, to be licensed as a whole at no charge to all third
- parties under the terms of this License.
-
- c) If the modified program normally reads commands interactively
- when run, you must cause it, when started running for such
- interactive use in the most ordinary way, to print or display an
- announcement including an appropriate copyright notice and a
- notice that there is no warranty (or else, saying that you provide
- a warranty) and that users may redistribute the program under
- these conditions, and telling the user how to view a copy of this
- License. (Exception: if the Program itself is interactive but
- does not normally print such an announcement, your work based on
- the Program is not required to print an announcement.)
-
-These requirements apply to the modified work as a whole. If
-identifiable sections of that work are not derived from the Program,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works. But when you
-distribute the same sections as part of a whole which is a work based
-on the Program, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Program.
-
-In addition, mere aggregation of another work not based on the Program
-with the Program (or with a work based on the Program) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
- 3. You may copy and distribute the Program (or a work based on it,
-under Section 2) in object code or executable form under the terms of
-Sections 1 and 2 above provided that you also do one of the following:
-
- a) Accompany it with the complete corresponding machine-readable
- source code, which must be distributed under the terms of Sections
- 1 and 2 above on a medium customarily used for software interchange; or,
-
- b) Accompany it with a written offer, valid for at least three
- years, to give any third party, for a charge no more than your
- cost of physically performing source distribution, a complete
- machine-readable copy of the corresponding source code, to be
- distributed under the terms of Sections 1 and 2 above on a medium
- customarily used for software interchange; or,
-
- c) Accompany it with the information you received as to the offer
- to distribute corresponding source code. (This alternative is
- allowed only for noncommercial distribution and only if you
- received the program in object code or executable form with such
- an offer, in accord with Subsection b above.)
-
-The source code for a work means the preferred form of the work for
-making modifications to it. For an executable work, complete source
-code means all the source code for all modules it contains, plus any
-associated interface definition files, plus the scripts used to
-control compilation and installation of the executable. However, as a
-special exception, the source code distributed need not include
-anything that is normally distributed (in either source or binary
-form) with the major components (compiler, kernel, and so on) of the
-operating system on which the executable runs, unless that component
-itself accompanies the executable.
-
-If distribution of executable or object code is made by offering
-access to copy from a designated place, then offering equivalent
-access to copy the source code from the same place counts as
-distribution of the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
- 4. You may not copy, modify, sublicense, or distribute the Program
-except as expressly provided under this License. Any attempt
-otherwise to copy, modify, sublicense or distribute the Program is
-void, and will automatically terminate your rights under this License.
-However, parties who have received copies, or rights, from you under
-this License will not have their licenses terminated so long as such
-parties remain in full compliance.
-
- 5. You are not required to accept this License, since you have not
-signed it. However, nothing else grants you permission to modify or
-distribute the Program or its derivative works. These actions are
-prohibited by law if you do not accept this License. Therefore, by
-modifying or distributing the Program (or any work based on the
-Program), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Program or works based on it.
-
- 6. Each time you redistribute the Program (or any work based on the
-Program), the recipient automatically receives a license from the
-original licensor to copy, distribute or modify the Program subject to
-these terms and conditions. You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties to
-this License.
-
- 7. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License. If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Program at all. For example, if a patent
-license would not permit royalty-free redistribution of the Program by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Program.
-
-If any portion of this section is held invalid or unenforceable under
-any particular circumstance, the balance of the section is intended to
-apply and the section as a whole is intended to apply in other
-circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system, which is
-implemented by public license practices. Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
- 8. If the distribution and/or use of the Program is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Program under this License
-may add an explicit geographical distribution limitation excluding
-those countries, so that distribution is permitted only in or among
-countries not thus excluded. In such case, this License incorporates
-the limitation as if written in the body of this License.
-
- 9. The Free Software Foundation may publish revised and/or new versions
-of the General Public License from time to time. Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
-Each version is given a distinguishing version number. If the Program
-specifies a version number of this License which applies to it and "any
-later version", you have the option of following the terms and conditions
-either of that version or of any later version published by the Free
-Software Foundation. If the Program does not specify a version number of
-this License, you may choose any version ever published by the Free Software
-Foundation.
-
- 10. If you wish to incorporate parts of the Program into other free
-programs whose distribution conditions are different, write to the author
-to ask for permission. For software which is copyrighted by the Free
-Software Foundation, write to the Free Software Foundation; we sometimes
-make exceptions for this. Our decision will be guided by the two goals
-of preserving the free status of all derivatives of our free software and
-of promoting the sharing and reuse of software generally.
-
- NO WARRANTY
-
- 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
-FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
-OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
-PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
-OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
-TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
-PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
-REPAIR OR CORRECTION.
-
- 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
-REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
-INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
-OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
-TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
-YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
-PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGES.
-
- END OF TERMS AND CONDITIONS
-
- How to Apply These Terms to Your New Programs
-
- If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
- To do so, attach the following notices to the program. It is safest
-to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least
-the "copyright" line and a pointer to where the full notice is found.
-
- <one line to give the program's name and a brief idea of what it does.>
- Copyright (C) <year> <name of author>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
-
-Also add information on how to contact you by electronic and paper mail.
-
-If the program is interactive, make it output a short notice like this
-when it starts in an interactive mode:
-
- Gnomovision version 69, Copyright (C) year name of author
- Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
- This is free software, and you are welcome to redistribute it
- under certain conditions; type `show c' for details.
-
-The hypothetical commands `show w' and `show c' should show the appropriate
-parts of the General Public License. Of course, the commands you use may
-be called something other than `show w' and `show c'; they could even be
-mouse-clicks or menu items--whatever suits your program.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the program, if
-necessary. Here is a sample; alter the names:
-
- Yoyodyne, Inc., hereby disclaims all copyright interest in the program
- `Gnomovision' (which makes passes at compilers) written by James Hacker.
-
- <signature of Ty Coon>, 1 April 1989
- Ty Coon, President of Vice
-
-This General Public License does not permit incorporating your program into
-proprietary programs. If your program is a subroutine library, you may
-consider it more useful to permit linking proprietary applications with the
-library. If this is what you want to do, use the GNU Library General
-Public License instead of this License.
diff --git a/meta-facebook/meta-wedge100/recipes-kernel/com-e-mod/files/Makefile b/meta-facebook/meta-wedge100/recipes-kernel/com-e-mod/files/Makefile
deleted file mode 100644
index d3b524e..0000000
--- a/meta-facebook/meta-wedge100/recipes-kernel/com-e-mod/files/Makefile
+++ /dev/null
@@ -1,31 +0,0 @@
-# Copyright 2015-present Facebook. All Rights Reserved.
-#
-# This program file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program in a file named COPYING; if not, write to the
-# Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor,
-# Boston, MA 02110-1301 USA
-
-obj-m := com_e_driver.o
-
-SRC := $(shell pwd)
-
-all:
- $(MAKE) -C $(KERNEL_SRC) M=$(SRC)
-
-modules_install:
- $(MAKE) -C $(KERNEL_SRC) M=$(SRC) modules_install
-
-clean:
- rm -f *.o *~ core .depend .*.cmd *.ko *.mod.c
- rm -f Module.markers Module.symvers modules.order
- rm -rf .tmp_versions Modules.symvers
diff --git a/meta-facebook/meta-wedge100/recipes-kernel/com-e-mod/files/com_e_driver.c b/meta-facebook/meta-wedge100/recipes-kernel/com-e-mod/files/com_e_driver.c
deleted file mode 100644
index 0a3df37..0000000
--- a/meta-facebook/meta-wedge100/recipes-kernel/com-e-mod/files/com_e_driver.c
+++ /dev/null
@@ -1,365 +0,0 @@
-/*
- * com_e_driver.c - The i2c driver for COMe
- *
- * Copyright 2015-present Facebook. All Rights Reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-
-#include <linux/errno.h>
-#include <linux/module.h>
-#include <linux/i2c.h>
-#include <linux/i2c_dev_sysfs.h>
-
-#ifdef DEBUG
-
-#define PP_DEBUG(fmt, ...) do { \
- printk(KERN_DEBUG "%s:%d " fmt "\n", \
- __FUNCTION__, __LINE__, ##__VA_ARGS__); \
-} while (0)
-
-#else /* !DEBUG */
-
-#define PP_DEBUG(fmt, ...)
-
-#endif
-
-static ssize_t i2c_dev_show_mac(struct device *dev,
- struct device_attribute *attr,
- char *buf)
-{
- uint8_t values[6];
- int ret_val;
-
- ret_val = i2c_dev_read_nbytes(dev, attr, values, 6);
- if (ret_val < 0) {
- return ret_val;
- }
- //values[] : mac address
- return scnprintf(buf, PAGE_SIZE, "%02x:%02x:%02x:%02x:%02x:%02x\n", values[0],
- values[1], values[2], values[3], values[4], values[5]);
-}
-
-static ssize_t i2c_dev_show_date(struct device *dev,
- struct device_attribute *attr,
- char *buf)
-{
- uint8_t values[3];
- int ret_val;
-
- ret_val = i2c_dev_read_nbytes(dev, attr, values, 3);
- if (ret_val < 0) {
- return ret_val;
- }
- //values[0] : year
- //values[1] : month
- //values[2] : day
- return scnprintf(buf, PAGE_SIZE, "%x/%x/%x\n", values[1],
- values[2], values[0]);
-}
-
-static ssize_t i2c_dev_show_version(struct device *dev,
- struct device_attribute *attr,
- char *buf)
-{
- uint8_t values[3];
- int ret_val;
-
- ret_val = i2c_dev_read_nbytes(dev, attr, values, 3);
- if (ret_val < 0) {
- return ret_val;
- }
- //values[0] : Version_R
- //values[1] : Version_E
- //values[2] : Version_T
- return scnprintf(buf, PAGE_SIZE, "EC Version R=0x%02x E=0x%02x T=0x%2x\n",
- values[0], values[1], values[2]);
-
-}
-
-static ssize_t i2c_dev_show_cpu_temp(struct device *dev,
- struct device_attribute *attr,
- char *buf)
-{
- int ret_val;
-
- ret_val = i2c_dev_read_byte(dev, attr);
- if (ret_val < 0) {
- return ret_val;
- }
- return scnprintf(buf, PAGE_SIZE, "%u\n", ret_val);
-}
-
-static ssize_t i2c_dev_show_voltage0(struct device *dev,
- struct device_attribute *attr,
- char *buf)
-{
- int result;
-
- result = i2c_dev_read_word_littleendian(dev, attr);
- if (result < 0) {
- return result;
- }
- result = (result * 1000) / 341;
- return scnprintf(buf, PAGE_SIZE, "%u\n", result);
-}
-
-static ssize_t i2c_dev_show_voltage1(struct device *dev,
- struct device_attribute *attr,
- char *buf)
-{
- int result;
-
- result = i2c_dev_read_word_littleendian(dev, attr);
- if (result < 0) {
- return result;
- }
- result = (result * 2000) / 341;
- return scnprintf(buf, PAGE_SIZE, "%u\n", result);
-}
-
-static ssize_t i2c_dev_show_voltage2(struct device *dev,
- struct device_attribute *attr,
- char *buf)
-{
- int result;
-
- result = i2c_dev_read_word_littleendian(dev, attr);
- if (result < 0) {
- return result;
- }
- result = (result * 3200) / 341;
- return scnprintf(buf, PAGE_SIZE, "%u\n", result);
-}
-
-static ssize_t i2c_dev_show_voltage3(struct device *dev,
- struct device_attribute *attr,
- char *buf)
-{
- int result;
-
- result = i2c_dev_read_word_littleendian(dev, attr);
- if (result < 0) {
- return result;
- }
- result = (result * 6600) / 341;
- return scnprintf(buf, PAGE_SIZE, "%u\n", result);
-}
-
-static const i2c_dev_attr_st com_e_attr_table[] = {
- {
- "temp1_input", // cpu_temp
- NULL,
- i2c_dev_show_cpu_temp,
- NULL,
- 0x0, 0, 8,
- },
- {
- "version", // version_r,_e,_t
- NULL,
- i2c_dev_show_version,
- NULL,
- 0x1D, 0, 24,
- },
- {
- "in0_input", // CPU_vcore
- NULL,
- i2c_dev_show_voltage0,
- NULL,
- 0x20, 0, 16,
- },
- {
- "in1_input",// 3V
- NULL,
- i2c_dev_show_voltage1,
- NULL,
- 0x22, 0, 16,
- },
- {
- "in2_input",// 5V
- NULL,
- i2c_dev_show_voltage2,
- NULL,
- 0x24, 0, 16,
- },
- {
- "date",
- NULL,
- i2c_dev_show_date,
- NULL,
- 0x2D, 0, 24,
- },
- {
- "in3_input",// 12V
- NULL,
- i2c_dev_show_voltage3,
- NULL,
- 0x30, 0, 16,
- },
- {
- "in4_input",// VDIMM
- NULL,
- i2c_dev_show_voltage0,
- NULL,
- 0x32, 0, 16,
- },
- {
- "product_name",
- NULL,
- i2c_dev_show_ascii,
- NULL,
- 0x3C, 0, 32,
- },
- {
- "customize_name",
- NULL,
- i2c_dev_show_ascii,
- NULL,
- 0x4D, 0, 24,
- },
- {
- "mac",
- NULL,
- i2c_dev_show_mac,
- NULL,
- 0x50, 0, 48,
- },
- {
- "serial_number",
- NULL,
- i2c_dev_show_ascii,
- NULL,
- 0x60, 0, 256,
- },
- {
- "in0_label",
- "CPU Vcore",
- i2c_dev_show_label,
- NULL,
- 0x0, 0, 0,
- },
- {
- "in1_label",
- "+3V Voltage",
- i2c_dev_show_label,
- NULL,
- 0x0, 0, 0,
- },
- {
- "in2_label",
- "+5V Voltage",
- i2c_dev_show_label,
- NULL,
- 0x0, 0, 0,
- },
- {
- "in3_label",
- "+12V Voltage",
- i2c_dev_show_label,
- NULL,
- 0x0, 0, 0,
- },
- {
- "in4_label",
- "VDIMM Voltage",
- i2c_dev_show_label,
- NULL,
- 0x0, 0, 0,
- },
- {
- "temp1_label",
- "CPU Temp",
- i2c_dev_show_label,
- NULL,
- 0x0, 0, 0,
- },
-};
-
-static i2c_dev_data_st com_e_data;
-
-/*
- * COMe i2c addresses.
- * normal_i2c is used in I2C_CLIENT_INSMOD_1()
- */
-static const unsigned short normal_i2c[] = {
- 0x33, I2C_CLIENT_END
-};
-
-/*
- * Insmod parameters
- */
-I2C_CLIENT_INSMOD_1(com_e);
-
-/* COMe id */
-static const struct i2c_device_id com_e_id[] = {
- { "com_e_driver", com_e_id },
- { },
-};
-MODULE_DEVICE_TABLE(i2c, com_e_id);
-
-/* Return 0 if detection is successful, -ENODEV otherwise */
-static int com_e_detect(struct i2c_client *client, int kind,
- struct i2c_board_info *info)
-{
- /*
- * We don't currently do any detection of the COMe
- */
- strlcpy(info->type, "com_e_driver", I2C_NAME_SIZE);
- return 0;
-}
-
-static int com_e_probe(struct i2c_client *client,
- const struct i2c_device_id *id)
-{
- int n_attrs = sizeof(com_e_attr_table) / sizeof(com_e_attr_table[0]);
- return i2c_dev_sysfs_data_init(client, &com_e_data,
- com_e_attr_table, n_attrs);
-}
-
-static int com_e_remove(struct i2c_client *client)
-{
- i2c_dev_sysfs_data_clean(client, &com_e_data);
- return 0;
-}
-
-static struct i2c_driver com_e_driver = {
- .class = I2C_CLASS_HWMON,
- .driver = {
- .name = "com_e_driver",
- },
- .probe = com_e_probe,
- .remove = com_e_remove,
- .id_table = com_e_id,
- .detect = com_e_detect,
- /* addr_data is defined through I2C_CLIENT_INSMOD_1() */
- .address_data = &addr_data,
-};
-
-static int __init com_e_mod_init(void)
-{
- return i2c_add_driver(&com_e_driver);
-}
-
-static void __exit com_e_mod_exit(void)
-{
- i2c_del_driver(&com_e_driver);
-}
-
-MODULE_AUTHOR("Vineela Kukkadapu <vineelak@fb.com>");
-MODULE_DESCRIPTION("COM_E Driver");
-MODULE_LICENSE("GPL");
-
-module_init(com_e_mod_init);
-module_exit(com_e_mod_exit);
diff --git a/meta-facebook/meta-wedge100/recipes-kernel/com-e-mod/kernel-module-com-e-driver_0.1.bb b/meta-facebook/meta-wedge100/recipes-kernel/com-e-mod/kernel-module-com-e-driver_0.1.bb
deleted file mode 100644
index 53f679e..0000000
--- a/meta-facebook/meta-wedge100/recipes-kernel/com-e-mod/kernel-module-com-e-driver_0.1.bb
+++ /dev/null
@@ -1,40 +0,0 @@
-# Copyright 2015-present Facebook. All Rights Reserved.
-#
-# This program file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program in a file named COPYING; if not, write to the
-# Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor,
-# Boston, MA 02110-1301 USA
-
-SUMMARY = "Wedge100 COMe driver"
-LICENSE = "GPLv2"
-LIC_FILES_CHKSUM = "file://COPYING;md5=12f884d2ae1ff87c09e5b7ccc2c4ca7e"
-
-inherit module
-
-PR = "r0"
-PV = "0.1"
-
-SRC_URI = "file://Makefile \
- file://com_e_driver.c \
- file://COPYING \
- "
-
-S = "${WORKDIR}"
-
-DEPENDS += "kernel-module-i2c-dev-sysfs"
-
-RDEPENDS_${PN} += "kernel-module-i2c-dev-sysfs"
-
-KERNEL_MODULE_AUTOLOAD += " \
- com_e_driver \
-"
diff --git a/meta-facebook/meta-wedge100/recipes-kernel/cpld-mod/files/COPYING b/meta-facebook/meta-wedge100/recipes-kernel/cpld-mod/files/COPYING
deleted file mode 100644
index 6d45519..0000000
--- a/meta-facebook/meta-wedge100/recipes-kernel/cpld-mod/files/COPYING
+++ /dev/null
@@ -1,340 +0,0 @@
- GNU GENERAL PUBLIC LICENSE
- Version 2, June 1991
-
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.
- 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
- Preamble
-
- The licenses for most software are designed to take away your
-freedom to share and change it. By contrast, the GNU General Public
-License is intended to guarantee your freedom to share and change free
-software--to make sure the software is free for all its users. This
-General Public License applies to most of the Free Software
-Foundation's software and to any other program whose authors commit to
-using it. (Some other Free Software Foundation software is covered by
-the GNU Library General Public License instead.) You can apply it to
-your programs, too.
-
- When we speak of free software, we are referring to freedom, not
-price. Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-this service if you wish), that you receive source code or can get it
-if you want it, that you can change the software or use pieces of it
-in new free programs; and that you know you can do these things.
-
- To protect your rights, we need to make restrictions that forbid
-anyone to deny you these rights or to ask you to surrender the rights.
-These restrictions translate to certain responsibilities for you if you
-distribute copies of the software, or if you modify it.
-
- For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must give the recipients all the rights that
-you have. You must make sure that they, too, receive or can get the
-source code. And you must show them these terms so they know their
-rights.
-
- We protect your rights with two steps: (1) copyright the software, and
-(2) offer you this license which gives you legal permission to copy,
-distribute and/or modify the software.
-
- Also, for each author's protection and ours, we want to make certain
-that everyone understands that there is no warranty for this free
-software. If the software is modified by someone else and passed on, we
-want its recipients to know that what they have is not the original, so
-that any problems introduced by others will not reflect on the original
-authors' reputations.
-
- Finally, any free program is threatened constantly by software
-patents. We wish to avoid the danger that redistributors of a free
-program will individually obtain patent licenses, in effect making the
-program proprietary. To prevent this, we have made it clear that any
-patent must be licensed for everyone's free use or not licensed at all.
-
- The precise terms and conditions for copying, distribution and
-modification follow.
-
- GNU GENERAL PUBLIC LICENSE
- TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
- 0. This License applies to any program or other work which contains
-a notice placed by the copyright holder saying it may be distributed
-under the terms of this General Public License. The "Program", below,
-refers to any such program or work, and a "work based on the Program"
-means either the Program or any derivative work under copyright law:
-that is to say, a work containing the Program or a portion of it,
-either verbatim or with modifications and/or translated into another
-language. (Hereinafter, translation is included without limitation in
-the term "modification".) Each licensee is addressed as "you".
-
-Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope. The act of
-running the Program is not restricted, and the output from the Program
-is covered only if its contents constitute a work based on the
-Program (independent of having been made by running the Program).
-Whether that is true depends on what the Program does.
-
- 1. You may copy and distribute verbatim copies of the Program's
-source code as you receive it, in any medium, provided that you
-conspicuously and appropriately publish on each copy an appropriate
-copyright notice and disclaimer of warranty; keep intact all the
-notices that refer to this License and to the absence of any warranty;
-and give any other recipients of the Program a copy of this License
-along with the Program.
-
-You may charge a fee for the physical act of transferring a copy, and
-you may at your option offer warranty protection in exchange for a fee.
-
- 2. You may modify your copy or copies of the Program or any portion
-of it, thus forming a work based on the Program, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
- a) You must cause the modified files to carry prominent notices
- stating that you changed the files and the date of any change.
-
- b) You must cause any work that you distribute or publish, that in
- whole or in part contains or is derived from the Program or any
- part thereof, to be licensed as a whole at no charge to all third
- parties under the terms of this License.
-
- c) If the modified program normally reads commands interactively
- when run, you must cause it, when started running for such
- interactive use in the most ordinary way, to print or display an
- announcement including an appropriate copyright notice and a
- notice that there is no warranty (or else, saying that you provide
- a warranty) and that users may redistribute the program under
- these conditions, and telling the user how to view a copy of this
- License. (Exception: if the Program itself is interactive but
- does not normally print such an announcement, your work based on
- the Program is not required to print an announcement.)
-
-These requirements apply to the modified work as a whole. If
-identifiable sections of that work are not derived from the Program,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works. But when you
-distribute the same sections as part of a whole which is a work based
-on the Program, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Program.
-
-In addition, mere aggregation of another work not based on the Program
-with the Program (or with a work based on the Program) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
- 3. You may copy and distribute the Program (or a work based on it,
-under Section 2) in object code or executable form under the terms of
-Sections 1 and 2 above provided that you also do one of the following:
-
- a) Accompany it with the complete corresponding machine-readable
- source code, which must be distributed under the terms of Sections
- 1 and 2 above on a medium customarily used for software interchange; or,
-
- b) Accompany it with a written offer, valid for at least three
- years, to give any third party, for a charge no more than your
- cost of physically performing source distribution, a complete
- machine-readable copy of the corresponding source code, to be
- distributed under the terms of Sections 1 and 2 above on a medium
- customarily used for software interchange; or,
-
- c) Accompany it with the information you received as to the offer
- to distribute corresponding source code. (This alternative is
- allowed only for noncommercial distribution and only if you
- received the program in object code or executable form with such
- an offer, in accord with Subsection b above.)
-
-The source code for a work means the preferred form of the work for
-making modifications to it. For an executable work, complete source
-code means all the source code for all modules it contains, plus any
-associated interface definition files, plus the scripts used to
-control compilation and installation of the executable. However, as a
-special exception, the source code distributed need not include
-anything that is normally distributed (in either source or binary
-form) with the major components (compiler, kernel, and so on) of the
-operating system on which the executable runs, unless that component
-itself accompanies the executable.
-
-If distribution of executable or object code is made by offering
-access to copy from a designated place, then offering equivalent
-access to copy the source code from the same place counts as
-distribution of the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
- 4. You may not copy, modify, sublicense, or distribute the Program
-except as expressly provided under this License. Any attempt
-otherwise to copy, modify, sublicense or distribute the Program is
-void, and will automatically terminate your rights under this License.
-However, parties who have received copies, or rights, from you under
-this License will not have their licenses terminated so long as such
-parties remain in full compliance.
-
- 5. You are not required to accept this License, since you have not
-signed it. However, nothing else grants you permission to modify or
-distribute the Program or its derivative works. These actions are
-prohibited by law if you do not accept this License. Therefore, by
-modifying or distributing the Program (or any work based on the
-Program), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Program or works based on it.
-
- 6. Each time you redistribute the Program (or any work based on the
-Program), the recipient automatically receives a license from the
-original licensor to copy, distribute or modify the Program subject to
-these terms and conditions. You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties to
-this License.
-
- 7. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License. If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Program at all. For example, if a patent
-license would not permit royalty-free redistribution of the Program by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Program.
-
-If any portion of this section is held invalid or unenforceable under
-any particular circumstance, the balance of the section is intended to
-apply and the section as a whole is intended to apply in other
-circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system, which is
-implemented by public license practices. Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
- 8. If the distribution and/or use of the Program is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Program under this License
-may add an explicit geographical distribution limitation excluding
-those countries, so that distribution is permitted only in or among
-countries not thus excluded. In such case, this License incorporates
-the limitation as if written in the body of this License.
-
- 9. The Free Software Foundation may publish revised and/or new versions
-of the General Public License from time to time. Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
-Each version is given a distinguishing version number. If the Program
-specifies a version number of this License which applies to it and "any
-later version", you have the option of following the terms and conditions
-either of that version or of any later version published by the Free
-Software Foundation. If the Program does not specify a version number of
-this License, you may choose any version ever published by the Free Software
-Foundation.
-
- 10. If you wish to incorporate parts of the Program into other free
-programs whose distribution conditions are different, write to the author
-to ask for permission. For software which is copyrighted by the Free
-Software Foundation, write to the Free Software Foundation; we sometimes
-make exceptions for this. Our decision will be guided by the two goals
-of preserving the free status of all derivatives of our free software and
-of promoting the sharing and reuse of software generally.
-
- NO WARRANTY
-
- 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
-FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
-OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
-PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
-OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
-TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
-PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
-REPAIR OR CORRECTION.
-
- 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
-REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
-INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
-OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
-TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
-YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
-PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGES.
-
- END OF TERMS AND CONDITIONS
-
- How to Apply These Terms to Your New Programs
-
- If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
- To do so, attach the following notices to the program. It is safest
-to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least
-the "copyright" line and a pointer to where the full notice is found.
-
- <one line to give the program's name and a brief idea of what it does.>
- Copyright (C) <year> <name of author>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
-
-Also add information on how to contact you by electronic and paper mail.
-
-If the program is interactive, make it output a short notice like this
-when it starts in an interactive mode:
-
- Gnomovision version 69, Copyright (C) year name of author
- Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
- This is free software, and you are welcome to redistribute it
- under certain conditions; type `show c' for details.
-
-The hypothetical commands `show w' and `show c' should show the appropriate
-parts of the General Public License. Of course, the commands you use may
-be called something other than `show w' and `show c'; they could even be
-mouse-clicks or menu items--whatever suits your program.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the program, if
-necessary. Here is a sample; alter the names:
-
- Yoyodyne, Inc., hereby disclaims all copyright interest in the program
- `Gnomovision' (which makes passes at compilers) written by James Hacker.
-
- <signature of Ty Coon>, 1 April 1989
- Ty Coon, President of Vice
-
-This General Public License does not permit incorporating your program into
-proprietary programs. If your program is a subroutine library, you may
-consider it more useful to permit linking proprietary applications with the
-library. If this is what you want to do, use the GNU Library General
-Public License instead of this License.
diff --git a/meta-facebook/meta-wedge100/recipes-kernel/cpld-mod/files/Makefile b/meta-facebook/meta-wedge100/recipes-kernel/cpld-mod/files/Makefile
deleted file mode 100644
index bfbd786..0000000
--- a/meta-facebook/meta-wedge100/recipes-kernel/cpld-mod/files/Makefile
+++ /dev/null
@@ -1,31 +0,0 @@
-# Copyright 2015-present Facebook. All Rights Reserved.
-#
-# This program file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program in a file named COPYING; if not, write to the
-# Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor,
-# Boston, MA 02110-1301 USA
-
-obj-m := syscpld.o fancpld.o
-
-SRC := $(shell pwd)
-
-all:
- $(MAKE) -C $(KERNEL_SRC) M=$(SRC)
-
-modules_install:
- $(MAKE) -C $(KERNEL_SRC) M=$(SRC) modules_install
-
-clean:
- rm -f *.o *~ core .depend .*.cmd *.ko *.mod.c
- rm -f Module.markers Module.symvers modules.order
- rm -rf .tmp_versions Modules.symvers
diff --git a/meta-facebook/meta-wedge100/recipes-kernel/cpld-mod/files/fancpld.c b/meta-facebook/meta-wedge100/recipes-kernel/cpld-mod/files/fancpld.c
deleted file mode 100644
index 65ea0d1..0000000
--- a/meta-facebook/meta-wedge100/recipes-kernel/cpld-mod/files/fancpld.c
+++ /dev/null
@@ -1,396 +0,0 @@
-/*
- * fancpld.c - The i2c driver for FANBOARDCPLD
- *
- * Copyright 2015-present Facebook. All Rights Reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-
-//#define DEBUG
-
-#include <linux/errno.h>
-#include <linux/module.h>
-#include <linux/i2c.h>
-#include <linux/i2c_dev_sysfs.h>
-
-#ifdef DEBUG
-
-#define PP_DEBUG(fmt, ...) do { \
- printk(KERN_DEBUG "%s:%d " fmt "\n", \
- __FUNCTION__, __LINE__, ##__VA_ARGS__); \
-} while (0)
-
-#else /* !DEBUG */
-
-#define PP_DEBUG(fmt, ...)
-
-#endif
-
-static ssize_t fancpld_fan_rpm_show(struct device *dev,
- struct device_attribute *attr,
- char *buf)
-{
- int val;
-
- val = i2c_dev_read_byte(dev, attr);
- if (val < 0) {
- return val;
- }
- /* Multiply by 150 to get the RPM */
- val *= 150;
-
- return scnprintf(buf, PAGE_SIZE, "%u\n", val);
-}
-
-#define FANTRAY_PWM_HELP \
- "each value represents 1/32 duty cycle"
-#define FANTRAY_LED_CTRL_HELP \
- "0x0: Under HW control\n" \
- "0x1: Red off, Blue on\n" \
- "0x2: Red on, Blue off\n" \
- "0x3: Red off, Blue off"
-#define FANTRAY_LED_BLINK_HELP \
- "0: no blink\n" \
- "1: blink"
-
-static const i2c_dev_attr_st fancpld_attr_table[] = {
- {
- "board_rev",
- NULL,
- I2C_DEV_ATTR_SHOW_DEFAULT,
- NULL,
- 0, 0, 4,
- },
- {
- "model_id",
- "0x0: wedge100\n"
- "0x1: 6-pack100 linecard\n"
- "0x2: 6-pack100 fabric card\n"
- "0x3: reserved",
- I2C_DEV_ATTR_SHOW_DEFAULT,
- NULL,
- 0, 4, 2,
- },
- {
- "cpld_rev",
- NULL,
- I2C_DEV_ATTR_SHOW_DEFAULT,
- NULL,
- 1, 0, 6,
- },
- {
- "cpld_released",
- NULL,
- I2C_DEV_ATTR_SHOW_DEFAULT,
- NULL,
- 1, 6, 1,
- },
- {
- "cpld_sub_rev",
- NULL,
- I2C_DEV_ATTR_SHOW_DEFAULT,
- NULL,
- 2, 0, 8,
- },
- {
- "slotid",
- NULL,
- I2C_DEV_ATTR_SHOW_DEFAULT,
- NULL,
- 3, 0, 5,
- },
- {
- "jaybox_gpio",
- NULL,
- I2C_DEV_ATTR_SHOW_DEFAULT,
- NULL,
- 4, 0, 8,
- },
- {
- "jaybox_status",
- NULL,
- I2C_DEV_ATTR_SHOW_DEFAULT,
- NULL,
- 5, 0, 2,
- },
- {
- "fantray_failure",
- "bit value 0: fan tray has failure\n"
- "bit value 1: fan try is good and alive",
- I2C_DEV_ATTR_SHOW_DEFAULT,
- NULL,
- 9, 0, 5,
- },
- {
- "fan1_input",
- NULL,
- fancpld_fan_rpm_show,
- NULL,
- 0x10, 0, 8,
- },
- {
- "fan2_input",
- NULL,
- fancpld_fan_rpm_show,
- NULL,
- 0x11, 0, 8,
- },
- {
- "fan3_input",
- NULL,
- fancpld_fan_rpm_show,
- NULL,
- 0x12, 0, 8,
- },
- {
- "fan4_input",
- NULL,
- fancpld_fan_rpm_show,
- NULL,
- 0x13, 0, 8,
- },
- {
- "fan5_input",
- NULL,
- fancpld_fan_rpm_show,
- NULL,
- 0x14, 0, 8,
- },
- {
- "fan6_input",
- NULL,
- fancpld_fan_rpm_show,
- NULL,
- 0x15, 0, 8,
- },
- {
- "fan7_input",
- NULL,
- fancpld_fan_rpm_show,
- NULL,
- 0x16, 0, 8,
- },
- {
- "fan8_input",
- NULL,
- fancpld_fan_rpm_show,
- NULL,
- 0x17, 0, 8,
- },
- {
- "fan9_input",
- NULL,
- fancpld_fan_rpm_show,
- NULL,
- 0x18, 0, 8,
- },
- {
- "fan10_input",
- NULL,
- fancpld_fan_rpm_show,
- NULL,
- 0x19, 0, 8,
- },
- {
- "fantray_present",
- "0: present\n"
- "1: not present",
- I2C_DEV_ATTR_SHOW_DEFAULT,
- NULL,
- 0x1d, 0, 5,
- },
- {
- "fantray1_pwm",
- FANTRAY_PWM_HELP,
- I2C_DEV_ATTR_SHOW_DEFAULT,
- I2C_DEV_ATTR_STORE_DEFAULT,
- 0x20, 0, 5,
- },
- {
- "fantray2_pwm",
- FANTRAY_PWM_HELP,
- I2C_DEV_ATTR_SHOW_DEFAULT,
- I2C_DEV_ATTR_STORE_DEFAULT,
- 0x21, 0, 5,
- },
- {
- "fantray3_pwm",
- FANTRAY_PWM_HELP,
- I2C_DEV_ATTR_SHOW_DEFAULT,
- I2C_DEV_ATTR_STORE_DEFAULT,
- 0x22, 0, 5,
- },
- {
- "fantray4_pwm",
- FANTRAY_PWM_HELP,
- I2C_DEV_ATTR_SHOW_DEFAULT,
- I2C_DEV_ATTR_STORE_DEFAULT,
- 0x23, 0, 5,
- },
- {
- "fantray5_pwm",
- FANTRAY_PWM_HELP,
- I2C_DEV_ATTR_SHOW_DEFAULT,
- I2C_DEV_ATTR_STORE_DEFAULT,
- 0x24, 0, 5,
- },
- {
- "fantray1_led_ctrl",
- FANTRAY_LED_CTRL_HELP,
- I2C_DEV_ATTR_SHOW_DEFAULT,
- I2C_DEV_ATTR_STORE_DEFAULT,
- 0x25, 0, 2,
- },
- {
- "fantray1_led_blink",
- FANTRAY_LED_BLINK_HELP,
- I2C_DEV_ATTR_SHOW_DEFAULT,
- I2C_DEV_ATTR_STORE_DEFAULT,
- 0x25, 2, 1,
- },
- {
- "fantray2_led_ctrl",
- FANTRAY_LED_CTRL_HELP,
- I2C_DEV_ATTR_SHOW_DEFAULT,
- I2C_DEV_ATTR_STORE_DEFAULT,
- 0x25, 4, 2,
- },
- {
- "fantray2_led_blink",
- FANTRAY_LED_BLINK_HELP,
- I2C_DEV_ATTR_SHOW_DEFAULT,
- I2C_DEV_ATTR_STORE_DEFAULT,
- 0x25, 6, 1,
- },
- {
- "fantray3_led_ctrl",
- FANTRAY_LED_CTRL_HELP,
- I2C_DEV_ATTR_SHOW_DEFAULT,
- I2C_DEV_ATTR_STORE_DEFAULT,
- 0x26, 0, 2,
- },
- {
- "fantray3_led_blink",
- FANTRAY_LED_BLINK_HELP,
- I2C_DEV_ATTR_SHOW_DEFAULT,
- I2C_DEV_ATTR_STORE_DEFAULT,
- 0x26, 2, 1,
- },
- {
- "fantray4_led_ctrl",
- FANTRAY_LED_CTRL_HELP,
- I2C_DEV_ATTR_SHOW_DEFAULT,
- I2C_DEV_ATTR_STORE_DEFAULT,
- 0x26, 4, 2,
- },
- {
- "fantray4_led_blink",
- FANTRAY_LED_BLINK_HELP,
- I2C_DEV_ATTR_SHOW_DEFAULT,
- I2C_DEV_ATTR_STORE_DEFAULT,
- 0x26, 6, 1,
- },
- {
- "fantray5_led_ctrl",
- FANTRAY_LED_CTRL_HELP,
- I2C_DEV_ATTR_SHOW_DEFAULT,
- I2C_DEV_ATTR_STORE_DEFAULT,
- 0x27, 0, 2,
- },
- {
- "fantray5_led_blink",
- FANTRAY_LED_BLINK_HELP,
- I2C_DEV_ATTR_SHOW_DEFAULT,
- I2C_DEV_ATTR_STORE_DEFAULT,
- 0x27, 2, 1,
- },
-};
-
-static i2c_dev_data_st fancpld_data;
-
-/*
- * FANCPLD i2c addresses.
- * normal_i2c is used in I2C_CLIENT_INSMOD_1()
- */
-static const unsigned short normal_i2c[] = {
- 0x33, I2C_CLIENT_END
-};
-
-/*
- * Insmod parameters
- */
-I2C_CLIENT_INSMOD_1(fancpld);
-
-/* FANCPLD id */
-static const struct i2c_device_id fancpld_id[] = {
- { "fancpld", fancpld },
- { },
-};
-MODULE_DEVICE_TABLE(i2c, fancpld_id);
-
-/* Return 0 if detection is successful, -ENODEV otherwise */
-static int fancpld_detect(struct i2c_client *client, int kind,
- struct i2c_board_info *info)
-{
- /*
- * We don't currently do any detection of the FANCPLD
- */
- strlcpy(info->type, "fancpld", I2C_NAME_SIZE);
- return 0;
-}
-
-static int fancpld_probe(struct i2c_client *client,
- const struct i2c_device_id *id)
-{
- int n_attrs = sizeof(fancpld_attr_table) / sizeof(fancpld_attr_table[0]);
- return i2c_dev_sysfs_data_init(client, &fancpld_data,
- fancpld_attr_table, n_attrs);
-}
-
-static int fancpld_remove(struct i2c_client *client)
-{
- i2c_dev_sysfs_data_clean(client, &fancpld_data);
- return 0;
-}
-
-static struct i2c_driver fancpld_driver = {
- .class = I2C_CLASS_HWMON,
- .driver = {
- .name = "fancpld",
- },
- .probe = fancpld_probe,
- .remove = fancpld_remove,
- .id_table = fancpld_id,
- .detect = fancpld_detect,
- /* addr_data is defined through I2C_CLIENT_INSMOD_1() */
- .address_data = &addr_data,
-};
-
-static int __init fancpld_mod_init(void)
-{
- return i2c_add_driver(&fancpld_driver);
-}
-
-static void __exit fancpld_mod_exit(void)
-{
- i2c_del_driver(&fancpld_driver);
-}
-
-MODULE_AUTHOR("Tian Fang <tfang@fb.com>");
-MODULE_DESCRIPTION("FANCPLD Driver");
-MODULE_LICENSE("GPL");
-
-module_init(fancpld_mod_init);
-module_exit(fancpld_mod_exit);
diff --git a/meta-facebook/meta-wedge100/recipes-kernel/cpld-mod/files/syscpld.c b/meta-facebook/meta-wedge100/recipes-kernel/cpld-mod/files/syscpld.c
deleted file mode 100644
index 1f5abeb..0000000
--- a/meta-facebook/meta-wedge100/recipes-kernel/cpld-mod/files/syscpld.c
+++ /dev/null
@@ -1,281 +0,0 @@
-/*
- * syscpld.c - The i2c driver for SYSCPLD
- *
- * Copyright 2015-present Facebook. All Rights Reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-
-//#define DEBUG
-
-#include <linux/errno.h>
-#include <linux/module.h>
-#include <linux/i2c.h>
-#include <linux/i2c_dev_sysfs.h>
-
-#ifdef DEBUG
-
-#define PP_DEBUG(fmt, ...) do { \
- printk(KERN_DEBUG "%s:%d " fmt "\n", \
- __FUNCTION__, __LINE__, ##__VA_ARGS__); \
-} while (0)
-
-#else /* !DEBUG */
-
-#define PP_DEBUG(fmt, ...)
-
-#endif
-
-static const i2c_dev_attr_st syscpld_attr_table[] = {
- {
- "board_rev",
- NULL,
- I2C_DEV_ATTR_SHOW_DEFAULT,
- NULL,
- 0, 0, 4,
- },
- {
- "model_id",
- "0x0: wedge100\n"
- "0x1: 6-pack100 linecard\n"
- "0x2: 6-pack100 fabric card\n"
- "0x3: reserved",
- I2C_DEV_ATTR_SHOW_DEFAULT,
- NULL,
- 0, 4, 2,
- },
- {
- "cpld_rev",
- NULL,
- I2C_DEV_ATTR_SHOW_DEFAULT,
- NULL,
- 1, 0, 6,
- },
- {
- "cpld_released",
- NULL,
- I2C_DEV_ATTR_SHOW_DEFAULT,
- NULL,
- 1, 6, 1,
- },
- {
- "cpld_sub_rev",
- NULL,
- I2C_DEV_ATTR_SHOW_DEFAULT,
- NULL,
- 2, 0, 8,
- },
- {
- "slotid",
- NULL,
- I2C_DEV_ATTR_SHOW_DEFAULT,
- NULL,
- 3, 0, 5,
- },
- {
- "psu1_present",
- NULL,
- I2C_DEV_ATTR_SHOW_DEFAULT,
- NULL,
- 8, 0, 1,
- },
- {
- "psu2_present",
- NULL,
- I2C_DEV_ATTR_SHOW_DEFAULT,
- NULL,
- 8, 1, 1,
- },
- {
- "fan_rackmon_present",
- NULL,
- I2C_DEV_ATTR_SHOW_DEFAULT,
- NULL,
- 8, 2, 1,
- },
- {
- "micro_srv_present",
- NULL,
- I2C_DEV_ATTR_SHOW_DEFAULT,
- NULL,
- 8, 3, 1,
- },
- {
- "th_rov",
- NULL,
- I2C_DEV_ATTR_SHOW_DEFAULT,
- NULL,
- 0xb, 0, 4,
- },
- {
- "vcore_idsel",
- NULL,
- I2C_DEV_ATTR_SHOW_DEFAULT,
- NULL,
- 0xb, 4, 3,
- },
- {
- "uart_mux",
- "0x0: UART_SELECT_BMC\n0x1: UART_SELECT_DBG\n"
- "0x2: Force to select 0\n0x3: Force to select 1\n\n"
- "UART_SEL\n"
- "1: micro-server console connected to BMC\n"
- "0: micro-server console connected to debug header",
- I2C_DEV_ATTR_SHOW_DEFAULT,
- I2C_DEV_ATTR_STORE_DEFAULT,
- 0x26, 0, 2,
- },
- {
- "heart_attach_en",
- "0: no fan tray fatal error attack\n"
- "1: fan-tray fatal error attack mode enabled",
- I2C_DEV_ATTR_SHOW_DEFAULT,
- I2C_DEV_ATTR_STORE_DEFAULT,
- 0x2e, 7, 1,
- },
- {
- "dual_boot_en",
- "0: single boot\n"
- "1: dual boot",
- I2C_DEV_ATTR_SHOW_DEFAULT,
- I2C_DEV_ATTR_STORE_DEFAULT,
- 0x2f, 0, 1,
- },
- {
- "2nd_flash_wp",
- "0: writeable\n"
- "1: write protected",
- I2C_DEV_ATTR_SHOW_DEFAULT,
- I2C_DEV_ATTR_STORE_DEFAULT,
- 0x2f, 1, 1,
- },
- {
- "pwr_cyc_all_n",
- "0: power cycle all power\n"
- "1: normal",
- I2C_DEV_ATTR_SHOW_DEFAULT,
- I2C_DEV_ATTR_STORE_DEFAULT,
- 0x30, 0, 1,
- },
- {
- "pwr_main_n",
- "0: main power is off\n"
- "1: main power is enabled",
- I2C_DEV_ATTR_SHOW_DEFAULT,
- I2C_DEV_ATTR_STORE_DEFAULT,
- 0x30, 1, 1,
- },
- {
- "pwr_usrv_en",
- "0: micro-server power is off\n"
- "1: micro-server power is on",
- I2C_DEV_ATTR_SHOW_DEFAULT,
- I2C_DEV_ATTR_STORE_DEFAULT,
- 0x30, 2, 1,
- },
- {
- "pwr_usrv_btn_en",
- "0: micro-server power button is off\n"
- "1: micro-server power button is on",
- I2C_DEV_ATTR_SHOW_DEFAULT,
- I2C_DEV_ATTR_STORE_DEFAULT,
- 0x30, 3, 1,
- },
- {
- "usrv_rst_n",
- "0: write 0 to trigger micro-server reset"
- "1: normal",
- I2C_DEV_ATTR_SHOW_DEFAULT,
- I2C_DEV_ATTR_STORE_DEFAULT,
- 0x32, 0, 1,
- },
-};
-
-static i2c_dev_data_st syscpld_data;
-
-/*
- * SYSCPLD i2c addresses.
- * normal_i2c is used in I2C_CLIENT_INSMOD_1()
- */
-static const unsigned short normal_i2c[] = {
- 0x31, I2C_CLIENT_END
-};
-
-/*
- * Insmod parameters
- */
-I2C_CLIENT_INSMOD_1(syscpld);
-
-/* SYSCPLD id */
-static const struct i2c_device_id syscpld_id[] = {
- { "syscpld", syscpld },
- { },
-};
-MODULE_DEVICE_TABLE(i2c, syscpld_id);
-
-/* Return 0 if detection is successful, -ENODEV otherwise */
-static int syscpld_detect(struct i2c_client *client, int kind,
- struct i2c_board_info *info)
-{
- /*
- * We don't currently do any detection of the SYSCPLD
- */
- strlcpy(info->type, "syscpld", I2C_NAME_SIZE);
- return 0;
-}
-
-static int syscpld_probe(struct i2c_client *client,
- const struct i2c_device_id *id)
-{
- int n_attrs = sizeof(syscpld_attr_table) / sizeof(syscpld_attr_table[0]);
- return i2c_dev_sysfs_data_init(client, &syscpld_data,
- syscpld_attr_table, n_attrs);
-}
-
-static int syscpld_remove(struct i2c_client *client)
-{
- i2c_dev_sysfs_data_clean(client, &syscpld_data);
- return 0;
-}
-
-static struct i2c_driver syscpld_driver = {
- .class = I2C_CLASS_HWMON,
- .driver = {
- .name = "syscpld",
- },
- .probe = syscpld_probe,
- .remove = syscpld_remove,
- .id_table = syscpld_id,
- .detect = syscpld_detect,
- /* addr_data is defined through I2C_CLIENT_INSMOD_1() */
- .address_data = &addr_data,
-};
-
-static int __init syscpld_mod_init(void)
-{
- return i2c_add_driver(&syscpld_driver);
-}
-
-static void __exit syscpld_mod_exit(void)
-{
- i2c_del_driver(&syscpld_driver);
-}
-
-MODULE_AUTHOR("Tian Fang <tfang@fb.com>");
-MODULE_DESCRIPTION("SYSCPLD Driver");
-MODULE_LICENSE("GPL");
-
-module_init(syscpld_mod_init);
-module_exit(syscpld_mod_exit);
diff --git a/meta-facebook/meta-wedge100/recipes-kernel/cpld-mod/kernel-module-cpld_0.1.bb b/meta-facebook/meta-wedge100/recipes-kernel/cpld-mod/kernel-module-cpld_0.1.bb
deleted file mode 100644
index dd0b6c6..0000000
--- a/meta-facebook/meta-wedge100/recipes-kernel/cpld-mod/kernel-module-cpld_0.1.bb
+++ /dev/null
@@ -1,42 +0,0 @@
-# Copyright 2015-present Facebook. All Rights Reserved.
-#
-# This program file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program in a file named COPYING; if not, write to the
-# Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor,
-# Boston, MA 02110-1301 USA
-
-SUMMARY = "Wedge100 CPLD drivers"
-LICENSE = "GPLv2"
-LIC_FILES_CHKSUM = "file://COPYING;md5=12f884d2ae1ff87c09e5b7ccc2c4ca7e"
-
-inherit module
-
-PR = "r0"
-PV = "0.1"
-
-SRC_URI = "file://Makefile \
- file://syscpld.c \
- file://fancpld.c \
- file://COPYING \
- "
-
-S = "${WORKDIR}"
-
-DEPENDS += "kernel-module-i2c-dev-sysfs"
-
-RDEPENDS_${PN} += "kernel-module-i2c-dev-sysfs"
-
-KERNEL_MODULE_AUTOLOAD += " \
- syscpld \
- fancpld \
-"
diff --git a/meta-facebook/meta-wedge100/recipes-kernel/i2c-dev-sysfs-mod/files/COPYING b/meta-facebook/meta-wedge100/recipes-kernel/i2c-dev-sysfs-mod/files/COPYING
deleted file mode 100644
index 6d45519..0000000
--- a/meta-facebook/meta-wedge100/recipes-kernel/i2c-dev-sysfs-mod/files/COPYING
+++ /dev/null
@@ -1,340 +0,0 @@
- GNU GENERAL PUBLIC LICENSE
- Version 2, June 1991
-
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.
- 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
- Preamble
-
- The licenses for most software are designed to take away your
-freedom to share and change it. By contrast, the GNU General Public
-License is intended to guarantee your freedom to share and change free
-software--to make sure the software is free for all its users. This
-General Public License applies to most of the Free Software
-Foundation's software and to any other program whose authors commit to
-using it. (Some other Free Software Foundation software is covered by
-the GNU Library General Public License instead.) You can apply it to
-your programs, too.
-
- When we speak of free software, we are referring to freedom, not
-price. Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-this service if you wish), that you receive source code or can get it
-if you want it, that you can change the software or use pieces of it
-in new free programs; and that you know you can do these things.
-
- To protect your rights, we need to make restrictions that forbid
-anyone to deny you these rights or to ask you to surrender the rights.
-These restrictions translate to certain responsibilities for you if you
-distribute copies of the software, or if you modify it.
-
- For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must give the recipients all the rights that
-you have. You must make sure that they, too, receive or can get the
-source code. And you must show them these terms so they know their
-rights.
-
- We protect your rights with two steps: (1) copyright the software, and
-(2) offer you this license which gives you legal permission to copy,
-distribute and/or modify the software.
-
- Also, for each author's protection and ours, we want to make certain
-that everyone understands that there is no warranty for this free
-software. If the software is modified by someone else and passed on, we
-want its recipients to know that what they have is not the original, so
-that any problems introduced by others will not reflect on the original
-authors' reputations.
-
- Finally, any free program is threatened constantly by software
-patents. We wish to avoid the danger that redistributors of a free
-program will individually obtain patent licenses, in effect making the
-program proprietary. To prevent this, we have made it clear that any
-patent must be licensed for everyone's free use or not licensed at all.
-
- The precise terms and conditions for copying, distribution and
-modification follow.
-
- GNU GENERAL PUBLIC LICENSE
- TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
- 0. This License applies to any program or other work which contains
-a notice placed by the copyright holder saying it may be distributed
-under the terms of this General Public License. The "Program", below,
-refers to any such program or work, and a "work based on the Program"
-means either the Program or any derivative work under copyright law:
-that is to say, a work containing the Program or a portion of it,
-either verbatim or with modifications and/or translated into another
-language. (Hereinafter, translation is included without limitation in
-the term "modification".) Each licensee is addressed as "you".
-
-Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope. The act of
-running the Program is not restricted, and the output from the Program
-is covered only if its contents constitute a work based on the
-Program (independent of having been made by running the Program).
-Whether that is true depends on what the Program does.
-
- 1. You may copy and distribute verbatim copies of the Program's
-source code as you receive it, in any medium, provided that you
-conspicuously and appropriately publish on each copy an appropriate
-copyright notice and disclaimer of warranty; keep intact all the
-notices that refer to this License and to the absence of any warranty;
-and give any other recipients of the Program a copy of this License
-along with the Program.
-
-You may charge a fee for the physical act of transferring a copy, and
-you may at your option offer warranty protection in exchange for a fee.
-
- 2. You may modify your copy or copies of the Program or any portion
-of it, thus forming a work based on the Program, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
- a) You must cause the modified files to carry prominent notices
- stating that you changed the files and the date of any change.
-
- b) You must cause any work that you distribute or publish, that in
- whole or in part contains or is derived from the Program or any
- part thereof, to be licensed as a whole at no charge to all third
- parties under the terms of this License.
-
- c) If the modified program normally reads commands interactively
- when run, you must cause it, when started running for such
- interactive use in the most ordinary way, to print or display an
- announcement including an appropriate copyright notice and a
- notice that there is no warranty (or else, saying that you provide
- a warranty) and that users may redistribute the program under
- these conditions, and telling the user how to view a copy of this
- License. (Exception: if the Program itself is interactive but
- does not normally print such an announcement, your work based on
- the Program is not required to print an announcement.)
-
-These requirements apply to the modified work as a whole. If
-identifiable sections of that work are not derived from the Program,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works. But when you
-distribute the same sections as part of a whole which is a work based
-on the Program, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Program.
-
-In addition, mere aggregation of another work not based on the Program
-with the Program (or with a work based on the Program) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
- 3. You may copy and distribute the Program (or a work based on it,
-under Section 2) in object code or executable form under the terms of
-Sections 1 and 2 above provided that you also do one of the following:
-
- a) Accompany it with the complete corresponding machine-readable
- source code, which must be distributed under the terms of Sections
- 1 and 2 above on a medium customarily used for software interchange; or,
-
- b) Accompany it with a written offer, valid for at least three
- years, to give any third party, for a charge no more than your
- cost of physically performing source distribution, a complete
- machine-readable copy of the corresponding source code, to be
- distributed under the terms of Sections 1 and 2 above on a medium
- customarily used for software interchange; or,
-
- c) Accompany it with the information you received as to the offer
- to distribute corresponding source code. (This alternative is
- allowed only for noncommercial distribution and only if you
- received the program in object code or executable form with such
- an offer, in accord with Subsection b above.)
-
-The source code for a work means the preferred form of the work for
-making modifications to it. For an executable work, complete source
-code means all the source code for all modules it contains, plus any
-associated interface definition files, plus the scripts used to
-control compilation and installation of the executable. However, as a
-special exception, the source code distributed need not include
-anything that is normally distributed (in either source or binary
-form) with the major components (compiler, kernel, and so on) of the
-operating system on which the executable runs, unless that component
-itself accompanies the executable.
-
-If distribution of executable or object code is made by offering
-access to copy from a designated place, then offering equivalent
-access to copy the source code from the same place counts as
-distribution of the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
- 4. You may not copy, modify, sublicense, or distribute the Program
-except as expressly provided under this License. Any attempt
-otherwise to copy, modify, sublicense or distribute the Program is
-void, and will automatically terminate your rights under this License.
-However, parties who have received copies, or rights, from you under
-this License will not have their licenses terminated so long as such
-parties remain in full compliance.
-
- 5. You are not required to accept this License, since you have not
-signed it. However, nothing else grants you permission to modify or
-distribute the Program or its derivative works. These actions are
-prohibited by law if you do not accept this License. Therefore, by
-modifying or distributing the Program (or any work based on the
-Program), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Program or works based on it.
-
- 6. Each time you redistribute the Program (or any work based on the
-Program), the recipient automatically receives a license from the
-original licensor to copy, distribute or modify the Program subject to
-these terms and conditions. You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties to
-this License.
-
- 7. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License. If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Program at all. For example, if a patent
-license would not permit royalty-free redistribution of the Program by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Program.
-
-If any portion of this section is held invalid or unenforceable under
-any particular circumstance, the balance of the section is intended to
-apply and the section as a whole is intended to apply in other
-circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system, which is
-implemented by public license practices. Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
- 8. If the distribution and/or use of the Program is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Program under this License
-may add an explicit geographical distribution limitation excluding
-those countries, so that distribution is permitted only in or among
-countries not thus excluded. In such case, this License incorporates
-the limitation as if written in the body of this License.
-
- 9. The Free Software Foundation may publish revised and/or new versions
-of the General Public License from time to time. Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
-Each version is given a distinguishing version number. If the Program
-specifies a version number of this License which applies to it and "any
-later version", you have the option of following the terms and conditions
-either of that version or of any later version published by the Free
-Software Foundation. If the Program does not specify a version number of
-this License, you may choose any version ever published by the Free Software
-Foundation.
-
- 10. If you wish to incorporate parts of the Program into other free
-programs whose distribution conditions are different, write to the author
-to ask for permission. For software which is copyrighted by the Free
-Software Foundation, write to the Free Software Foundation; we sometimes
-make exceptions for this. Our decision will be guided by the two goals
-of preserving the free status of all derivatives of our free software and
-of promoting the sharing and reuse of software generally.
-
- NO WARRANTY
-
- 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
-FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
-OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
-PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
-OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
-TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
-PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
-REPAIR OR CORRECTION.
-
- 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
-REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
-INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
-OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
-TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
-YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
-PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGES.
-
- END OF TERMS AND CONDITIONS
-
- How to Apply These Terms to Your New Programs
-
- If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
- To do so, attach the following notices to the program. It is safest
-to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least
-the "copyright" line and a pointer to where the full notice is found.
-
- <one line to give the program's name and a brief idea of what it does.>
- Copyright (C) <year> <name of author>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
-
-Also add information on how to contact you by electronic and paper mail.
-
-If the program is interactive, make it output a short notice like this
-when it starts in an interactive mode:
-
- Gnomovision version 69, Copyright (C) year name of author
- Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
- This is free software, and you are welcome to redistribute it
- under certain conditions; type `show c' for details.
-
-The hypothetical commands `show w' and `show c' should show the appropriate
-parts of the General Public License. Of course, the commands you use may
-be called something other than `show w' and `show c'; they could even be
-mouse-clicks or menu items--whatever suits your program.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the program, if
-necessary. Here is a sample; alter the names:
-
- Yoyodyne, Inc., hereby disclaims all copyright interest in the program
- `Gnomovision' (which makes passes at compilers) written by James Hacker.
-
- <signature of Ty Coon>, 1 April 1989
- Ty Coon, President of Vice
-
-This General Public License does not permit incorporating your program into
-proprietary programs. If your program is a subroutine library, you may
-consider it more useful to permit linking proprietary applications with the
-library. If this is what you want to do, use the GNU Library General
-Public License instead of this License.
diff --git a/meta-facebook/meta-wedge100/recipes-kernel/i2c-dev-sysfs-mod/files/Makefile b/meta-facebook/meta-wedge100/recipes-kernel/i2c-dev-sysfs-mod/files/Makefile
deleted file mode 100644
index 4be7b62..0000000
--- a/meta-facebook/meta-wedge100/recipes-kernel/i2c-dev-sysfs-mod/files/Makefile
+++ /dev/null
@@ -1,31 +0,0 @@
-# Copyright 2015-present Facebook. All Rights Reserved.
-#
-# This program file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program in a file named COPYING; if not, write to the
-# Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor,
-# Boston, MA 02110-1301 USA
-
-obj-m := i2c_dev_sysfs.o
-
-SRC := $(shell pwd)
-
-all:
- $(MAKE) -C $(KERNEL_SRC) M=$(SRC)
-
-modules_install:
- $(MAKE) -C $(KERNEL_SRC) M=$(SRC) modules_install
-
-clean:
- rm -f *.o *~ core .depend .*.cmd *.ko *.mod.c
- rm -f Module.markers Module.symvers modules.order
- rm -rf .tmp_versions Modules.symvers
diff --git a/meta-facebook/meta-wedge100/recipes-kernel/i2c-dev-sysfs-mod/files/i2c_dev_sysfs.c b/meta-facebook/meta-wedge100/recipes-kernel/i2c-dev-sysfs-mod/files/i2c_dev_sysfs.c
deleted file mode 100644
index 96c1b98..0000000
--- a/meta-facebook/meta-wedge100/recipes-kernel/i2c-dev-sysfs-mod/files/i2c_dev_sysfs.c
+++ /dev/null
@@ -1,349 +0,0 @@
-/*
- * i2c_dev_sysfs.c - The i2c device sysfs library
- *
- * Copyright 2015-present Facebook. All Rights Reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-
-//#define DEBUG
-
-#include <linux/err.h>
-#include <linux/errno.h>
-#include <linux/hwmon.h>
-#include <linux/hwmon-sysfs.h>
-#include <linux/i2c.h>
-#include <linux/module.h>
-#include <linux/mutex.h>
-#include <linux/sysfs.h>
-
-#include "i2c_dev_sysfs.h"
-
-#ifdef DEBUG
-
-#define PP_DEBUG(fmt, ...) do { \
- printk(KERN_DEBUG "%s:%d " fmt "\n", \
- __FUNCTION__, __LINE__, ##__VA_ARGS__); \
-} while (0)
-
-#else /* !DEBUG */
-
-#define PP_DEBUG(fmt, ...)
-
-#endif
-
-ssize_t i2c_dev_show_label(struct device *dev,
- struct device_attribute *attr,
- char *buf)
-{
- i2c_sysfs_attr_st *i2c_attr = TO_I2C_SYSFS_ATTR(attr);
- const i2c_dev_attr_st *dev_attr = i2c_attr->isa_i2c_attr;
-
- if (dev_attr->ida_help) {
- return sprintf(buf, "%s\n", dev_attr->ida_help);
- }
- return sprintf(buf, "%s\n", dev_attr->ida_name);
-}
-EXPORT_SYMBOL_GPL(i2c_dev_show_label);
-
-int i2c_dev_read_byte(struct device *dev,
- struct device_attribute *attr)
-{
- struct i2c_client *client = to_i2c_client(dev);
- i2c_dev_data_st *data = i2c_get_clientdata(client);
- i2c_sysfs_attr_st *i2c_attr = TO_I2C_SYSFS_ATTR(attr);
- const i2c_dev_attr_st *dev_attr = i2c_attr->isa_i2c_attr;
- int val;
- int val_mask;
-
- val_mask = ~(((-1) >> (dev_attr->ida_n_bits)) << (dev_attr->ida_n_bits));
-
- mutex_lock(&data->idd_lock);
-
- val = i2c_smbus_read_byte_data(client, dev_attr->ida_reg);
-
- mutex_unlock(&data->idd_lock);
-
- if (val < 0) {
- /* error case */
- return val;
- }
-
- val = (val >> dev_attr->ida_bit_offset) & val_mask;
- return val;
-}
-EXPORT_SYMBOL_GPL(i2c_dev_read_byte);
-
-int i2c_dev_read_nbytes(struct device *dev,
- struct device_attribute *attr,
- uint8_t values[],
- int nbytes)
-{
- struct i2c_client *client = to_i2c_client(dev);
- i2c_dev_data_st *data = i2c_get_clientdata(client);
- i2c_sysfs_attr_st *i2c_attr = TO_I2C_SYSFS_ATTR(attr);
- const i2c_dev_attr_st *dev_attr = i2c_attr->isa_i2c_attr;
- int i;
-
- mutex_lock(&data->idd_lock);
- for (i = 0; i < nbytes; ++i) {
- values[i] = i2c_smbus_read_byte_data(client, dev_attr->ida_reg + i);
- if (values[i] < 0) {
- mutex_unlock(&data->idd_lock);
- return values[i];
- }
- }
- mutex_unlock(&data->idd_lock);
- return nbytes;
-}
-EXPORT_SYMBOL_GPL(i2c_dev_read_nbytes);
-
-int i2c_dev_read_word_littleendian(struct device *dev,
- struct device_attribute *attr)
-{
- uint8_t values[2];
- int ret_val;
-
- ret_val = i2c_dev_read_nbytes(dev, attr, values, 2);
- if (ret_val < 0) {
- return ret_val;
- }
- // values[0] : LSB
- // values[1] : MSB
- return ((values[1]<<8) + values[0]);
-}
-EXPORT_SYMBOL_GPL(i2c_dev_read_word_littleendian);
-
-int i2c_dev_read_word_bigendian(struct device *dev,
- struct device_attribute *attr)
-{
- uint8_t values[2];
- int ret_val;
-
- ret_val = i2c_dev_read_nbytes(dev, attr, values, 2);
- if (ret_val < 0) {
- return ret_val;
- }
- // values[0] : MSB
- // values[1] : LSB
- return ((values[0]<<8) + values[1]);
-}
-EXPORT_SYMBOL_GPL(i2c_dev_read_word_bigendian);
-
-ssize_t i2c_dev_show_ascii(struct device *dev,
- struct device_attribute *attr,
- char *buf)
-{
- i2c_sysfs_attr_st *i2c_attr = TO_I2C_SYSFS_ATTR(attr);
- const i2c_dev_attr_st *dev_attr = i2c_attr->isa_i2c_attr;
- int nbytes, ret_val;
-
- nbytes = (dev_attr->ida_n_bits) / 8;
- ret_val = i2c_dev_read_nbytes(dev, attr, buf, nbytes);
- if (ret_val < 0) {
- return ret_val;
- }
- //buf[] : ascii data
- buf[nbytes] = '\n';
- return (nbytes + 1);
-}
-EXPORT_SYMBOL_GPL(i2c_dev_show_ascii);
-
-static ssize_t i2c_dev_sysfs_show(struct device *dev,
- struct device_attribute *attr,
- char *buf)
-{
- struct i2c_client *client = to_i2c_client(dev);
- i2c_dev_data_st *data = i2c_get_clientdata(client);
- i2c_sysfs_attr_st *i2c_attr = TO_I2C_SYSFS_ATTR(attr);
- const i2c_dev_attr_st *dev_attr = i2c_attr->isa_i2c_attr;
- int val;
- int val_mask;
-
- if (!dev_attr->ida_show) {
- return -EOPNOTSUPP;
- }
-
- if (dev_attr->ida_show != I2C_DEV_ATTR_SHOW_DEFAULT) {
- return dev_attr->ida_show(dev, attr, buf);
- }
-
- val_mask = ~(((-1) >> (dev_attr->ida_n_bits)) << (dev_attr->ida_n_bits));
-
- mutex_lock(&data->idd_lock);
-
- /* default handling */
- val = i2c_smbus_read_byte_data(client, dev_attr->ida_reg);
-
- mutex_unlock(&data->idd_lock);
-
- if (val < 0) {
- /* error case */
- return val;
- }
-
- val = (val >> dev_attr->ida_bit_offset) & val_mask;
-
- return scnprintf(buf, PAGE_SIZE, "0x%x%s%s\n", val,
- (dev_attr->ida_help) ? "\n\nNote:\n" : "",
- (dev_attr->ida_help) ? dev_attr->ida_help : "");
-}
-
-static ssize_t i2c_dev_sysfs_store(struct device *dev,
- struct device_attribute *attr,
- const char *buf, size_t count)
-{
- struct i2c_client *client = to_i2c_client(dev);
- i2c_dev_data_st *data = i2c_get_clientdata(client);
- i2c_sysfs_attr_st *i2c_attr = TO_I2C_SYSFS_ATTR(attr);
- const i2c_dev_attr_st *dev_attr = i2c_attr->isa_i2c_attr;
- int val;
- int req_val;
- int req_val_mask;
-
- if (!dev_attr->ida_store) {
- return -EOPNOTSUPP;
- }
-
- if (dev_attr->ida_store != I2C_DEV_ATTR_STORE_DEFAULT) {
- return dev_attr->ida_store(dev, attr, buf, count);
- }
-
- /* parse the buffer */
- if (sscanf(buf, "%i", &req_val) <= 0) {
- return -EINVAL;
- }
- req_val_mask = ~(((-1) >> (dev_attr->ida_n_bits)) << (dev_attr->ida_n_bits));
- req_val &= req_val_mask;
-
- mutex_lock(&data->idd_lock);
-
- /* default handling, first read back the current value */
- val = i2c_smbus_read_byte_data(client, dev_attr->ida_reg);
-
- if (val < 0) {
- /* fail to read */
- goto unlock_out;
- }
-
- /* mask out all bits for the value requested */
- val &= ~(req_val_mask << dev_attr->ida_bit_offset);
- val |= req_val << dev_attr->ida_bit_offset;
-
- val = i2c_smbus_write_byte_data(client, dev_attr->ida_reg, val);
-
- unlock_out:
- mutex_unlock(&data->idd_lock);
-
- if (val < 0) {
- /* error case */
- return val;
- }
-
- return count;
-}
-
-void i2c_dev_sysfs_data_clean(struct i2c_client *client, i2c_dev_data_st *data)
-{
- if (!data) {
- return;
- }
- if (data->idd_hwmon_dev) {
- hwmon_device_unregister(data->idd_hwmon_dev);
- }
- if (data->idd_attr_group.attrs) {
- sysfs_remove_group(&client->dev.kobj, &data->idd_attr_group);
- kfree(data->idd_attr_group.attrs);
- }
- if (data->idd_attrs) {
- kfree(data->idd_attrs);
- }
- memset(data, 0, sizeof(*data));
-}
-EXPORT_SYMBOL_GPL(i2c_dev_sysfs_data_clean);
-
-int i2c_dev_sysfs_data_init(struct i2c_client *client,
- i2c_dev_data_st *data,
- const i2c_dev_attr_st *dev_attrs,
- int n_attrs)
-{
- int i;
- int err;
- i2c_sysfs_attr_st *cur_attr;
- const i2c_dev_attr_st *cur_dev_attr;
- struct attribute **cur_grp_attr;
-
- memset(data, 0, sizeof(*data));
-
- i2c_set_clientdata(client, data);
- mutex_init(&data->idd_lock);
-
- /* allocate all attribute */
- data->idd_attrs = kzalloc(sizeof(*data->idd_attrs) * n_attrs, GFP_KERNEL);
- /* allocate the attribute group. +1 for the last NULL */
- data->idd_attr_group.attrs
- = kzalloc(sizeof(*data->idd_attr_group.attrs) * (n_attrs + 1), GFP_KERNEL);
- if (!data->idd_attrs || !data->idd_attr_group.attrs) {
- err = -ENOMEM;
- goto exit_cleanup;
- }
- PP_DEBUG("Allocated %u attributes", n_attrs);
-
- for (i = 0,
- cur_attr = &data->idd_attrs[0],
- cur_grp_attr = &data->idd_attr_group.attrs[0],
- cur_dev_attr = dev_attrs;
- i < n_attrs;
- i++, cur_attr++, cur_grp_attr++, cur_dev_attr++) {
-
- mode_t mode = S_IRUGO;
- if (cur_dev_attr->ida_store) {
- mode |= S_IWUSR;
- }
- cur_attr->isa_dev_attr.attr.name = cur_dev_attr->ida_name;
- cur_attr->isa_dev_attr.attr.mode = mode;
- cur_attr->isa_dev_attr.show = i2c_dev_sysfs_show;
- cur_attr->isa_dev_attr.store = i2c_dev_sysfs_store;
- *cur_grp_attr = &cur_attr->isa_dev_attr.attr;
- cur_attr->isa_i2c_attr = cur_dev_attr;
- PP_DEBUG("Created attribute \"%s\"", cur_attr->isa_dev_attr.attr.name);
- }
-
- /* Register sysfs hooks */
- if ((err = sysfs_create_group(&client->dev.kobj, &data->idd_attr_group))) {
- goto exit_cleanup;
- }
-
- data->idd_hwmon_dev = hwmon_device_register(&client->dev);
- if (IS_ERR(data->idd_hwmon_dev)) {
- err = PTR_ERR(data->idd_hwmon_dev);
- data->idd_hwmon_dev = NULL;
- goto exit_cleanup;
- }
-
- PP_DEBUG("i2c device sysfs init data done");
-
- return 0;
-
- exit_cleanup:
- i2c_dev_sysfs_data_clean(client, data);
- return err;
-}
-EXPORT_SYMBOL_GPL(i2c_dev_sysfs_data_init);
-
-
-MODULE_AUTHOR("Tian Fang <tfang@fb.com>");
-MODULE_DESCRIPTION("i2c device sysfs attribute library");
-MODULE_LICENSE("GPL");
diff --git a/meta-facebook/meta-wedge100/recipes-kernel/i2c-dev-sysfs-mod/files/i2c_dev_sysfs.h b/meta-facebook/meta-wedge100/recipes-kernel/i2c-dev-sysfs-mod/files/i2c_dev_sysfs.h
deleted file mode 100644
index 47862cc..0000000
--- a/meta-facebook/meta-wedge100/recipes-kernel/i2c-dev-sysfs-mod/files/i2c_dev_sysfs.h
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * i2c_dev_sysfs.h - The i2c device sysfs library header
- *
- * Copyright 2015-present Facebook. All Rights Reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-
-#ifndef I2C_DEV_SYSFS_H
-#define I2C_DEV_SYSFS_H
-
-#include <linux/device.h>
-#include <linux/types.h>
-
-typedef ssize_t (*i2c_dev_attr_show_fn)(struct device *dev,
- struct device_attribute *attr,
- char *buf);
-typedef ssize_t (*i2c_dev_attr_store_fn)(struct device *dev,
- struct device_attribute *attr,
- const char *buf, size_t count);
-
-#define I2C_DEV_ATTR_SHOW_DEFAULT (i2c_dev_attr_show_fn)(1)
-#define I2C_DEV_ATTR_STORE_DEFAULT (i2c_dev_attr_store_fn)(1)
-
-typedef struct i2c_dev_attr_st_ {
- const char *ida_name;
- const char *ida_help;
- i2c_dev_attr_show_fn ida_show;
- i2c_dev_attr_store_fn ida_store;
- int ida_reg;
- int ida_bit_offset;
- int ida_n_bits;
-} i2c_dev_attr_st;
-
-typedef struct i2c_sysfs_attr_st_{
- struct device_attribute isa_dev_attr;
- const i2c_dev_attr_st *isa_i2c_attr;
-} i2c_sysfs_attr_st;
-
-#define TO_I2C_SYSFS_ATTR(_attr) \
- container_of(_attr, i2c_sysfs_attr_st, isa_dev_attr)
-
-typedef struct i2c_dev_data_st_ {
- struct device *idd_hwmon_dev;
- struct mutex idd_lock;
- i2c_sysfs_attr_st *idd_attrs;
- struct attribute_group idd_attr_group;
-} i2c_dev_data_st;
-
-int i2c_dev_sysfs_data_init(struct i2c_client *client,
- i2c_dev_data_st *data,
- const i2c_dev_attr_st *dev_attrs,
- int n_attrs);
-void i2c_dev_sysfs_data_clean(struct i2c_client *client, i2c_dev_data_st *data);
-int i2c_dev_read_byte(struct device *dev,
- struct device_attribute *attr);
-int i2c_dev_read_nbytes(struct device *dev,
- struct device_attribute *attr,
- uint8_t values[],
- int nbytes);
-int i2c_dev_read_word_littleendian(struct device *dev,
- struct device_attribute *attr);
-int i2c_dev_read_word_bigendian(struct device *dev,
- struct device_attribute *attr);
-ssize_t i2c_dev_show_label(struct device *dev,
- struct device_attribute *attr,
- char *buf);
-ssize_t i2c_dev_show_ascii(struct device *dev,
- struct device_attribute *attr,
- char *buf);
-
-#endif
diff --git a/meta-facebook/meta-wedge100/recipes-kernel/i2c-dev-sysfs-mod/kernel-module-i2c-dev-sysfs_0.1.bb b/meta-facebook/meta-wedge100/recipes-kernel/i2c-dev-sysfs-mod/kernel-module-i2c-dev-sysfs_0.1.bb
deleted file mode 100644
index 8e42144..0000000
--- a/meta-facebook/meta-wedge100/recipes-kernel/i2c-dev-sysfs-mod/kernel-module-i2c-dev-sysfs_0.1.bb
+++ /dev/null
@@ -1,42 +0,0 @@
-# Copyright 2015-present Facebook. All Rights Reserved.
-#
-# This program file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program in a file named COPYING; if not, write to the
-# Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor,
-# Boston, MA 02110-1301 USA
-
-SUMMARY = "Wedge100 i2c device library"
-DESCRIPTION = "i2c device sysfs attribute library"
-LICENSE = "GPLv2"
-LIC_FILES_CHKSUM = "file://COPYING;md5=12f884d2ae1ff87c09e5b7ccc2c4ca7e"
-
-inherit module
-
-PR = "r0"
-PV = "0.1"
-
-SRC_URI = "file://Makefile \
- file://i2c_dev_sysfs.c \
- file://i2c_dev_sysfs.h \
- file://COPYING \
- "
-
-S = "${WORKDIR}"
-
-do_install_append() {
- kerneldir=${STAGING_KERNEL_DIR}/include/linux
- install -d ${kerneldir}
- install -m 0644 i2c_dev_sysfs.h ${kerneldir}/
-}
-
-FILES_${PN}-dev = "${kerneldir}/i2c_dev_sysfs.h"
diff --git a/meta-facebook/meta-wedge100/recipes-kernel/linux/files/defconfig b/meta-facebook/meta-wedge100/recipes-kernel/linux/files/defconfig
deleted file mode 100644
index 0f9f0f7..0000000
--- a/meta-facebook/meta-wedge100/recipes-kernel/linux/files/defconfig
+++ /dev/null
@@ -1,1462 +0,0 @@
-#
-# Automatically generated make config: don't edit
-# Linux kernel version: 2.6.28.9
-# Wed Aug 5 18:43:53 2015
-#
-CONFIG_ARM=y
-CONFIG_SYS_SUPPORTS_APM_EMULATION=y
-CONFIG_GENERIC_GPIO=y
-CONFIG_GENERIC_TIME=y
-CONFIG_GENERIC_CLOCKEVENTS=y
-CONFIG_MMU=y
-# CONFIG_NO_IOPORT is not set
-CONFIG_GENERIC_HARDIRQS=y
-CONFIG_STACKTRACE_SUPPORT=y
-CONFIG_HAVE_LATENCYTOP_SUPPORT=y
-CONFIG_LOCKDEP_SUPPORT=y
-CONFIG_TRACE_IRQFLAGS_SUPPORT=y
-CONFIG_HARDIRQS_SW_RESEND=y
-CONFIG_GENERIC_IRQ_PROBE=y
-CONFIG_RWSEM_GENERIC_SPINLOCK=y
-# CONFIG_ARCH_HAS_ILOG2_U32 is not set
-# CONFIG_ARCH_HAS_ILOG2_U64 is not set
-CONFIG_GENERIC_HWEIGHT=y
-CONFIG_GENERIC_CALIBRATE_DELAY=y
-CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
-CONFIG_VECTORS_BASE=0xffff0000
-CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
-
-#
-# General setup
-#
-CONFIG_EXPERIMENTAL=y
-CONFIG_BROKEN_ON_SMP=y
-CONFIG_INIT_ENV_ARG_LIMIT=32
-CONFIG_LOCALVERSION=""
-# CONFIG_LOCALVERSION_AUTO is not set
-CONFIG_KERNEL_GZIP=y
-# CONFIG_KERNEL_BZIP2 is not set
-# CONFIG_KERNEL_LZMA is not set
-CONFIG_SWAP=y
-CONFIG_SYSVIPC=y
-CONFIG_SYSVIPC_SYSCTL=y
-# CONFIG_POSIX_MQUEUE is not set
-# CONFIG_BSD_PROCESS_ACCT is not set
-# CONFIG_TASKSTATS is not set
-# CONFIG_AUDIT is not set
-CONFIG_IKCONFIG=m
-CONFIG_IKCONFIG_PROC=y
-CONFIG_LOG_BUF_SHIFT=16
-# CONFIG_CGROUPS is not set
-# CONFIG_GROUP_SCHED is not set
-CONFIG_SYSFS_DEPRECATED=y
-CONFIG_SYSFS_DEPRECATED_V2=y
-# CONFIG_RELAY is not set
-CONFIG_NAMESPACES=y
-# CONFIG_UTS_NS is not set
-# CONFIG_IPC_NS is not set
-# CONFIG_USER_NS is not set
-# CONFIG_PID_NS is not set
-CONFIG_BLK_DEV_INITRD=y
-CONFIG_INITRAMFS_SOURCE=""
-CONFIG_CC_OPTIMIZE_FOR_SIZE=y
-CONFIG_SYSCTL=y
-CONFIG_ANON_INODES=y
-# CONFIG_EMBEDDED is not set
-CONFIG_UID16=y
-CONFIG_SYSCTL_SYSCALL=y
-CONFIG_KALLSYMS=y
-CONFIG_KALLSYMS_EXTRA_PASS=y
-CONFIG_HOTPLUG=y
-CONFIG_PRINTK=y
-CONFIG_BUG=y
-CONFIG_ELF_CORE=y
-CONFIG_BASE_FULL=y
-CONFIG_FUTEX=y
-CONFIG_EPOLL=y
-CONFIG_SIGNALFD=y
-CONFIG_TIMERFD=y
-CONFIG_EVENTFD=y
-CONFIG_SHMEM=y
-CONFIG_AIO=y
-CONFIG_VM_EVENT_COUNTERS=y
-CONFIG_SLUB_DEBUG=y
-CONFIG_COMPAT_BRK=y
-# CONFIG_SLAB is not set
-CONFIG_SLUB=y
-# CONFIG_SLOB is not set
-# CONFIG_PROFILING is not set
-# CONFIG_MARKERS is not set
-CONFIG_HAVE_OPROFILE=y
-# CONFIG_KPROBES is not set
-CONFIG_HAVE_KPROBES=y
-CONFIG_HAVE_KRETPROBES=y
-CONFIG_HAVE_GENERIC_DMA_COHERENT=y
-CONFIG_SLABINFO=y
-CONFIG_RT_MUTEXES=y
-# CONFIG_TINY_SHMEM is not set
-CONFIG_BASE_SMALL=0
-CONFIG_MODULES=y
-# CONFIG_MODULE_FORCE_LOAD is not set
-CONFIG_MODULE_UNLOAD=y
-# CONFIG_MODULE_FORCE_UNLOAD is not set
-# CONFIG_MODVERSIONS is not set
-# CONFIG_MODULE_SRCVERSION_ALL is not set
-CONFIG_KMOD=y
-CONFIG_BLOCK=y
-# CONFIG_LBD is not set
-# CONFIG_BLK_DEV_IO_TRACE is not set
-# CONFIG_LSF is not set
-# CONFIG_BLK_DEV_BSG is not set
-# CONFIG_BLK_DEV_INTEGRITY is not set
-
-#
-# IO Schedulers
-#
-CONFIG_IOSCHED_NOOP=y
-CONFIG_IOSCHED_AS=y
-CONFIG_IOSCHED_DEADLINE=y
-CONFIG_IOSCHED_CFQ=y
-# CONFIG_DEFAULT_AS is not set
-# CONFIG_DEFAULT_DEADLINE is not set
-CONFIG_DEFAULT_CFQ=y
-# CONFIG_DEFAULT_NOOP is not set
-CONFIG_DEFAULT_IOSCHED="cfq"
-CONFIG_CLASSIC_RCU=y
-CONFIG_FREEZER=y
-
-#
-# System Type
-#
-CONFIG_ARCH_ASPEED=y
-# CONFIG_ARCH_AAEC2000 is not set
-# CONFIG_ARCH_INTEGRATOR is not set
-# CONFIG_ARCH_REALVIEW is not set
-# CONFIG_ARCH_VERSATILE is not set
-# CONFIG_ARCH_AT91 is not set
-# CONFIG_ARCH_CLPS7500 is not set
-# CONFIG_ARCH_CLPS711X is not set
-# CONFIG_ARCH_EBSA110 is not set
-# CONFIG_ARCH_EP93XX is not set
-# CONFIG_ARCH_FOOTBRIDGE is not set
-# CONFIG_ARCH_NETX is not set
-# CONFIG_ARCH_H720X is not set
-# CONFIG_ARCH_IMX is not set
-# CONFIG_ARCH_IOP13XX is not set
-# CONFIG_ARCH_IOP32X is not set
-# CONFIG_ARCH_IOP33X is not set
-# CONFIG_ARCH_IXP23XX is not set
-# CONFIG_ARCH_IXP2000 is not set
-# CONFIG_ARCH_IXP4XX is not set
-# CONFIG_ARCH_L7200 is not set
-# CONFIG_ARCH_KIRKWOOD is not set
-# CONFIG_ARCH_KS8695 is not set
-# CONFIG_ARCH_NS9XXX is not set
-# CONFIG_ARCH_LOKI is not set
-# CONFIG_ARCH_MV78XX0 is not set
-# CONFIG_ARCH_MXC is not set
-# CONFIG_ARCH_ORION5X is not set
-# CONFIG_ARCH_PNX4008 is not set
-# CONFIG_ARCH_PXA is not set
-# CONFIG_ARCH_RPC is not set
-# CONFIG_ARCH_SA1100 is not set
-# CONFIG_ARCH_S3C2410 is not set
-# CONFIG_ARCH_SHARK is not set
-# CONFIG_ARCH_LH7A40X is not set
-# CONFIG_ARCH_DAVINCI is not set
-# CONFIG_ARCH_OMAP is not set
-# CONFIG_ARCH_MSM is not set
-CONFIG_IRMP=y
-# CONFIG_PCEXT is not set
-# CONFIG_REMOTEFX is not set
-# CONFIG_ARCH_AST1100 is not set
-# CONFIG_ARCH_AST2100 is not set
-# CONFIG_ARCH_AST2200 is not set
-# CONFIG_ARCH_AST2300 is not set
-CONFIG_ARCH_AST2400=y
-# CONFIG_ARCH_AST2500 is not set
-
-#
-# FLASH Chip Select
-#
-# CONFIG_AST_CS0_NOR is not set
-# CONFIG_AST_CS0_NAND is not set
-CONFIG_AST_CS0_SPI=y
-# CONFIG_AST_CS0_NONE is not set
-# CONFIG_AST_CS1_NOR is not set
-# CONFIG_AST_CS1_NAND is not set
-# CONFIG_AST_CS1_SPI is not set
-CONFIG_AST_CS1_NONE=y
-# CONFIG_AST_CS2_NOR is not set
-# CONFIG_AST_CS2_NAND is not set
-# CONFIG_AST_CS2_SPI is not set
-CONFIG_AST_CS2_NONE=y
-# CONFIG_AST_CS3_NOR is not set
-# CONFIG_AST_CS3_NAND is not set
-# CONFIG_AST_CS3_SPI is not set
-CONFIG_AST_CS3_NONE=y
-# CONFIG_AST_CS4_NOR is not set
-# CONFIG_AST_CS4_NAND is not set
-# CONFIG_AST_CS4_SPI is not set
-CONFIG_AST_CS4_NONE=y
-# CONFIG_ARCH_AST1070 is not set
-# CONFIG_AST_SCU_LOCK is not set
-# CONFIG_WEDGE is not set
-CONFIG_WEDGE100=y
-# CONFIG_YOSEMITE is not set
-
-#
-# Boot options
-#
-
-#
-# Power management
-#
-CONFIG_PLAT_ASPEED=y
-
-#
-# Processor Type
-#
-CONFIG_CPU_32=y
-CONFIG_CPU_ARM926T=y
-CONFIG_CPU_32v5=y
-CONFIG_CPU_ABRT_EV5TJ=y
-CONFIG_CPU_PABRT_NOIFAR=y
-CONFIG_CPU_CACHE_VIVT=y
-CONFIG_CPU_COPY_V4WB=y
-CONFIG_CPU_TLB_V4WBI=y
-CONFIG_CPU_CP15=y
-CONFIG_CPU_CP15_MMU=y
-
-#
-# Processor Features
-#
-CONFIG_ARM_THUMB=y
-# CONFIG_CPU_ICACHE_DISABLE is not set
-# CONFIG_CPU_DCACHE_DISABLE is not set
-# CONFIG_CPU_DCACHE_WRITETHROUGH is not set
-# CONFIG_CPU_CACHE_ROUND_ROBIN is not set
-# CONFIG_OUTER_CACHE is not set
-
-#
-# Bus support
-#
-CONFIG_ARM_AMBA=y
-# CONFIG_PCI_SYSCALL is not set
-# CONFIG_ARCH_SUPPORTS_MSI is not set
-# CONFIG_PCCARD is not set
-
-#
-# Kernel Features
-#
-CONFIG_TICK_ONESHOT=y
-CONFIG_NO_HZ=y
-CONFIG_HIGH_RES_TIMERS=y
-CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
-CONFIG_VMSPLIT_3G=y
-# CONFIG_VMSPLIT_2G is not set
-# CONFIG_VMSPLIT_1G is not set
-CONFIG_PAGE_OFFSET=0xC0000000
-# CONFIG_PREEMPT is not set
-CONFIG_HZ=100
-CONFIG_AEABI=y
-CONFIG_OABI_COMPAT=y
-CONFIG_ARCH_FLATMEM_HAS_HOLES=y
-# CONFIG_ARCH_SPARSEMEM_DEFAULT is not set
-# CONFIG_ARCH_SELECT_MEMORY_MODEL is not set
-CONFIG_SELECT_MEMORY_MODEL=y
-CONFIG_FLATMEM_MANUAL=y
-# CONFIG_DISCONTIGMEM_MANUAL is not set
-# CONFIG_SPARSEMEM_MANUAL is not set
-CONFIG_FLATMEM=y
-CONFIG_FLAT_NODE_MEM_MAP=y
-CONFIG_PAGEFLAGS_EXTENDED=y
-CONFIG_SPLIT_PTLOCK_CPUS=4096
-# CONFIG_RESOURCES_64BIT is not set
-# CONFIG_PHYS_ADDR_T_64BIT is not set
-CONFIG_ZONE_DMA_FLAG=0
-CONFIG_VIRT_TO_BUS=y
-CONFIG_UNEVICTABLE_LRU=y
-CONFIG_ALIGNMENT_TRAP=y
-
-#
-# Boot options
-#
-CONFIG_ZBOOT_ROM_TEXT=0
-CONFIG_ZBOOT_ROM_BSS=0
-CONFIG_CMDLINE=""
-# CONFIG_XIP_KERNEL is not set
-# CONFIG_KEXEC is not set
-
-#
-# CPU Power Management
-#
-# CONFIG_CPU_IDLE is not set
-
-#
-# Floating point emulation
-#
-
-#
-# At least one emulation must be selected
-#
-CONFIG_FPE_NWFPE=y
-CONFIG_FPE_NWFPE_XP=y
-# CONFIG_FPE_FASTFPE is not set
-CONFIG_VFP=y
-
-#
-# Userspace binary formats
-#
-CONFIG_BINFMT_ELF=y
-# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
-CONFIG_HAVE_AOUT=y
-CONFIG_BINFMT_AOUT=y
-# CONFIG_BINFMT_MISC is not set
-
-#
-# Power management options
-#
-CONFIG_PM=y
-# CONFIG_PM_DEBUG is not set
-CONFIG_PM_SLEEP=y
-CONFIG_SUSPEND=y
-CONFIG_SUSPEND_FREEZER=y
-# CONFIG_APM_EMULATION is not set
-CONFIG_ARCH_SUSPEND_POSSIBLE=y
-CONFIG_NET=y
-
-#
-# Networking options
-#
-CONFIG_PACKET=y
-# CONFIG_PACKET_MMAP is not set
-CONFIG_UNIX=y
-CONFIG_XFRM=y
-# CONFIG_XFRM_USER is not set
-# CONFIG_XFRM_SUB_POLICY is not set
-# CONFIG_XFRM_MIGRATE is not set
-# CONFIG_XFRM_STATISTICS is not set
-# CONFIG_NET_KEY is not set
-CONFIG_INET=y
-CONFIG_IP_MULTICAST=y
-# CONFIG_IP_ADVANCED_ROUTER is not set
-CONFIG_IP_FIB_HASH=y
-CONFIG_IP_PNP=y
-CONFIG_IP_PNP_DHCP=y
-CONFIG_IP_PNP_BOOTP=y
-# CONFIG_IP_PNP_RARP is not set
-# CONFIG_NET_IPIP is not set
-# CONFIG_NET_IPGRE is not set
-# CONFIG_IP_MROUTE is not set
-# CONFIG_ARPD is not set
-# CONFIG_SYN_COOKIES is not set
-# CONFIG_INET_AH is not set
-# CONFIG_INET_ESP is not set
-# CONFIG_INET_IPCOMP is not set
-# CONFIG_INET_XFRM_TUNNEL is not set
-CONFIG_INET_TUNNEL=m
-CONFIG_INET_XFRM_MODE_TRANSPORT=y
-CONFIG_INET_XFRM_MODE_TUNNEL=y
-CONFIG_INET_XFRM_MODE_BEET=y
-# CONFIG_INET_LRO is not set
-CONFIG_INET_DIAG=y
-CONFIG_INET_TCP_DIAG=y
-# CONFIG_TCP_CONG_ADVANCED is not set
-CONFIG_TCP_CONG_CUBIC=y
-CONFIG_DEFAULT_TCP_CONG="cubic"
-# CONFIG_TCP_MD5SIG is not set
-CONFIG_IPV6=m
-# CONFIG_IPV6_PRIVACY is not set
-# CONFIG_IPV6_ROUTER_PREF is not set
-# CONFIG_IPV6_OPTIMISTIC_DAD is not set
-# CONFIG_INET6_AH is not set
-# CONFIG_INET6_ESP is not set
-# CONFIG_INET6_IPCOMP is not set
-# CONFIG_IPV6_MIP6 is not set
-# CONFIG_INET6_XFRM_TUNNEL is not set
-# CONFIG_INET6_TUNNEL is not set
-CONFIG_INET6_XFRM_MODE_TRANSPORT=m
-CONFIG_INET6_XFRM_MODE_TUNNEL=m
-CONFIG_INET6_XFRM_MODE_BEET=m
-# CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION is not set
-CONFIG_IPV6_SIT=m
-CONFIG_IPV6_NDISC_NODETYPE=y
-# CONFIG_IPV6_TUNNEL is not set
-# CONFIG_IPV6_MULTIPLE_TABLES is not set
-# CONFIG_IPV6_MROUTE is not set
-# CONFIG_NETWORK_SECMARK is not set
-# CONFIG_NETFILTER is not set
-# CONFIG_IP_DCCP is not set
-# CONFIG_IP_SCTP is not set
-# CONFIG_TIPC is not set
-# CONFIG_ATM is not set
-# CONFIG_BRIDGE is not set
-# CONFIG_NET_DSA is not set
-CONFIG_VLAN_8021Q=m
-# CONFIG_VLAN_8021Q_GVRP is not set
-# CONFIG_DECNET is not set
-# CONFIG_LLC2 is not set
-# CONFIG_IPX is not set
-# CONFIG_ATALK is not set
-# CONFIG_X25 is not set
-# CONFIG_LAPB is not set
-# CONFIG_ECONET is not set
-CONFIG_WAN_ROUTER=y
-# CONFIG_NET_SCHED is not set
-
-#
-# Network testing
-#
-# CONFIG_NET_PKTGEN is not set
-# CONFIG_HAMRADIO is not set
-# CONFIG_CAN is not set
-# CONFIG_IRDA is not set
-# CONFIG_BT is not set
-# CONFIG_AF_RXRPC is not set
-# CONFIG_PHONET is not set
-# CONFIG_WIRELESS is not set
-# CONFIG_RFKILL is not set
-# CONFIG_NET_9P is not set
-
-#
-# Device Drivers
-#
-
-#
-# Generic Driver Options
-#
-CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
-CONFIG_STANDALONE=y
-CONFIG_PREVENT_FIRMWARE_BUILD=y
-CONFIG_FW_LOADER=y
-CONFIG_FIRMWARE_IN_KERNEL=y
-CONFIG_EXTRA_FIRMWARE=""
-# CONFIG_SYS_HYPERVISOR is not set
-CONFIG_CONNECTOR=y
-CONFIG_PROC_EVENTS=y
-CONFIG_MTD=y
-# CONFIG_MTD_DEBUG is not set
-CONFIG_MTD_CONCAT=y
-CONFIG_MTD_PARTITIONS=y
-# CONFIG_MTD_REDBOOT_PARTS is not set
-CONFIG_MTD_CMDLINE_PARTS=y
-# CONFIG_MTD_AFS_PARTS is not set
-# CONFIG_MTD_AR7_PARTS is not set
-
-#
-# User Modules And Translation Layers
-#
-CONFIG_MTD_CHAR=y
-CONFIG_MTD_BLKDEVS=y
-CONFIG_MTD_BLOCK=y
-# CONFIG_FTL is not set
-# CONFIG_NFTL is not set
-# CONFIG_INFTL is not set
-# CONFIG_RFD_FTL is not set
-# CONFIG_SSFDC is not set
-# CONFIG_MTD_OOPS is not set
-
-#
-# RAM/ROM/Flash chip drivers
-#
-# CONFIG_MTD_CFI is not set
-# CONFIG_MTD_JEDECPROBE is not set
-CONFIG_MTD_MAP_BANK_WIDTH_1=y
-CONFIG_MTD_MAP_BANK_WIDTH_2=y
-CONFIG_MTD_MAP_BANK_WIDTH_4=y
-# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
-# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
-# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
-CONFIG_MTD_CFI_I1=y
-CONFIG_MTD_CFI_I2=y
-# CONFIG_MTD_CFI_I4 is not set
-# CONFIG_MTD_CFI_I8 is not set
-# CONFIG_MTD_RAM is not set
-# CONFIG_MTD_ROM is not set
-# CONFIG_MTD_ABSENT is not set
-
-#
-# Mapping drivers for chip access
-#
-# CONFIG_MTD_COMPLEX_MAPPINGS is not set
-# CONFIG_MTD_PLATRAM is not set
-
-#
-# Self-contained MTD device drivers
-#
-CONFIG_MTD_DATAFLASH=m
-CONFIG_MTD_DATAFLASH_WRITE_VERIFY=y
-# CONFIG_MTD_DATAFLASH_OTP is not set
-CONFIG_MTD_M25P80=y
-CONFIG_M25PXX_USE_FAST_READ=y
-# CONFIG_MTD_SLRAM is not set
-# CONFIG_MTD_PHRAM is not set
-# CONFIG_MTD_MTDRAM is not set
-# CONFIG_MTD_BLOCK2MTD is not set
-
-#
-# Disk-On-Chip Device Drivers
-#
-# CONFIG_MTD_DOC2000 is not set
-# CONFIG_MTD_DOC2001 is not set
-# CONFIG_MTD_DOC2001PLUS is not set
-# CONFIG_MTD_NAND is not set
-# CONFIG_MTD_ONENAND is not set
-
-#
-# UBI - Unsorted block images
-#
-# CONFIG_MTD_UBI is not set
-# CONFIG_PARPORT is not set
-CONFIG_BLK_DEV=y
-# CONFIG_BLK_DEV_COW_COMMON is not set
-CONFIG_BLK_DEV_LOOP=y
-# CONFIG_BLK_DEV_CRYPTOLOOP is not set
-CONFIG_BLK_DEV_NBD=y
-# CONFIG_BLK_DEV_UB is not set
-CONFIG_BLK_DEV_RAM=y
-CONFIG_BLK_DEV_RAM_COUNT=16
-CONFIG_BLK_DEV_RAM_SIZE=16384
-# CONFIG_BLK_DEV_XIP is not set
-# CONFIG_RD_BZIP2 is not set
-CONFIG_RD_LZMA=y
-CONFIG_RD_GZIP=y
-# CONFIG_CDROM_PKTCDVD is not set
-# CONFIG_ATA_OVER_ETH is not set
-CONFIG_MISC_DEVICES=y
-# CONFIG_EEPROM_93CX6 is not set
-# CONFIG_ICS932S401 is not set
-# CONFIG_ENCLOSURE_SERVICES is not set
-# CONFIG_C2PORT is not set
-CONFIG_HAVE_IDE=y
-# CONFIG_IDE is not set
-
-#
-# SCSI device support
-#
-# CONFIG_RAID_ATTRS is not set
-CONFIG_SCSI=y
-CONFIG_SCSI_DMA=y
-CONFIG_SCSI_TGT=y
-# CONFIG_SCSI_NETLINK is not set
-CONFIG_SCSI_PROC_FS=y
-
-#
-# SCSI support type (disk, tape, CD-ROM)
-#
-CONFIG_BLK_DEV_SD=y
-# CONFIG_CHR_DEV_ST is not set
-# CONFIG_CHR_DEV_OSST is not set
-# CONFIG_BLK_DEV_SR is not set
-CONFIG_CHR_DEV_SG=y
-# CONFIG_CHR_DEV_SCH is not set
-
-#
-# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
-#
-# CONFIG_SCSI_MULTI_LUN is not set
-# CONFIG_SCSI_CONSTANTS is not set
-# CONFIG_SCSI_LOGGING is not set
-CONFIG_SCSI_SCAN_ASYNC=y
-CONFIG_SCSI_WAIT_SCAN=m
-
-#
-# SCSI Transports
-#
-# CONFIG_SCSI_SPI_ATTRS is not set
-# CONFIG_SCSI_FC_ATTRS is not set
-CONFIG_SCSI_ISCSI_ATTRS=m
-# CONFIG_SCSI_SAS_LIBSAS is not set
-# CONFIG_SCSI_SRP_ATTRS is not set
-# CONFIG_SCSI_LOWLEVEL is not set
-# CONFIG_SCSI_DH is not set
-# CONFIG_ATA is not set
-# CONFIG_MD is not set
-CONFIG_NETDEVICES=y
-# CONFIG_DUMMY is not set
-CONFIG_BONDING=m
-# CONFIG_MACVLAN is not set
-# CONFIG_EQUALIZER is not set
-CONFIG_TUN=m
-# CONFIG_VETH is not set
-# CONFIG_NET_ETHERNET is not set
-CONFIG_NETDEV_1000=y
-CONFIG_ASPEEDMAC=y
-# CONFIG_NETDEV_10000 is not set
-
-#
-# Wireless LAN
-#
-# CONFIG_WLAN_PRE80211 is not set
-# CONFIG_WLAN_80211 is not set
-# CONFIG_IWLWIFI_LEDS is not set
-
-#
-# USB Network Adapters
-#
-# CONFIG_USB_CATC is not set
-# CONFIG_USB_KAWETH is not set
-# CONFIG_USB_PEGASUS is not set
-# CONFIG_USB_RTL8150 is not set
-# CONFIG_USB_USBNET is not set
-# CONFIG_WAN is not set
-# CONFIG_PPP is not set
-# CONFIG_SLIP is not set
-# CONFIG_NETCONSOLE is not set
-# CONFIG_NETPOLL is not set
-# CONFIG_NET_POLL_CONTROLLER is not set
-# CONFIG_ISDN is not set
-
-#
-# Input device support
-#
-CONFIG_INPUT=y
-# CONFIG_INPUT_FF_MEMLESS is not set
-# CONFIG_INPUT_POLLDEV is not set
-
-#
-# Userland interfaces
-#
-CONFIG_INPUT_MOUSEDEV=y
-CONFIG_INPUT_MOUSEDEV_PSAUX=y
-CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
-CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
-# CONFIG_INPUT_JOYDEV is not set
-CONFIG_INPUT_EVDEV=y
-# CONFIG_INPUT_EVBUG is not set
-
-#
-# Input Device Drivers
-#
-CONFIG_INPUT_KEYBOARD=y
-CONFIG_KEYBOARD_ATKBD=y
-# CONFIG_KEYBOARD_SUNKBD is not set
-# CONFIG_KEYBOARD_LKKBD is not set
-# CONFIG_KEYBOARD_XTKBD is not set
-# CONFIG_KEYBOARD_NEWTON is not set
-# CONFIG_KEYBOARD_STOWAWAY is not set
-# CONFIG_KEYBOARD_GPIO is not set
-CONFIG_INPUT_MOUSE=y
-CONFIG_MOUSE_PS2=y
-CONFIG_MOUSE_PS2_ALPS=y
-CONFIG_MOUSE_PS2_LOGIPS2PP=y
-CONFIG_MOUSE_PS2_SYNAPTICS=y
-CONFIG_MOUSE_PS2_LIFEBOOK=y
-CONFIG_MOUSE_PS2_TRACKPOINT=y
-# CONFIG_MOUSE_PS2_ELANTECH is not set
-# CONFIG_MOUSE_PS2_TOUCHKIT is not set
-CONFIG_MOUSE_SERIAL=y
-# CONFIG_MOUSE_APPLETOUCH is not set
-# CONFIG_MOUSE_BCM5974 is not set
-# CONFIG_MOUSE_VSXXXAA is not set
-# CONFIG_MOUSE_GPIO is not set
-# CONFIG_INPUT_JOYSTICK is not set
-# CONFIG_INPUT_TABLET is not set
-# CONFIG_INPUT_TOUCHSCREEN is not set
-# CONFIG_INPUT_MISC is not set
-
-#
-# Hardware I/O ports
-#
-CONFIG_SERIO=y
-CONFIG_SERIO_SERPORT=y
-# CONFIG_SERIO_AMBAKMI is not set
-CONFIG_SERIO_LIBPS2=y
-# CONFIG_SERIO_RAW is not set
-# CONFIG_GAMEPORT is not set
-
-#
-# Character devices
-#
-CONFIG_VT=y
-CONFIG_CONSOLE_TRANSLATIONS=y
-CONFIG_VT_CONSOLE=y
-CONFIG_HW_CONSOLE=y
-# CONFIG_VT_HW_CONSOLE_BINDING is not set
-CONFIG_DEVKMEM=y
-CONFIG_SERIAL_NONSTANDARD=y
-# CONFIG_N_HDLC is not set
-# CONFIG_RISCOM8 is not set
-# CONFIG_SPECIALIX is not set
-# CONFIG_RIO is not set
-# CONFIG_STALDRV is not set
-
-#
-# Serial drivers
-#
-CONFIG_SERIAL_8250=y
-CONFIG_SERIAL_8250_CONSOLE=y
-CONFIG_SERIAL_8250_NR_UARTS=4
-CONFIG_SERIAL_8250_RUNTIME_UARTS=4
-# CONFIG_SERIAL_AST_DMA_UART is not set
-# CONFIG_SERIAL_8250_EXTENDED is not set
-
-#
-# Non-8250 serial port support
-#
-# CONFIG_SERIAL_AMBA_PL010 is not set
-# CONFIG_SERIAL_AMBA_PL011 is not set
-# CONFIG_SERIAL_AST is not set
-CONFIG_SERIAL_CORE=y
-CONFIG_SERIAL_CORE_CONSOLE=y
-CONFIG_UNIX98_PTYS=y
-CONFIG_LEGACY_PTYS=y
-CONFIG_LEGACY_PTY_COUNT=256
-# CONFIG_IPMI_HANDLER is not set
-CONFIG_AST_MISC=y
-# CONFIG_AST_VIDEO is not set
-# CONFIG_ADC_CAT9883 is not set
-# CONFIG_AST_SPI_BIOS is not set
-CONFIG_AST_PECI=y
-# CONFIG_AST_KCS is not set
-# CONFIG_AST_GPIO is not set
-# CONFIG_HW_RANDOM is not set
-CONFIG_NVRAM=y
-# CONFIG_R3964 is not set
-# CONFIG_RAW_DRIVER is not set
-# CONFIG_TCG_TPM is not set
-CONFIG_I2C=y
-CONFIG_I2C_BOARDINFO=y
-CONFIG_I2C_CHARDEV=y
-CONFIG_I2C_HELPER_AUTO=y
-
-#
-# I2C Hardware Bus support
-#
-
-#
-# I2C system bus drivers (mostly embedded / system-on-chip)
-#
-# CONFIG_I2C_GPIO is not set
-# CONFIG_I2C_OCORES is not set
-CONFIG_I2C_AST=y
-CONFIG_AST_I2C_SLAVE_MODE=y
-CONFIG_AST_I2C_SLAVE_EEPROM=y
-# CONFIG_AST_I2C_SLAVE_RDWR is not set
-# CONFIG_I2C_SIMTEC is not set
-
-#
-# External I2C/SMBus adapter drivers
-#
-# CONFIG_I2C_PARPORT_LIGHT is not set
-# CONFIG_I2C_TAOS_EVM is not set
-# CONFIG_I2C_TINY_USB is not set
-
-#
-# Other I2C/SMBus bus drivers
-#
-# CONFIG_I2C_PCA_PLATFORM is not set
-# CONFIG_I2C_STUB is not set
-
-#
-# Miscellaneous I2C Chip support
-#
-# CONFIG_DS1682 is not set
-CONFIG_AT24=m
-# CONFIG_SENSORS_EEPROM is not set
-CONFIG_SENSORS_PCF8574=m
-# CONFIG_PCF8575 is not set
-# CONFIG_SENSORS_PCA9539 is not set
-# CONFIG_SENSORS_PCF8591 is not set
-# CONFIG_TPS65010 is not set
-# CONFIG_SENSORS_MAX6875 is not set
-# CONFIG_SENSORS_TSL2550 is not set
-# CONFIG_I2C_DEBUG_CORE is not set
-# CONFIG_I2C_DEBUG_ALGO is not set
-# CONFIG_I2C_DEBUG_BUS is not set
-# CONFIG_I2C_DEBUG_CHIP is not set
-CONFIG_SPI=y
-CONFIG_SPI_MASTER=y
-
-#
-# SPI Master Controller Drivers
-#
-CONFIG_SPI_AST=y
-CONFIG_SPI_FMC=y
-CONFIG_SPI_BITBANG=y
-
-#
-# SPI Protocol Masters
-#
-CONFIG_SPI_AT25=m
-CONFIG_SPI_SPIDEV=m
-# CONFIG_SPI_TLE62X0 is not set
-CONFIG_ARCH_REQUIRE_GPIOLIB=y
-CONFIG_GPIOLIB=y
-CONFIG_GPIO_SYSFS=y
-
-#
-# Memory mapped GPIO expanders:
-#
-
-#
-# I2C GPIO expanders:
-#
-# CONFIG_GPIO_MAX732X is not set
-# CONFIG_GPIO_PCA953X is not set
-# CONFIG_GPIO_PCF857X is not set
-
-#
-# PCI GPIO expanders:
-#
-
-#
-# SPI GPIO expanders:
-#
-# CONFIG_GPIO_MAX7301 is not set
-# CONFIG_GPIO_MCP23S08 is not set
-# CONFIG_W1 is not set
-# CONFIG_POWER_SUPPLY is not set
-CONFIG_HWMON=y
-# CONFIG_HWMON_VID is not set
-# CONFIG_SENSORS_AD7414 is not set
-# CONFIG_SENSORS_AD7418 is not set
-# CONFIG_SENSORS_ADCXX is not set
-# CONFIG_SENSORS_ADM1021 is not set
-# CONFIG_SENSORS_ADM1025 is not set
-# CONFIG_SENSORS_ADM1026 is not set
-# CONFIG_SENSORS_ADM1029 is not set
-# CONFIG_SENSORS_ADM1031 is not set
-# CONFIG_SENSORS_ADM9240 is not set
-# CONFIG_SENSORS_ADT7462 is not set
-# CONFIG_SENSORS_ADT7470 is not set
-# CONFIG_SENSORS_ADT7473 is not set
-# CONFIG_SENSORS_ATXP1 is not set
-# CONFIG_SENSORS_DS1621 is not set
-# CONFIG_SENSORS_F71805F is not set
-# CONFIG_SENSORS_F71882FG is not set
-# CONFIG_SENSORS_F75375S is not set
-# CONFIG_SENSORS_GL518SM is not set
-# CONFIG_SENSORS_GL520SM is not set
-# CONFIG_SENSORS_IT87 is not set
-# CONFIG_SENSORS_LM63 is not set
-# CONFIG_SENSORS_LM70 is not set
-CONFIG_SENSORS_LM75=m
-# CONFIG_SENSORS_LM77 is not set
-# CONFIG_SENSORS_LM78 is not set
-# CONFIG_SENSORS_LM80 is not set
-# CONFIG_SENSORS_LM83 is not set
-# CONFIG_SENSORS_LM85 is not set
-# CONFIG_SENSORS_LM87 is not set
-# CONFIG_SENSORS_LM90 is not set
-# CONFIG_SENSORS_LM92 is not set
-# CONFIG_SENSORS_LM93 is not set
-CONFIG_SENSORS_MAX127=m
-# CONFIG_SENSORS_MAX1111 is not set
-# CONFIG_SENSORS_MAX1619 is not set
-# CONFIG_SENSORS_MAX6650 is not set
-# CONFIG_SENSORS_PC87360 is not set
-# CONFIG_SENSORS_PC87427 is not set
-# CONFIG_SENSORS_DME1737 is not set
-# CONFIG_SENSORS_SMSC47M1 is not set
-# CONFIG_SENSORS_SMSC47M192 is not set
-# CONFIG_SENSORS_SMSC47B397 is not set
-CONFIG_SENSORS_ADS7828=m
-# CONFIG_SENSORS_THMC50 is not set
-# CONFIG_SENSORS_VT1211 is not set
-# CONFIG_SENSORS_W83781D is not set
-# CONFIG_SENSORS_W83791D is not set
-# CONFIG_SENSORS_W83792D is not set
-# CONFIG_SENSORS_W83793 is not set
-# CONFIG_SENSORS_W83L785TS is not set
-# CONFIG_SENSORS_W83L786NG is not set
-# CONFIG_SENSORS_W83627HF is not set
-# CONFIG_SENSORS_W83627EHF is not set
-CONFIG_SENSORS_AST_ADC=m
-# CONFIG_SENSORS_AST_PWM_FAN is not set
-CONFIG_SENSORS_FB_PANTHER_PLUS=m
-CONFIG_PMBUS=m
-CONFIG_SENSORS_PMBUS=m
-CONFIG_SENSORS_ADM1275=m
-# CONFIG_SENSORS_LM25066 is not set
-# CONFIG_SENSORS_LTC2978 is not set
-# CONFIG_SENSORS_MAX16064 is not set
-# CONFIG_SENSORS_MAX34440 is not set
-# CONFIG_SENSORS_MAX8688 is not set
-CONFIG_SENSORS_PFE1100=m
-CONFIG_SENSORS_PFE3000=m
-# CONFIG_SENSORS_UCD9000 is not set
-# CONFIG_SENSORS_UCD9200 is not set
-# CONFIG_SENSORS_ZL6100 is not set
-# CONFIG_HWMON_DEBUG_CHIP is not set
-CONFIG_THERMAL=y
-CONFIG_THERMAL_HWMON=y
-CONFIG_WATCHDOG=y
-# CONFIG_WATCHDOG_NOWAYOUT is not set
-
-#
-# Watchdog Device Drivers
-#
-# CONFIG_SOFT_WATCHDOG is not set
-CONFIG_AST_WATCHDOG=y
-CONFIG_AST_WATCHDOG_REARM_DUAL_BOOT=y
-
-#
-# USB-based Watchdog Cards
-#
-# CONFIG_USBPCWATCHDOG is not set
-CONFIG_SSB_POSSIBLE=y
-
-#
-# Sonics Silicon Backplane
-#
-# CONFIG_SSB is not set
-
-#
-# Multifunction device drivers
-#
-# CONFIG_MFD_CORE is not set
-# CONFIG_MFD_SM501 is not set
-# CONFIG_MFD_ASIC3 is not set
-# CONFIG_HTC_EGPIO is not set
-# CONFIG_HTC_PASIC3 is not set
-# CONFIG_MFD_TMIO is not set
-# CONFIG_MFD_TC6393XB is not set
-# CONFIG_PMIC_DA903X is not set
-# CONFIG_MFD_WM8400 is not set
-# CONFIG_MFD_WM8350_I2C is not set
-
-#
-# Multimedia devices
-#
-
-#
-# Multimedia core support
-#
-# CONFIG_VIDEO_DEV is not set
-# CONFIG_DVB_CORE is not set
-# CONFIG_VIDEO_MEDIA is not set
-
-#
-# Multimedia drivers
-#
-# CONFIG_DAB is not set
-
-#
-# Graphics support
-#
-# CONFIG_VGASTATE is not set
-# CONFIG_VIDEO_OUTPUT_CONTROL is not set
-# CONFIG_FB is not set
-# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
-
-#
-# Display device support
-#
-# CONFIG_DISPLAY_SUPPORT is not set
-
-#
-# Console display driver support
-#
-# CONFIG_VGA_CONSOLE is not set
-CONFIG_DUMMY_CONSOLE=y
-# CONFIG_SOUND is not set
-# CONFIG_HID_SUPPORT is not set
-CONFIG_USB_SUPPORT=y
-CONFIG_USB_ARCH_HAS_HCD=y
-# CONFIG_USB_ARCH_HAS_OHCI is not set
-CONFIG_USB_ARCH_HAS_EHCI=y
-CONFIG_USB=m
-# CONFIG_USB_DEBUG is not set
-# CONFIG_USB_ANNOUNCE_NEW_DEVICES is not set
-
-#
-# Miscellaneous USB options
-#
-CONFIG_USB_DEVICEFS=y
-CONFIG_USB_DEVICE_CLASS=y
-# CONFIG_USB_DYNAMIC_MINORS is not set
-# CONFIG_USB_SUSPEND is not set
-# CONFIG_USB_OTG is not set
-# CONFIG_USB_MON is not set
-# CONFIG_USB_WUSB is not set
-# CONFIG_USB_WUSB_CBAF is not set
-
-#
-# USB Host Controller Drivers
-#
-# CONFIG_USB_C67X00_HCD is not set
-# CONFIG_USB_EHCI_HCD is not set
-# CONFIG_USB_ISP116X_HCD is not set
-# CONFIG_USB_SL811_HCD is not set
-# CONFIG_USB_R8A66597_HCD is not set
-# CONFIG_USB_HWA_HCD is not set
-
-#
-# AST USB Drivers
-#
-CONFIG_AST_USB_UHCI_HCD=m
-# CONFIG_AST_USB_UHCI_MULTIPORT_1 is not set
-# CONFIG_AST_USB_UHCI_MULTIPORT_2 is not set
-CONFIG_AST_USB_UHCI_MULTIPORT_4=y
-# CONFIG_USB_GADGET_MUSB_HDRC is not set
-
-#
-# USB Device Class drivers
-#
-# CONFIG_USB_ACM is not set
-# CONFIG_USB_PRINTER is not set
-# CONFIG_USB_WDM is not set
-# CONFIG_USB_TMC is not set
-
-#
-# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may also be needed;
-#
-
-#
-# see USB_STORAGE Help for more information
-#
-CONFIG_USB_STORAGE=m
-# CONFIG_USB_STORAGE_DEBUG is not set
-# CONFIG_USB_STORAGE_DATAFAB is not set
-# CONFIG_USB_STORAGE_FREECOM is not set
-# CONFIG_USB_STORAGE_ISD200 is not set
-# CONFIG_USB_STORAGE_DPCM is not set
-# CONFIG_USB_STORAGE_USBAT is not set
-# CONFIG_USB_STORAGE_SDDR09 is not set
-# CONFIG_USB_STORAGE_SDDR55 is not set
-# CONFIG_USB_STORAGE_JUMPSHOT is not set
-# CONFIG_USB_STORAGE_ALAUDA is not set
-# CONFIG_USB_STORAGE_ONETOUCH is not set
-# CONFIG_USB_STORAGE_KARMA is not set
-# CONFIG_USB_STORAGE_CYPRESS_ATACB is not set
-# CONFIG_USB_LIBUSUAL is not set
-
-#
-# USB Imaging devices
-#
-# CONFIG_USB_MDC800 is not set
-# CONFIG_USB_MICROTEK is not set
-
-#
-# USB port drivers
-#
-# CONFIG_USB_SERIAL is not set
-
-#
-# USB Miscellaneous drivers
-#
-# CONFIG_USB_EMI62 is not set
-# CONFIG_USB_EMI26 is not set
-# CONFIG_USB_ADUTUX is not set
-# CONFIG_USB_SEVSEG is not set
-# CONFIG_USB_RIO500 is not set
-# CONFIG_USB_LEGOTOWER is not set
-# CONFIG_USB_LCD is not set
-# CONFIG_USB_BERRY_CHARGE is not set
-# CONFIG_USB_LED is not set
-# CONFIG_USB_CYPRESS_CY7C63 is not set
-# CONFIG_USB_CYTHERM is not set
-# CONFIG_USB_PHIDGET is not set
-# CONFIG_USB_IDMOUSE is not set
-# CONFIG_USB_FTDI_ELAN is not set
-# CONFIG_USB_APPLEDISPLAY is not set
-# CONFIG_USB_LD is not set
-# CONFIG_USB_TRANCEVIBRATOR is not set
-# CONFIG_USB_IOWARRIOR is not set
-# CONFIG_USB_TEST is not set
-# CONFIG_USB_ISIGHTFW is not set
-# CONFIG_USB_VST is not set
-CONFIG_USB_GADGET=y
-# CONFIG_USB_GADGET_DEBUG_FILES is not set
-CONFIG_USB_GADGET_VBUS_DRAW=2
-CONFIG_USB_GADGET_SELECTED=y
-# CONFIG_USB_GADGET_AT91 is not set
-# CONFIG_USB_GADGET_ATMEL_USBA is not set
-# CONFIG_USB_GADGET_FSL_USB2 is not set
-# CONFIG_USB_GADGET_LH7A40X is not set
-# CONFIG_USB_GADGET_OMAP is not set
-# CONFIG_USB_GADGET_PXA25X is not set
-# CONFIG_USB_GADGET_PXA27X is not set
-# CONFIG_USB_GADGET_S3C2410 is not set
-# CONFIG_USB_GADGET_M66592 is not set
-# CONFIG_USB_GADGET_AMD5536UDC is not set
-# CONFIG_USB_GADGET_FSL_QE is not set
-# CONFIG_USB_GADGET_NET2280 is not set
-# CONFIG_USB_GADGET_GOKU is not set
-CONFIG_USB_GADGET_ASPEED_AST=y
-CONFIG_USB_ASPEED_AST=y
-# CONFIG_USB_GADGET_DUMMY_HCD is not set
-CONFIG_USB_GADGET_DUALSPEED=y
-CONFIG_USB_ZERO=m
-CONFIG_USB_ETH=m
-CONFIG_USB_ETH_RNDIS=y
-CONFIG_USB_GADGETFS=m
-CONFIG_USB_FILE_STORAGE=m
-# CONFIG_USB_FILE_STORAGE_TEST is not set
-CONFIG_USB_G_SERIAL=m
-# CONFIG_USB_MIDI_GADGET is not set
-# CONFIG_USB_G_PRINTER is not set
-CONFIG_USB_CDC_COMPOSITE=m
-# CONFIG_MMC is not set
-# CONFIG_MEMSTICK is not set
-# CONFIG_ACCESSIBILITY is not set
-# CONFIG_NEW_LEDS is not set
-CONFIG_RTC_LIB=y
-CONFIG_RTC_CLASS=y
-# CONFIG_RTC_HCTOSYS is not set
-# CONFIG_RTC_DEBUG is not set
-
-#
-# RTC interfaces
-#
-CONFIG_RTC_INTF_SYSFS=y
-CONFIG_RTC_INTF_PROC=y
-CONFIG_RTC_INTF_DEV=y
-# CONFIG_RTC_INTF_DEV_UIE_EMUL is not set
-# CONFIG_RTC_DRV_TEST is not set
-
-#
-# I2C RTC drivers
-#
-# CONFIG_RTC_DRV_DS1307 is not set
-# CONFIG_RTC_DRV_DS1374 is not set
-# CONFIG_RTC_DRV_DS1672 is not set
-# CONFIG_RTC_DRV_MAX6900 is not set
-# CONFIG_RTC_DRV_RS5C372 is not set
-# CONFIG_RTC_DRV_ISL1208 is not set
-# CONFIG_RTC_DRV_X1205 is not set
-# CONFIG_RTC_DRV_PCF8563 is not set
-# CONFIG_RTC_DRV_PCF8583 is not set
-# CONFIG_RTC_DRV_M41T80 is not set
-# CONFIG_RTC_DRV_S35390A is not set
-# CONFIG_RTC_DRV_FM3130 is not set
-# CONFIG_RTC_DRV_RX8581 is not set
-
-#
-# SPI RTC drivers
-#
-# CONFIG_RTC_DRV_M41T94 is not set
-# CONFIG_RTC_DRV_DS1305 is not set
-# CONFIG_RTC_DRV_DS1390 is not set
-# CONFIG_RTC_DRV_MAX6902 is not set
-# CONFIG_RTC_DRV_R9701 is not set
-# CONFIG_RTC_DRV_RS5C348 is not set
-# CONFIG_RTC_DRV_DS3234 is not set
-
-#
-# Platform RTC drivers
-#
-# CONFIG_RTC_DRV_CMOS is not set
-# CONFIG_RTC_DRV_DS1286 is not set
-# CONFIG_RTC_DRV_DS1511 is not set
-# CONFIG_RTC_DRV_DS1553 is not set
-# CONFIG_RTC_DRV_DS1742 is not set
-# CONFIG_RTC_DRV_STK17TA8 is not set
-# CONFIG_RTC_DRV_M48T86 is not set
-# CONFIG_RTC_DRV_M48T35 is not set
-# CONFIG_RTC_DRV_M48T59 is not set
-# CONFIG_RTC_DRV_BQ4802 is not set
-# CONFIG_RTC_DRV_V3020 is not set
-
-#
-# on-CPU RTC drivers
-#
-# CONFIG_RTC_DRV_PL030 is not set
-# CONFIG_RTC_DRV_PL031 is not set
-CONFIG_RTC_DRV_ASPEED=y
-# CONFIG_DMADEVICES is not set
-# CONFIG_REGULATOR is not set
-# CONFIG_UIO is not set
-
-#
-# File systems
-#
-CONFIG_EXT2_FS=y
-CONFIG_EXT2_FS_XATTR=y
-CONFIG_EXT2_FS_POSIX_ACL=y
-CONFIG_EXT2_FS_SECURITY=y
-# CONFIG_EXT2_FS_XIP is not set
-# CONFIG_EXT3_FS is not set
-# CONFIG_EXT4_FS is not set
-CONFIG_FS_MBCACHE=y
-# CONFIG_REISERFS_FS is not set
-# CONFIG_JFS_FS is not set
-CONFIG_FS_POSIX_ACL=y
-CONFIG_FILE_LOCKING=y
-# CONFIG_XFS_FS is not set
-# CONFIG_OCFS2_FS is not set
-CONFIG_DNOTIFY=y
-CONFIG_INOTIFY=y
-CONFIG_INOTIFY_USER=y
-# CONFIG_QUOTA is not set
-# CONFIG_AUTOFS_FS is not set
-# CONFIG_AUTOFS4_FS is not set
-# CONFIG_FUSE_FS is not set
-CONFIG_GENERIC_ACL=y
-
-#
-# CD-ROM/DVD Filesystems
-#
-# CONFIG_ISO9660_FS is not set
-# CONFIG_UDF_FS is not set
-
-#
-# DOS/FAT/NT Filesystems
-#
-CONFIG_FAT_FS=y
-CONFIG_MSDOS_FS=y
-CONFIG_VFAT_FS=y
-CONFIG_FAT_DEFAULT_CODEPAGE=437
-CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
-CONFIG_NTFS_FS=y
-# CONFIG_NTFS_DEBUG is not set
-CONFIG_NTFS_RW=y
-
-#
-# Pseudo filesystems
-#
-CONFIG_PROC_FS=y
-CONFIG_PROC_SYSCTL=y
-CONFIG_PROC_PAGE_MONITOR=y
-CONFIG_SYSFS=y
-CONFIG_TMPFS=y
-CONFIG_TMPFS_POSIX_ACL=y
-# CONFIG_HUGETLB_PAGE is not set
-CONFIG_CONFIGFS_FS=m
-
-#
-# Miscellaneous filesystems
-#
-# CONFIG_ADFS_FS is not set
-# CONFIG_AFFS_FS is not set
-# CONFIG_HFS_FS is not set
-# CONFIG_HFSPLUS_FS is not set
-# CONFIG_BEFS_FS is not set
-# CONFIG_BFS_FS is not set
-# CONFIG_EFS_FS is not set
-CONFIG_JFFS2_FS=y
-CONFIG_JFFS2_FS_DEBUG=0
-CONFIG_JFFS2_FS_WRITEBUFFER=y
-# CONFIG_JFFS2_FS_WBUF_VERIFY is not set
-# CONFIG_JFFS2_SUMMARY is not set
-# CONFIG_JFFS2_FS_XATTR is not set
-# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
-CONFIG_JFFS2_ZLIB=y
-# CONFIG_JFFS2_LZO is not set
-CONFIG_JFFS2_RTIME=y
-# CONFIG_JFFS2_RUBIN is not set
-# CONFIG_CRAMFS is not set
-# CONFIG_VXFS_FS is not set
-# CONFIG_MINIX_FS is not set
-# CONFIG_OMFS_FS is not set
-# CONFIG_HPFS_FS is not set
-# CONFIG_QNX4FS_FS is not set
-# CONFIG_ROMFS_FS is not set
-# CONFIG_SYSV_FS is not set
-# CONFIG_UFS_FS is not set
-CONFIG_NETWORK_FILESYSTEMS=y
-CONFIG_NFS_FS=y
-# CONFIG_NFS_V3 is not set
-# CONFIG_NFS_V4 is not set
-CONFIG_ROOT_NFS=y
-# CONFIG_NFSD is not set
-CONFIG_LOCKD=y
-CONFIG_NFS_COMMON=y
-CONFIG_SUNRPC=y
-# CONFIG_SUNRPC_REGISTER_V4 is not set
-# CONFIG_RPCSEC_GSS_KRB5 is not set
-# CONFIG_RPCSEC_GSS_SPKM3 is not set
-# CONFIG_SMB_FS is not set
-# CONFIG_CIFS is not set
-# CONFIG_NCP_FS is not set
-# CONFIG_CODA_FS is not set
-# CONFIG_AFS_FS is not set
-
-#
-# Partition Types
-#
-# CONFIG_PARTITION_ADVANCED is not set
-CONFIG_MSDOS_PARTITION=y
-CONFIG_NLS=y
-CONFIG_NLS_DEFAULT="utf8"
-CONFIG_NLS_CODEPAGE_437=y
-# CONFIG_NLS_CODEPAGE_737 is not set
-# CONFIG_NLS_CODEPAGE_775 is not set
-# CONFIG_NLS_CODEPAGE_850 is not set
-# CONFIG_NLS_CODEPAGE_852 is not set
-# CONFIG_NLS_CODEPAGE_855 is not set
-# CONFIG_NLS_CODEPAGE_857 is not set
-# CONFIG_NLS_CODEPAGE_860 is not set
-# CONFIG_NLS_CODEPAGE_861 is not set
-# CONFIG_NLS_CODEPAGE_862 is not set
-# CONFIG_NLS_CODEPAGE_863 is not set
-# CONFIG_NLS_CODEPAGE_864 is not set
-# CONFIG_NLS_CODEPAGE_865 is not set
-# CONFIG_NLS_CODEPAGE_866 is not set
-# CONFIG_NLS_CODEPAGE_869 is not set
-CONFIG_NLS_CODEPAGE_936=y
-CONFIG_NLS_CODEPAGE_950=y
-CONFIG_NLS_CODEPAGE_932=y
-# CONFIG_NLS_CODEPAGE_949 is not set
-# CONFIG_NLS_CODEPAGE_874 is not set
-# CONFIG_NLS_ISO8859_8 is not set
-# CONFIG_NLS_CODEPAGE_1250 is not set
-# CONFIG_NLS_CODEPAGE_1251 is not set
-CONFIG_NLS_ASCII=y
-CONFIG_NLS_ISO8859_1=y
-# CONFIG_NLS_ISO8859_2 is not set
-# CONFIG_NLS_ISO8859_3 is not set
-# CONFIG_NLS_ISO8859_4 is not set
-# CONFIG_NLS_ISO8859_5 is not set
-# CONFIG_NLS_ISO8859_6 is not set
-# CONFIG_NLS_ISO8859_7 is not set
-# CONFIG_NLS_ISO8859_9 is not set
-# CONFIG_NLS_ISO8859_13 is not set
-# CONFIG_NLS_ISO8859_14 is not set
-# CONFIG_NLS_ISO8859_15 is not set
-# CONFIG_NLS_KOI8_R is not set
-# CONFIG_NLS_KOI8_U is not set
-CONFIG_NLS_UTF8=y
-# CONFIG_DLM is not set
-
-#
-# Kernel hacking
-#
-# CONFIG_PRINTK_TIME is not set
-# CONFIG_ENABLE_WARN_DEPRECATED is not set
-CONFIG_ENABLE_MUST_CHECK=y
-CONFIG_FRAME_WARN=1024
-CONFIG_MAGIC_SYSRQ=y
-# CONFIG_UNUSED_SYMBOLS is not set
-# CONFIG_DEBUG_FS is not set
-# CONFIG_HEADERS_CHECK is not set
-# CONFIG_DEBUG_KERNEL is not set
-# CONFIG_SLUB_DEBUG_ON is not set
-# CONFIG_SLUB_STATS is not set
-CONFIG_DEBUG_BUGVERBOSE=y
-CONFIG_DEBUG_MEMORY_INIT=y
-CONFIG_FRAME_POINTER=y
-# CONFIG_RCU_CPU_STALL_DETECTOR is not set
-# CONFIG_LATENCYTOP is not set
-# CONFIG_SYSCTL_SYSCALL_CHECK is not set
-CONFIG_HAVE_FUNCTION_TRACER=y
-
-#
-# Tracers
-#
-# CONFIG_DYNAMIC_PRINTK_DEBUG is not set
-# CONFIG_SAMPLES is not set
-CONFIG_HAVE_ARCH_KGDB=y
-# CONFIG_DEBUG_USER is not set
-
-#
-# Security options
-#
-# CONFIG_KEYS is not set
-# CONFIG_SECURITY is not set
-# CONFIG_SECURITYFS is not set
-# CONFIG_SECURITY_FILE_CAPABILITIES is not set
-CONFIG_CRYPTO=y
-
-#
-# Crypto core or helper
-#
-# CONFIG_CRYPTO_FIPS is not set
-CONFIG_CRYPTO_ALGAPI=y
-CONFIG_CRYPTO_ALGAPI2=y
-CONFIG_CRYPTO_AEAD=m
-CONFIG_CRYPTO_AEAD2=y
-CONFIG_CRYPTO_BLKCIPHER=y
-CONFIG_CRYPTO_BLKCIPHER2=y
-CONFIG_CRYPTO_HASH=y
-CONFIG_CRYPTO_HASH2=y
-CONFIG_CRYPTO_RNG2=y
-CONFIG_CRYPTO_MANAGER=y
-CONFIG_CRYPTO_MANAGER2=y
-# CONFIG_CRYPTO_GF128MUL is not set
-CONFIG_CRYPTO_NULL=y
-# CONFIG_CRYPTO_CRYPTD is not set
-CONFIG_CRYPTO_AUTHENC=m
-# CONFIG_CRYPTO_TEST is not set
-
-#
-# Authenticated Encryption with Associated Data
-#
-# CONFIG_CRYPTO_CCM is not set
-# CONFIG_CRYPTO_GCM is not set
-# CONFIG_CRYPTO_SEQIV is not set
-
-#
-# Block modes
-#
-CONFIG_CRYPTO_CBC=y
-# CONFIG_CRYPTO_CTR is not set
-# CONFIG_CRYPTO_CTS is not set
-# CONFIG_CRYPTO_ECB is not set
-# CONFIG_CRYPTO_LRW is not set
-# CONFIG_CRYPTO_PCBC is not set
-# CONFIG_CRYPTO_XTS is not set
-
-#
-# Hash modes
-#
-CONFIG_CRYPTO_HMAC=y
-# CONFIG_CRYPTO_XCBC is not set
-
-#
-# Digest
-#
-# CONFIG_CRYPTO_CRC32C is not set
-# CONFIG_CRYPTO_MD4 is not set
-CONFIG_CRYPTO_MD5=y
-# CONFIG_CRYPTO_MICHAEL_MIC is not set
-# CONFIG_CRYPTO_RMD128 is not set
-# CONFIG_CRYPTO_RMD160 is not set
-# CONFIG_CRYPTO_RMD256 is not set
-# CONFIG_CRYPTO_RMD320 is not set
-CONFIG_CRYPTO_SHA1=y
-# CONFIG_CRYPTO_SHA256 is not set
-# CONFIG_CRYPTO_SHA512 is not set
-# CONFIG_CRYPTO_TGR192 is not set
-# CONFIG_CRYPTO_WP512 is not set
-
-#
-# Ciphers
-#
-# CONFIG_CRYPTO_AES is not set
-# CONFIG_CRYPTO_ANUBIS is not set
-# CONFIG_CRYPTO_ARC4 is not set
-# CONFIG_CRYPTO_BLOWFISH is not set
-# CONFIG_CRYPTO_CAMELLIA is not set
-# CONFIG_CRYPTO_CAST5 is not set
-# CONFIG_CRYPTO_CAST6 is not set
-CONFIG_CRYPTO_DES=y
-# CONFIG_CRYPTO_FCRYPT is not set
-# CONFIG_CRYPTO_KHAZAD is not set
-# CONFIG_CRYPTO_SALSA20 is not set
-# CONFIG_CRYPTO_SEED is not set
-# CONFIG_CRYPTO_SERPENT is not set
-# CONFIG_CRYPTO_TEA is not set
-# CONFIG_CRYPTO_TWOFISH is not set
-
-#
-# Compression
-#
-CONFIG_CRYPTO_DEFLATE=m
-# CONFIG_CRYPTO_LZO is not set
-
-#
-# Random Number Generation
-#
-# CONFIG_CRYPTO_ANSI_CPRNG is not set
-# CONFIG_CRYPTO_HW is not set
-
-#
-# Library routines
-#
-CONFIG_BITREVERSE=y
-# CONFIG_CRC_CCITT is not set
-# CONFIG_CRC16 is not set
-# CONFIG_CRC_T10DIF is not set
-CONFIG_CRC_ITU_T=m
-CONFIG_CRC32=y
-# CONFIG_CRC7 is not set
-# CONFIG_LIBCRC32C is not set
-CONFIG_ZLIB_INFLATE=y
-CONFIG_ZLIB_DEFLATE=y
-CONFIG_PLIST=y
-CONFIG_HAS_IOMEM=y
-CONFIG_HAS_IOPORT=y
-CONFIG_HAS_DMA=y
diff --git a/meta-facebook/meta-wedge100/recipes-kernel/linux/linux-aspeed_2.6%.bbappend b/meta-facebook/meta-wedge100/recipes-kernel/linux/linux-aspeed_2.6%.bbappend
deleted file mode 100644
index fd0302e..0000000
--- a/meta-facebook/meta-wedge100/recipes-kernel/linux/linux-aspeed_2.6%.bbappend
+++ /dev/null
@@ -1,8 +0,0 @@
-LINUX_VERSION_EXTENSION = "-wedge100"
-
-COMPATIBLE_MACHINE = "wedge100"
-
-FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
-
-SRC_URI += "file://defconfig \
- "
diff --git a/meta-facebook/meta-wedge100/recipes-utils/lm_sensors/files/wedge100.conf b/meta-facebook/meta-wedge100/recipes-utils/lm_sensors/files/wedge100.conf
deleted file mode 100644
index 770d343..0000000
--- a/meta-facebook/meta-wedge100/recipes-utils/lm_sensors/files/wedge100.conf
+++ /dev/null
@@ -1,78 +0,0 @@
-
-bus "i2c-3" "ast_i2c.3"
-
-bus "i2c-4" "ast_i2c.4"
-
-bus "i2c-8" "ast_i2c.8"
-
-chip "tmp75-i2c-3-48"
- label temp1 "Outlet Middle Temp"
- set temp1_max 70
- set temp1_max_hyst 60
-
-chip "tmp75-i2c-3-49"
- label temp1 "Inlet Middle Temp"
- set temp1_max 70
- set temp1_max_hyst 60
-
-chip "tmp75-i2c-3-4a"
- label temp1 "Inlet Left Temp"
- set temp1_max 70
- set temp1_max_hyst 60
-
-chip "tmp75-i2c-3-4b"
- label temp1 "Switch Temp"
- set temp1_max 70
- set temp1_max_hyst 60
-
-chip "tmp75-i2c-3-4c"
- label temp1 "Inlet Right Temp"
- set temp1_max 70
- set temp1_max_hyst 60
-
-chip "tmp75-i2c-8-48"
- label temp1 "Outlet Right Temp"
- set temp1_max 70
- set temp1_max_hyst 60
-
-chip "tmp75-i2c-8-49"
- label temp1 "Outlet Left Temp"
- set temp1_max 70
- set temp1_max_hyst 60
-
-chip "fancpld-i2c-8-33"
- label fan1 "Fan 1 front"
- label fan2 "Fan 1 rear"
- label fan3 "Fan 2 front"
- label fan4 "Fan 2 rear"
- label fan5 "Fan 3 front"
- label fan6 "Fan 3 rear"
- label fan7 "Fan 4 front"
- label fan8 "Fan 4 rear"
- label fan9 "Fan 5 front"
- label fan10 "Fan 5 rear"
-
-chip "fb_panther_plus-*"
- label temp1 "CPU Temp"
- label temp2 "DIMM0 Temp"
- ignore temp3
- ignore temp4
- ignore temp5
-
-chip "ast_adc-isa-0000"
- ignore in0
- ignore in1
- ignore in2
- ignore in3
- ignore in4
- label in5 "+1 Core Voltage"
- label in6 "+1 Analog Voltage"
- label in7 "+5 Voltage"
- label in8 "+3.3 Voltage"
- label in9 "+2.5 Voltage"
- ignore in10
- ignore in11
- ignore in12
- ignore in13
- ignore in14
- ignore in15
diff --git a/meta-facebook/meta-wedge100/recipes-utils/lm_sensors/lmsensors_%.bbappend b/meta-facebook/meta-wedge100/recipes-utils/lm_sensors/lmsensors_%.bbappend
deleted file mode 100644
index 23a3cc3..0000000
--- a/meta-facebook/meta-wedge100/recipes-utils/lm_sensors/lmsensors_%.bbappend
+++ /dev/null
@@ -1,10 +0,0 @@
-
-FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
-
-SRC_URI += "file://wedge100.conf \
- "
-
-do_install_board_config() {
- install -d ${D}${sysconfdir}/sensors.d
- install -m 644 ../wedge100.conf ${D}${sysconfdir}/sensors.d/wedge100.conf
-}
diff --git a/meta-facebook/meta-wedge100/recipes-utils/oob-nic/oob-nic_%.bbappend b/meta-facebook/meta-wedge100/recipes-utils/oob-nic/oob-nic_%.bbappend
deleted file mode 100644
index 6f46ea6..0000000
--- a/meta-facebook/meta-wedge100/recipes-utils/oob-nic/oob-nic_%.bbappend
+++ /dev/null
@@ -1,5 +0,0 @@
-# No OOB NIC on wedge100. Just copy the i2craw
-do_install() {
- install -d ${D}${sbindir}
- install -m 755 i2craw ${D}${sbindir}/i2craw
-}
diff --git a/meta-facebook/meta-wedge100/recipes-utils/openbmc-gpio/files/board_gpio_rev_table.py b/meta-facebook/meta-wedge100/recipes-utils/openbmc-gpio/files/board_gpio_rev_table.py
deleted file mode 100644
index 353944e..0000000
--- a/meta-facebook/meta-wedge100/recipes-utils/openbmc-gpio/files/board_gpio_rev_table.py
+++ /dev/null
@@ -1,33 +0,0 @@
-# Copyright 2015-present Facebook. All rights reserved.
-#
-# This program file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program in a file named COPYING; if not, write to the
-# Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor,
-# Boston, MA 02110-1301 USA
-from __future__ import absolute_import
-from __future__ import division
-from __future__ import print_function
-from __future__ import unicode_literals
-
-from openbmc_gpio_table import BoardGPIO
-
-# The fallowing table is generated using:
-# python wedge100_gpio_parser.py data/wedge100-BMC-gpio.csv
-# DO NOT MODIFY THE TABLE!!!
-# Manual modification will be overridden!!!
-
-board_gpio_rev_table = [
- BoardGPIO('GPIOY0', 'BOARD_REV_ID0'),
- BoardGPIO('GPIOY1', 'BOARD_REV_ID1'),
- BoardGPIO('GPIOY2', 'BOARD_REV_ID2'),
-]
diff --git a/meta-facebook/meta-wedge100/recipes-utils/openbmc-gpio/files/board_gpio_table_v1.py b/meta-facebook/meta-wedge100/recipes-utils/openbmc-gpio/files/board_gpio_table_v1.py
deleted file mode 100644
index d51bafb..0000000
--- a/meta-facebook/meta-wedge100/recipes-utils/openbmc-gpio/files/board_gpio_table_v1.py
+++ /dev/null
@@ -1,107 +0,0 @@
-# Copyright 2015-present Facebook. All rights reserved.
-#
-# This program file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program in a file named COPYING; if not, write to the
-# Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor,
-# Boston, MA 02110-1301 USA
-from __future__ import absolute_import
-from __future__ import division
-from __future__ import print_function
-from __future__ import unicode_literals
-
-from openbmc_gpio_table import BoardGPIO
-
-
-# The fallowing table is generated using:
-# python wedge100_gpio_parser.py data/wedge100-BMC-gpio.csv
-# DO NOT MODIFY THE TABLE!!!
-# Manual modification will be overridden!!!
-
-board_gpio_table_v1 = [
- BoardGPIO('GPIOB0', 'PANTHER_I2C_ALERT_N'),
- BoardGPIO('GPIOB1', 'MSERV_NIC_SMBUS_ALERT_N'),
- BoardGPIO('GPIOB2', 'DEBUG_PORT_UART_SEL_N'),
- BoardGPIO('GPIOB4', 'LED_POSTCODE_4'),
- BoardGPIO('GPIOB5', 'LED_POSTCODE_5'),
- BoardGPIO('GPIOB6', 'LED_POSTCODE_6'),
- BoardGPIO('GPIOB7', 'LED_POSTCODE_7'),
- BoardGPIO('GPIOC2', 'ISO_BUF_EN'),
- BoardGPIO('GPIOD0', 'BMC_PWR_BTN_IN_N'),
- BoardGPIO('GPIOD1', 'BMC_PWR_BTN_OUT_N'),
- BoardGPIO('GPIOD2', 'BMC_CPLD_RESET1'),
- BoardGPIO('GPIOD3', 'BMC_CPLD_RESET2'),
- BoardGPIO('GPIOD4', 'BMC_CPLD_RESET3'),
- BoardGPIO('GPIOD5', 'BMC_CPLD_RESET4'),
- BoardGPIO('GPIOD7', 'BMC_CPLD_QSFP_INT'),
- BoardGPIO('GPIOE0', 'DEBUG_UART_SEL_0'),
- BoardGPIO('GPIOE2', 'SWITCH_EEPROM1_WRT'),
- BoardGPIO('GPIOE4', 'ISO_MICROSRV_PRSNT_N'),
- BoardGPIO('GPIOE5', 'LED_PWR_BLUE'),
- BoardGPIO('GPIOF0', 'MSERVE_ISOBUF_EN'),
- BoardGPIO('GPIOF1', 'BMC_MAIN_RESET_N'),
- BoardGPIO('GPIOF2', 'CPLD_JTAG_SEL'),
- BoardGPIO('GPIOF4', 'MSERV_POWERUP'),
- BoardGPIO('GPIOF5', 'RCKMON_RS485_DE'),
- BoardGPIO('GPIOG0', 'LED_POSTCODE_0'),
- BoardGPIO('GPIOG1', 'LED_POSTCODE_1'),
- BoardGPIO('GPIOG2', 'LED_POSTCODE_2'),
- BoardGPIO('GPIOG3', 'LED_POSTCODE_3'),
- BoardGPIO('GPIOG4', 'BMC_WDTRST1'),
- BoardGPIO('GPIOG5', 'BMC_WDTRST2'),
- BoardGPIO('GPIOH3', 'QSFP_LED_POSITION'),
- BoardGPIO('GPIOH4', 'PM_SM_ALERT_N'),
- BoardGPIO('GPIOI4', 'BMC_EEPROM1_SPI_SS'),
- BoardGPIO('GPIOI5', 'BMC_EEPROM1_SPI_SCK'),
- BoardGPIO('GPIOI6', 'BMC_EEPROM1_SPI_MOSI'),
- BoardGPIO('GPIOI7', 'BMC_EEPROM1_SPI_MISO'),
- BoardGPIO('GPIOJ0', 'RCKMON_SPARE0'),
- BoardGPIO('GPIOJ1', 'RCKMON_SPARE1'),
- BoardGPIO('GPIOJ2', 'RCKMON_SPARE2'),
- BoardGPIO('GPIOJ3', 'RCKMON_SPARE3'),
- BoardGPIO('GPIOJ4', 'FANCARD_CPLD_TMS'),
- BoardGPIO('GPIOJ5', 'FANCARD_CPLD_TCK'),
- BoardGPIO('GPIOJ6', 'FANCARD_CPLD_TDI'),
- BoardGPIO('GPIOJ7', 'FANCARD_CPLD_TDO'),
- BoardGPIO('GPIOL5', 'BMC_UART_1_RTS'),
- BoardGPIO('GPIOM0', 'CPLD_UPD_EN'),
- BoardGPIO('GPIOM1', 'SMB_ALERT'),
- BoardGPIO('GPIOM3', 'TH_POWERUP'),
- BoardGPIO('GPIOM4', 'BMC_CPLD_TMS'),
- BoardGPIO('GPIOM5', 'BMC_CPLD_TDI'),
- BoardGPIO('GPIOM6', 'BMC_CPLD_TCK'),
- BoardGPIO('GPIOM7', 'BMC_CPLD_TDO'),
- BoardGPIO('GPIOO0', 'RCKMON_SPARE4'),
- BoardGPIO('GPIOO1', 'RCKMON_SPARE5'),
- BoardGPIO('GPIOO2', 'RCKMON_SPARE10'),
- BoardGPIO('GPIOO3', 'RCKMON_SPARE11'),
- BoardGPIO('GPIOO4', 'RCKMON_SPARE8'),
- BoardGPIO('GPIOO5', 'RCKMON_SPARE9'),
- BoardGPIO('GPIOO6', 'RCKMON_SPARE6'),
- BoardGPIO('GPIOO7', 'RCKMON_SPARE7'),
- BoardGPIO('GPIOP0', 'RMON1_PF'),
- BoardGPIO('GPIOP1', 'RMON1_RF'),
- BoardGPIO('GPIOP2', 'RMON2_PF'),
- BoardGPIO('GPIOP3', 'RMON2_RF'),
- BoardGPIO('GPIOP4', 'RMON3_PF'),
- BoardGPIO('GPIOP5', 'RMON3_RF'),
- BoardGPIO('GPIOP6', 'FANCARD_I2C_ALARM'),
- BoardGPIO('GPIOP7', 'BMC_READY_N'),
- BoardGPIO('GPIOQ4', 'BMC_CPLD_POWER_INT'),
- BoardGPIO('GPIOQ5', 'BMC_CPLD_SPARE7'),
- BoardGPIO('GPIOQ6', 'USB_OCS_N1'),
- BoardGPIO('GPIOQ7', 'BMC_HEARTBEAT_N'),
- BoardGPIO('GPIOR0', 'SPI_IBMC_BT_CS1_N_R'),
- BoardGPIO('GPIOR6', 'SWITCH_MDC'),
- BoardGPIO('GPIOR7', 'SWITCH_MDIO'),
- BoardGPIO('GPIOS0', 'BMC_SPI_WP_N'),
-]
diff --git a/meta-facebook/meta-wedge100/recipes-utils/openbmc-gpio/files/board_gpio_table_v2.py b/meta-facebook/meta-wedge100/recipes-utils/openbmc-gpio/files/board_gpio_table_v2.py
deleted file mode 100644
index a95ecf4..0000000
--- a/meta-facebook/meta-wedge100/recipes-utils/openbmc-gpio/files/board_gpio_table_v2.py
+++ /dev/null
@@ -1,118 +0,0 @@
-# Copyright 2015-present Facebook. All rights reserved.
-#
-# This program file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program in a file named COPYING; if not, write to the
-# Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor,
-# Boston, MA 02110-1301 USA
-from __future__ import absolute_import
-from __future__ import division
-from __future__ import print_function
-from __future__ import unicode_literals
-
-from openbmc_gpio_table import BoardGPIO
-
-
-# The fallowing table is generated using:
-# python wedge100_gpio_parser.py data/wedge100-BMC-gpio.csv
-# DO NOT MODIFY THE TABLE!!!
-# Manual modification will be overridden!!!
-
-board_gpio_table_v2 = [
- BoardGPIO('GPIOB0', 'PANTHER_I2C_ALERT_N'),
- BoardGPIO('GPIOB1', 'MSERV_NIC_SMBUS_ALERT_N'),
- BoardGPIO('GPIOB2', 'DEBUG_PORT_UART_SEL_N'),
- BoardGPIO('GPIOB5', 'LED_POSTCODE_5'),
- BoardGPIO('GPIOB6', 'LED_POSTCODE_6'),
- BoardGPIO('GPIOB7', 'LED_POSTCODE_7'),
- BoardGPIO('GPIOC2', 'ISO_BUF_EN'),
- BoardGPIO('GPIOD0', 'BMC_PWR_BTN_IN_N'),
- BoardGPIO('GPIOD1', 'BMC_PWR_BTN_OUT_N'),
- BoardGPIO('GPIOD2', 'BMC_CPLD_RESET1'),
- BoardGPIO('GPIOD3', 'BMC_CPLD_RESET2'),
- BoardGPIO('GPIOD4', 'BMC_CPLD_RESET3'),
- BoardGPIO('GPIOD5', 'BMC_CPLD_RESET4'),
- BoardGPIO('GPIOD7', 'BMC_CPLD_QSFP_INT'),
- BoardGPIO('GPIOE0', 'DEBUG_UART_SEL_0'),
- BoardGPIO('GPIOE2', 'SWITCH_EEPROM1_WRT'),
- BoardGPIO('GPIOE4', 'ISO_MICROSRV_PRSNT_N'),
- BoardGPIO('GPIOE5', 'LED_PWR_BLUE'),
- BoardGPIO('GPIOF0', 'MSERVE_ISOBUF_EN'),
- BoardGPIO('GPIOF1', 'BMC_MAIN_RESET_N'),
- BoardGPIO('GPIOF2', 'CPLD_JTAG_SEL'),
- BoardGPIO('GPIOF4', 'MSERV_POWERUP'),
- BoardGPIO('GPIOF5', 'BMC_UART_4_RTS'),
- BoardGPIO('GPIOG0', 'LED_POSTCODE_0'),
- BoardGPIO('GPIOG1', 'LED_POSTCODE_1'),
- BoardGPIO('GPIOG2', 'LED_POSTCODE_2'),
- BoardGPIO('GPIOG3', 'LED_POSTCODE_3'),
- BoardGPIO('GPIOG4', 'BMC_WDTRST1'),
- BoardGPIO('GPIOG5', 'BMC_WDTRST2'),
- BoardGPIO('GPIOG6', 'BMC_COM_NIC_ISOBUF_EN'),
- BoardGPIO('GPIOG7', 'BMC_COM_PANTHER_ISOBUF_EN'),
- BoardGPIO('GPIOH3', 'QSFP_LED_POSITION'),
- BoardGPIO('GPIOH4', 'PM_SM_ALERT_N'),
- BoardGPIO('GPIOI4', 'BMC_EEPROM1_SPI_SS'),
- BoardGPIO('GPIOI5', 'BMC_EEPROM1_SPI_SCK'),
- BoardGPIO('GPIOI6', 'BMC_EEPROM1_SPI_MOSI'),
- BoardGPIO('GPIOI7', 'BMC_EEPROM1_SPI_MISO'),
- BoardGPIO('GPIOJ0', 'RCKMON_SPARE0'),
- BoardGPIO('GPIOJ1', 'RCKMON_SPARE1'),
- BoardGPIO('GPIOJ2', 'RCKMON_SPARE2'),
- BoardGPIO('GPIOJ3', 'RCKMON_SPARE3'),
- BoardGPIO('GPIOJ4', 'FANCARD_CPLD_TMS'),
- BoardGPIO('GPIOJ5', 'FANCARD_CPLD_TCK'),
- BoardGPIO('GPIOJ6', 'FANCARD_CPLD_TDI'),
- BoardGPIO('GPIOJ7', 'FANCARD_CPLD_TDO'),
- BoardGPIO('GPIOL5', 'BMC_UART_1_RTS'),
- BoardGPIO('GPIOM0', 'CPLD_UPD_EN'),
- BoardGPIO('GPIOM1', 'SMB_ALERT'),
- BoardGPIO('GPIOM3', 'TH_POWERUP'),
- BoardGPIO('GPIOM4', 'BMC_CPLD_TMS'),
- BoardGPIO('GPIOM5', 'BMC_CPLD_TDI'),
- BoardGPIO('GPIOM6', 'BMC_CPLD_TCK'),
- BoardGPIO('GPIOM7', 'BMC_CPLD_TDO'),
- BoardGPIO('GPION0', 'ISO_COM_SUS_S3_N'),
- BoardGPIO('GPION1', 'ISO_COM_SUS_S4_N'),
- BoardGPIO('GPION2', 'ISO_COM_SUS_S5_N'),
- BoardGPIO('GPION3', 'ISO_COM_SUS_STAT_N'),
- BoardGPIO('GPION4', 'ISO_COM_BRG_WDT'),
- BoardGPIO('GPION5', 'BRG_COM_BIOS_DIS0_N'),
- BoardGPIO('GPION6', 'BRG_COM_BIOS_DIS1_N'),
- BoardGPIO('GPION7', 'ISO_COM_PWROK'),
- BoardGPIO('GPIOO0', 'COM_SPI_SEL'),
- BoardGPIO('GPIOO1', 'COM6_BUF_EN'),
- BoardGPIO('GPIOO2', 'RCKMON_SPARE4'),
- BoardGPIO('GPIOO3', 'RCKMON_SPARE5'),
- BoardGPIO('GPIOO4', 'TPM_SPI_SEL'),
- BoardGPIO('GPIOO5', 'TPM_SPI_BUF_EN'),
- BoardGPIO('GPIOO6', 'ISO_BRG_THRMTRIP_N'),
- BoardGPIO('GPIOO7', 'ISO_BRG_THRM_N'),
- BoardGPIO('GPIOP0', 'RMON1_PF'),
- BoardGPIO('GPIOP1', 'RMON1_RF'),
- BoardGPIO('GPIOP2', 'RMON2_PF'),
- BoardGPIO('GPIOP3', 'RMON2_RF'),
- BoardGPIO('GPIOP4', 'RMON3_PF'),
- BoardGPIO('GPIOP5', 'RMON3_RF'),
- BoardGPIO('GPIOP6', 'FANCARD_I2C_ALARM'),
- BoardGPIO('GPIOP7', 'BMC_READY_N'),
- BoardGPIO('GPIOQ4', 'BMC_CPLD_POWER_INT'),
- BoardGPIO('GPIOQ5', 'BMC_CPLD_SPARE7'),
- BoardGPIO('GPIOQ6', 'USB_OCS_N1'),
- BoardGPIO('GPIOQ7', 'BMC_HEARTBEAT_N'),
- BoardGPIO('GPIOR0', 'SPI_IBMC_BT_CS1_N_R'),
- BoardGPIO('GPIOR6', 'SWITCH_MDC'),
- BoardGPIO('GPIOR7', 'SWITCH_MDIO'),
- BoardGPIO('GPIOS0', 'BMC_SPI_WP_N'),
- BoardGPIO('GPIOY3', 'LED_POSTCODE_4'),
-]
-
diff --git a/meta-facebook/meta-wedge100/recipes-utils/openbmc-gpio/files/data/wedge100-BMC-GPIO-DVT.csv b/meta-facebook/meta-wedge100/recipes-utils/openbmc-gpio/files/data/wedge100-BMC-GPIO-DVT.csv
deleted file mode 100644
index 1ded15c..0000000
--- a/meta-facebook/meta-wedge100/recipes-utils/openbmc-gpio/files/data/wedge100-BMC-GPIO-DVT.csv
+++ /dev/null
@@ -1,104 +0,0 @@
-J21,GPIOB0_SALT1,In,PANTHER_I2C_ALERT_N,panther i2c alert_n
-J20,GPIOB1_SALT2,In,MSERV_NIC_SMBUS_ALERT_N,"micro server NIC SMBUS alert_n, active low"
-H18,GPIOB2_SALT3,In,DEBUG_PORT_UART_SEL_N,The DEBUG_PORT_UART_SEL_N is connected to a push button in the front panel. When Debug port select button in Front panel is pressed DEBUG_PORT_UART_SEL_N becomes low.
-E19,GPIOB4_LPCRST_N,Out,LPC_RST_N,Signal to reset LPC
-H19,GPIOB5_LPCPD_N_LPCSMI_N,Out,LED_POSTCODE_5,LED 7-segment code bit-5 for facebook debug header
-H20,GPIOB6_LPCPME_N,Out,LED_POSTCODE_6,LED 7-segment code bit-6 for facebook debug header
-E18,GPIOB7_EXTRST_N_SPICS1_N,Out,LED_POSTCODE_7,LED 7-segment code bit-7 for facebook debug header
-A2,GPIOC2_SD1DAT0_SCL11,Out,ISO_BUF_EN,"reserved for ISO_BUFFER control, in default serial resister is depop, use CPLD to control"
-A18,GPIOD0_SD2CLK,,BMC_PWR_BTN_IN_N,to emulate Microserver power button function using BMC
-D16,GPIOD1_SD2CMD,,BMC_PWR_BTN_OUT_N,
-B17,GPIOD2_SD2DAT0,Out,BMC_CPLD_RESET1,Spare Reset signal connected to CPLD
-A17,GPIOD3_SD2DAT1,Out,BMC_CPLD_RESET2,Spare Reset signal connected to CPLD
-C16,GPIOD4_SD2DAT2,Out,BMC_CPLD_RESET3,Spare Reset signal connected to CPLD (USB_BRDG RST function moved to CPLD)
-B16,GPIOD5_SD2DAT3,Out,BMC_CPLD_RESET4,Spare Reset signal connected to CPLD
-E15,GPIOD7_SD2WP_N,In,BMC_CPLD_QSFP_INT,Intrerrupt from CPLD to BMC for any QSFP events (USB RESET function moved to CPLD)
-D15,GPIOE0_NCTS3,Out,DEBUG_UART_SEL_0,FB debug connector UART select 0: BMC uART 1: microserver UART
-B15,GPIOE2_NDSR3,out,SWITCH_EEPROM1_WRT,"0: BCM5387 SPI interface connect to SPI EEPROM
-1: BCM5387 SPI interface connect to BMC SPI EEPROM interface
-this bit is used as BCM5387 straping configuration too"
-E14,GPIOE4_NDTR3,in,ISO_MICROSRV_PRSNT_N,"0: Microserver is present in PCIe slot
-1: microserver is not present in PCIe slot"
-D14,GPIOE5_NRTS3,out,LED_PWR_BLUE,"Power LED blue will be ON when LED_PWR_BLUE is high.
-Power LED blue will be off when LED_PWR_BLUE is low"
-D18,GPIOF0_NCTS4,Out,MSERVE_ISOBUF_EN,To enable isolation buffer dedicated for microserver com port
-B19,GPIOF1_NDCD4_SIOPBI_N,Out,BMC_MAIN_RESET_N,BMC can request cpld to reset main power
-A20,GPIOF2_NDSR4_SIOPWRGD,Out,CPLD_JTAG_SEL,"SYSCPLD upgrade enable, 0: jtag header program, 1: BMC programming"
-B18,GPIOF4_NDTR4,Out,MSERV_POWERUP,To request cpld to turn on P12_uServer for microserver
-A19,GPIOF5_NRTS4_SIOSCI_N,Out,BMC_UART_4_RTS,BMC com port 4 rts to cpld
-E16,GPIOF6_TXD4,In,BMC_UART_4_TX,BMC com port to cpld
-C17,GPIOF7_RXD4,Out,BMC_UART_4_RX,BMC com port to cpld
-A14,GPIOG0_SGPSCK,Out,LED_POSTCODE_0,LED 7-segment code bit-0 for facebook debug header
-E13,GPIOG1_SGPSLD,Out,LED_POSTCODE_1,LED 7-segment code bit-1 for facebook debug header
-D13,GPIOG2_SGPSI0,Out,LED_POSTCODE_2,LED 7-segment code bit-2 for facebook debug header
-C13,GPIOG3_SGPSI1,Out,LED_POSTCODE_3,LED 7-segment code bit-3 for facebook debug header
-B13,GPIOG4_WDTRST1_OSCCLK,Out,BMC_WDTRST1,Watch dog timer reset1 output from BMC to CPLD
-Y21,GPIOG5_WDTRST2_USBCKI,Out,BMC_WDTRST2,Watch dog timer reset2 output from BMC to CPLD
-AA22,GPIOG6_FLBUSY_N,Out,BMC_COM_NIC_ISOBUF_EN,Active low signal to enable the isolation buffer for SMBUS to COMe
-U18,GPIOG7_FLWP_N,Out,BMC_COM_PANTHER_ISOBUF_EN,Active low signal to enable the isolation buffer for I2C BUS to COMe
-A7,GPIOH3_ROMD11_NRI6,In,QSFP_LED_POSITION,QSFP position select input
-D7,GPIOH4_ROMD12_NDTR6,In,PM_SM_ALERT_N,SM bus alert from power manager (also connected to CPLD)
-C22,GPIOI0_SYSCS_N,Out,BMC_TPM_SPI_CS_N,BMC SPI interface to SPI based TPM
-G18,GPIOI1_SYSCK,Out,BMC_TPM_SPI_CLK,BMC SPI interface to SPI based TPM
-D19,GPIOI2_SYSDO,Out,BMC_TPM_SPI_MOSI,BMC SPI interface to SPI based TPM
-C20,GPIOI3_SYSDI,In,BMC_TPM_SPI_MISO,BMC SPI interface to SPI based TPM
-B22,GPIOI4_SPICS0_N_VBCS_N,Out,BMC_EEPROM1_SPI_SS,"BMC SPI EEPROM interface connect to BCM5387 switch if SWITCH_EEPRM1_WRT is 1, "
-G19,GPIOI5_SPICK_VBCK,Out,BMC_EEPROM1_SPI_SCK,
-C18,GPIOI6_SPIDO_VBDO,Out,BMC_EEPROM1_SPI_MOSI,
-E20,GPIOI7_SPIDI_VBDI,In,BMC_EEPROM1_SPI_MISO,
-J5,GPIOJ0_SGPMCK,Bi,RCKMON_SPARE0,Spare gpios to rack mon card
-J4,GPIOJ1_SGPMLD,Bi,RCKMON_SPARE1,Spare gpios to rack mon card
-K5,GPIOJ2_SGPMO,Bi,RCKMON_SPARE2,Spare gpios to rack mon card
-J3,GPIOJ3_SGPMI,Bi,RCKMON_SPARE3,Spare gpios to rack mon card
-T4,VGAHS_GPIOJ4,,FANCARD_CPLD_TMS,"fancard CPLD JTAG upgrade interface, BMC output to CPLD TMS"
-U2,VGAVS_GPIOJ5,,FANCARD_CPLD_TCK,"fancard CPLD JTAG upgrade interface, BMC output to CPLD TCK"
-T2,DDCCLK_GPIOJ6,,FANCARD_CPLD_TDI,"fancard CPLD JTAG upgrade interface, BMC output to CPLD TDI"
-T1,DDCDAT_GPIOJ7,,FANCARD_CPLD_TDO,"fancard CPLD JTAG upgrade interface, BMC input to CPLD TDO"
-V2,GPIOL5_NRTS1_VPICLK,Out,BMC_UART_1_RTS,connect to SYSCPLD
-W1,GPIOL6_TXD1_VPIB0,Out,BMC_UART_TX_1,connect to SYSCPLD
-U5,GPIOL7_RXD1_VPIB1,In,BMC_UART_RX_1,connect to SYSCPLD
-V3,GPIOM0_NCTS2_VPIB2,Out,CPLD_UPD_EN,"fan_card CPLD upgrade enable, 0: jtag header programming, 1: BMC programming"
-W2,GPIOM1_NDCD2_VPIB3,In,SMB_ALERT,"Alert signal from cpld representing Alert from the power supplies(Vcore,vanlg,3.3)"
-V4,GPIOM3_NRI2_VPIB5,out,TH_POWERUP,"tomahawk power up enable, active high. Connect to CPLD, cpld will control pwr1014a"
-W3,GPIOM4_NDTR2_VPIB6,out,BMC_CPLD_TMS,"SYSCPLD CPLD JTAG upgrade interface, BMC output to SYSCPLD TMS"
-Y2,GPIOM5_NRTS2_VPIB7,out,BMC_CPLD_TDI,"SYSCPLD CPLD JTAG upgrade interface, BMC output to SYSCPLD TDI"
-AA1,GPIOM6_TXD2_VPIB8,out,BMC_CPLD_TCK,"SYSCPLD CPLD JTAG upgrade interface, BMC output to SYSCPLD TCK"
-V5,GPIOM7_RXD2_VPIB9,In,BMC_CPLD_TDO,"SYSCPLD CPLD JTAG upgrade interface, BMC output to SYSCPLD TDO"
-W4,GPION0_PWM0_VPIG0,In,ISO_COM_SUS_S3_N,s3 sleep signal from com(COME Signal)
-Y3,GPION1_PWM1_VPIG1,In,ISO_COM_SUS_S4_N,s4 sleep signal from com (COME Signal)
-AA2,GPION2_PWM2_VPIG2,In,ISO_COM_SUS_S5_N,s5 sleep signal from com (COME Signal)
-AB1,GPION3_PWM3_VPIG3,In,ISO_COM_SUS_STAT_N,suspend status signal from com (COME Signal)
-W5,GPION4_PWM4_VPIG4,In,ISO_COM_BRG_WDT,watch dog timer output from com(COME Signal)
-Y4,GPION5_PWM5_VPIG5,Out,BRG_COM_BIOS_DIS0_N,BMC can select the bootdevice of COM (COME Signal)
-AA3,GPION6_PWM6_VPIG6,Out,BRG_COM_BIOS_DIS1_N,BMC can select the bootdevice of COM (COME Signal)
-AB2,GPION7_PWM7_VPIG7,Out,ISO_COM_PWROK,com power ok signal from BMC (COME Signal)
-V6,GPIOO0_TACH0_VPIG8,Out,COM_SPI_SEL,"override signal from bmc to select bmc to upgrade com eeprom
-0:On board spi flash
-1:BMC can write into SPI flash"
-Y5,GPIOO1_TACH1_VPIG9,Out,COM6_BUF_EN,Active low signal to enable isolation buffer dedicated for com signals
-AA4,GPIOO2_TACH2_VPIR0,BI,RCKMON_SPARE4,RCKMON_SPARE[0:11] connect to fan_ctrl_rmon card connector
-AB3,GPIOO3_TACH3_VPIR1,BI,RCKMON_SPARE5,RCKMON_SPARE[0:11] connect to fan_ctrl_rmon card connector
-W6,GPIOO4_TACH4_VPIR2,Out,TPM_SPI_SEL,Signal from BMC to select whether BMC or COM SPI should go to TPM module. By default COM SPI is Selected. BMC can drive this signal high to select SPI from BMC
-AA5,GPIOO5_TACH5_VPIR3,Out,TPM_SPI_BUF_EN,Signal from BMC to enable or disable the MUX which selects BMC or COM SPI to TPM module. Default the MUX is enabled .BMC can drive high to disable it.
-AB4,GPIOO6_TACH6_VPIR4,In,ISO_BRG_THRMTRIP_N,"Active low Signal from COM to indicate processor over heating ,and com will go into s5 state (COME Signal)"
-V7,GPIOO7_TACH7_VPIR5,Out,ISO_BRG_THRM_N,Active low Signal from BMC to indicate overtemperature (COME Signal)
-Y6,GPIOP0_TACH8_VPIR6,In,RMON1_PF,"rack 1 monitor status, Power Failure, active low"
-AB5,GPIOP1_TACH9_VPIR7,In,RMON1_RF,"rack 1 monitor status, redudancy Failure, active low"
-W7,GPIOP2_TACH10_VPIR8,In,RMON2_PF,"rack 2 monitor status, Power Failure, active low"
-AA6,GPIOP3_TACH11_VPIR9,In,RMON2_RF,"rack 2 monitor status, redudancy Failure, active low"
-AB6,GPIOP4_TACH12,In,RMON3_PF,"rack 3 monitor status, Power Failure, active low"
-Y7,GPIOP5_TACH13,In,RMON3_RF,"rack 3 monitor status, redudancy Failure, active low"
-AA7,GPIOP6_TACH14_BMCINT,In,FANCARD_I2C_ALARM,"fan card alarm input, active low"
-AB7,GPIOP7_TACH15_FLACK,out,BMC_READY_N,"0: BMC is ready for service. 1: BMC is not ready, or during initialization"
-H4,GPIOQ4_SCL14,In,BMC_CPLD_POWER_INT,Intrerrupt from CPLD to BMC for any Power events
-H3,GPIOQ5_SDA14,,BMC_CPLD_SPARE7,Spare GPIOs to CPLD
-H2,GPIOQ6,out,USB_OCS_N1,over-current sense output to USB2513 hub
-H1,GPIOQ7,out,BMC_HEARTBEAT_N,BMC heatbeat output to onboard heartbeat LED
-V20,GPIOR0_ROMCS1_N,out,SPI_IBMC_BT_CS1_N_R,chip select to secondary boot SPI flash
-C6,GPIOR6_MDC1,BI,SWITCH_MDC,MDC/MDIO to GE Switch
-A5,GPIOR7_MDIO1,BI,SWITCH_MDIO,
-U21,ROMD4_GPIOS0_VPODE,Out,BMC_SPI_WP_N,Write protect for Secondary Boot Flash. Connected to CPLD. CPLD will drive it to the flash chip
-C21,GPIOY0_SIOS3_N,In,BOARD_REV_ID0,"Board ID input bit0, resister straping, connect to both BMC and CPLD"
-F20,GPIOY1_SIOS5_N,In,BOARD_REV_ID1,"Board ID input bit1, resister straping, connect to both BMC and CPLD"
-G20,GPIOY2_SIOPWREQ_N,In,BOARD_REV_ID2,"Board ID input bit2, resister straping, connect to both BMC and CPLD"
-K20,GPIOY3_SIOONCTRL_N,,LED_POSTCODE_4,LED 7-segment code bit-4 for facebook debug header \ No newline at end of file
diff --git a/meta-facebook/meta-wedge100/recipes-utils/openbmc-gpio/files/data/wedge100-BMC-GPIO-EVT.csv b/meta-facebook/meta-wedge100/recipes-utils/openbmc-gpio/files/data/wedge100-BMC-GPIO-EVT.csv
deleted file mode 100644
index 781d739..0000000
--- a/meta-facebook/meta-wedge100/recipes-utils/openbmc-gpio/files/data/wedge100-BMC-GPIO-EVT.csv
+++ /dev/null
@@ -1,83 +0,0 @@
-J21,GPIOB0_SALT1,In,PANTHER_I2C_ALERT_N,panther i2c alert_n
-J20,GPIOB1_SALT2,In,MSERV_NIC_SMBUS_ALERT_N,"micro server NIC SMBUS alert_n, active low"
-H18,GPIOB2_SALT3,In,DEBUG_PORT_UART_SEL_N,The DEBUG_PORT_UART_SEL_N is connected to a push button in the front panel. When Debug port select button in Front panel is pressed DEBUG_PORT_UART_SEL_N becomes low.
-E19,GPIOB4_LPCRST_N,Out,LED_POSTCODE_4,LED 7-segment code bit-4 for facebook debug header
-H19,GPIOB5_LPCPD_N_LPCSMI_N,Out,LED_POSTCODE_5,LED 7-segment code bit-5 for facebook debug header
-H20,GPIOB6_LPCPME_N,Out,LED_POSTCODE_6,LED 7-segment code bit-6 for facebook debug header
-E18,GPIOB7_EXTRST_N_SPICS1_N,Out,LED_POSTCODE_7,LED 7-segment code bit-7 for facebook debug header
-A2,GPIOC2_SD1DAT0_SCL11,Out,ISO_BUF_EN,"reserved for ISO_BUFFER control, in default serial resister is depop, use CPLD to control"
-A18,GPIOD0_SD2CLK,,BMC_PWR_BTN_IN_N,to emulate Microserver power button function using BMC
-D16,GPIOD1_SD2CMD,,BMC_PWR_BTN_OUT_N,
-B17,GPIOD2_SD2DAT0,Out,BMC_CPLD_RESET1,Spare Reset signal connected to CPLD
-A17,GPIOD3_SD2DAT1,Out,BMC_CPLD_RESET2,Spare Reset signal connected to CPLD
-C16,GPIOD4_SD2DAT2,Out,BMC_CPLD_RESET3,Spare Reset signal connected to CPLD (USB_BRDG RST function moved to CPLD)
-B16,GPIOD5_SD2DAT3,Out,BMC_CPLD_RESET4,Spare Reset signal connected to CPLD
-E15,GPIOD7_SD2WP_N,In,BMC_CPLD_QSFP_INT,Intrerrupt from CPLD to BMC for any QSFP events (USB RESET function moved to CPLD)
-D15,GPIOE0_NCTS3,Out,DEBUG_UART_SEL_0,FB debug connector UART select 0: BMC uART 1: microserver UART
-B15,GPIOE2_NDSR3,out,SWITCH_EEPROM1_WRT,"0: BCM5387 SPI interface connect to SPI EEPROM
-1: BCM5387 SPI interface connect to BMC SPI EEPROM interface
-this bit is used as BCM5387 straping configuration too"
-E14,GPIOE4_NDTR3,in,ISO_MICROSRV_PRSNT_N,"0: Microserver is present in PCIe slot
-1: microserver is not present in PCIe slot"
-D14,GPIOE5_NRTS3,out,LED_PWR_BLUE,"Power LED blue will be ON when LED_PWR_BLUE is high.
-Power LED blue will be off when LED_PWR_BLUE is low"
-D18,GPIOF0_NCTS4,Out,MSERVE_ISOBUF_EN,To enable isolation buffer dedicated for microserver com port
-B19,GPIOF1_NDCD4_SIOPBI_N,Out,BMC_MAIN_RESET_N,BMC can request cpld to reset main power
-A20,GPIOF2_NDSR4_SIOPWRGD,Out,CPLD_JTAG_SEL,"SYSCPLD upgrade enable, 0: jtag header program, 1: BMC programming"
-B18,GPIOF4_NDTR4,Out,MSERV_POWERUP,To request cpld to turn on P12_uServer for microserver
-A19,GPIOF5_NRTS4,Out,RCKMON_RS485_DE,RS485 Drive Enable (TX/RX Toggle) pin for rackmon
-A14,GPIOG0_SGPSCK,Out,LED_POSTCODE_0,LED 7-segment code bit-0 for facebook debug header
-E13,GPIOG1_SGPSLD,Out,LED_POSTCODE_1,LED 7-segment code bit-1 for facebook debug header
-D13,GPIOG2_SGPSI0,Out,LED_POSTCODE_2,LED 7-segment code bit-2 for facebook debug header
-C13,GPIOG3_SGPSI1,Out,LED_POSTCODE_3,LED 7-segment code bit-3 for facebook debug header
-B13,GPIOG4_WDTRST1_OSCCLK,Out,BMC_WDTRST1,Watch dog timer reset1 output from BMC to CPLD
-Y21,GPIOG5_WDTRST2_USBCKI,Out,BMC_WDTRST2,Watch dog timer reset2 output from BMC to CPLD
-A7,GPIOH3_ROMD11_NRI6,In,QSFP_LED_POSITION,QSFP position select input
-D7,GPIOH4_ROMD12_NDTR6,In,PM_SM_ALERT_N,SM bus alert from power manager (also connected to CPLD)
-B22,GPIOI4_SPICS0_N_VBCS_N,Out,BMC_EEPROM1_SPI_SS,"BMC SPI EEPROM interface connect to BCM5387 switch if SWITCH_EEPRM1_WRT is 1, "
-G19,GPIOI5_SPICK_VBCK,Out,BMC_EEPROM1_SPI_SCK,
-C18,GPIOI6_SPIDO_VBDO,Out,BMC_EEPROM1_SPI_MOSI,
-E20,GPIOI7_SPIDI_VBDI,In,BMC_EEPROM1_SPI_MISO,
-J5,GPIOJ0_SGPMCK,Bi,RCKMON_SPARE0,Spare gpios to rack mon card
-J4,GPIOJ1_SGPMLD,Bi,RCKMON_SPARE1,Spare gpios to rack mon card
-K5,GPIOJ2_SGPMO,Bi,RCKMON_SPARE2,Spare gpios to rack mon card
-J3,GPIOJ3_SGPMI,Bi,RCKMON_SPARE3,Spare gpios to rack mon card
-T4,VGAHS_GPIOJ4,,FANCARD_CPLD_TMS,"fancard CPLD JTAG upgrade interface, BMC output to CPLD TMS"
-U2,VGAVS_GPIOJ5,,FANCARD_CPLD_TCK,"fancard CPLD JTAG upgrade interface, BMC output to CPLD TCK"
-T2,DDCCLK_GPIOJ6,,FANCARD_CPLD_TDI,"fancard CPLD JTAG upgrade interface, BMC output to CPLD TDI"
-T1,DDCDAT_GPIOJ7,,FANCARD_CPLD_TDO,"fancard CPLD JTAG upgrade interface, BMC input to CPLD TDO"
-V2,GPIOL5_NRTS1_VPICLK,Out,BMC_UART_1_RTS,connect to SYSCPLD
-V3,GPIOM0_NCTS2_VPIB2,Out,CPLD_UPD_EN,"fan_card CPLD upgrade enable, 0: jtag header programming, 1: BMC programming"
-W2,GPIOM1_NDCD2_VPIB3,In,SMB_ALERT,"Alert signal from cpld representing Alert from the power supplies(Vcore,vanlg,3.3)"
-V4,GPIOM3_NRI2_VPIB5,out,TH_POWERUP,"tomahawk power up enable, active high. Connect to CPLD, cpld will control pwr1014a"
-W3,GPIOM4_NDTR2_VPIB6,out,BMC_CPLD_TMS,"SYSCPLD CPLD JTAG upgrade interface, BMC output to SYSCPLD TMS"
-Y2,GPIOM5_NRTS2_VPIB7,out,BMC_CPLD_TDI,"SYSCPLD CPLD JTAG upgrade interface, BMC output to SYSCPLD TDI"
-AA1,GPIOM6_TXD2_VPIB8,out,BMC_CPLD_TCK,"SYSCPLD CPLD JTAG upgrade interface, BMC output to SYSCPLD TCK"
-V5,GPIOM7_RXD2_VPIB9,In,BMC_CPLD_TDO,"SYSCPLD CPLD JTAG upgrade interface, BMC output to SYSCPLD TDO"
-V6,GPIOO0_TACH0_VPIG8,BI,RCKMON_SPARE4,RCKMON_SPARE[0:11] connect to fan_ctrl_rmon card connector
-Y5,GPIOO1_TACH1_VPIG9,BI,RCKMON_SPARE5,RCKMON_SPARE[0:11] connect to fan_ctrl_rmon card connector
-AA4,GPIOO2_TACH2_VPIR0,BI,RCKMON_SPARE10,RCKMON_SPARE[0:11] connect to fan_ctrl_rmon card connector(now not connected)
-AB3,GPIOO3_TACH3_VPIR1,BI,RCKMON_SPARE11,RCKMON_SPARE[0:11] connect to fan_ctrl_rmon card connector(now not connected)
-W6,GPIOO4_TACH4_VPIR2,BI,RCKMON_SPARE8,RCKMON_SPARE[0:11] connect to fan_ctrl_rmon card connector(now not connected)
-AA5,GPIOO5_TACH5_VPIR3,BI,RCKMON_SPARE9,RCKMON_SPARE[0:11] connect to fan_ctrl_rmon card connector(now not connected)
-AB4,GPIOO6_TACH6_VPIR4,BI,RCKMON_SPARE6,RCKMON_SPARE[0:11] connect to fan_ctrl_rmon card connector(now not connected)
-V7,GPIOO7_TACH7_VPIR5,BI,RCKMON_SPARE7,RCKMON_SPARE[0:11] connect to fan_ctrl_rmon card connector(now not connected)
-Y6,GPIOP0_TACH8_VPIR6,In,RMON1_PF,"rack 1 monitor status, Power Failure, active low"
-AB5,GPIOP1_TACH9_VPIR7,In,RMON1_RF,"rack 1 monitor status, redudancy Failure, active low"
-W7,GPIOP2_TACH10_VPIR8,In,RMON2_PF,"rack 2 monitor status, Power Failure, active low"
-AA6,GPIOP3_TACH11_VPIR9,In,RMON2_RF,"rack 2 monitor status, redudancy Failure, active low"
-AB6,GPIOP4_TACH12,In,RMON3_PF,"rack 3 monitor status, Power Failure, active low"
-Y7,GPIOP5_TACH13,In,RMON3_RF,"rack 3 monitor status, redudancy Failure, active low"
-AA7,GPIOP6_TACH14_BMCINT,In,FANCARD_I2C_ALARM,"fan card alarm input, active low"
-AB7,GPIOP7_TACH15_FLACK,out,BMC_READY_N,"0: BMC is ready for service. 1: BMC is not ready, or during initialization"
-H4,GPIOQ4_SCL14,In,BMC_CPLD_POWER_INT,Intrerrupt from CPLD to BMC for any Power events
-H3,GPIOQ5_SDA14,,BMC_CPLD_SPARE7,Spare GPIOs to CPLD
-H2,GPIOQ6,out,USB_OCS_N1,over-current sense output to USB2513 hub
-H1,GPIOQ7,out,BMC_HEARTBEAT_N,BMC heatbeat output to onboard heartbeat LED
-C6,GPIOR6_MDC1,BI,SWITCH_MDC,MDC/MDIO to GE Switch
-A5,GPIOR7_MDIO1,BI,SWITCH_MDIO,
-V20,GPIOR0_ROMCS1_N,out,SPI_IBMC_BT_CS1_N_R,chip select to secondary boot SPI flash
-U21,ROMD4_GPIOS0_VPODE,Out,BMC_SPI_WP_N,Write protect for Secondary Boot Flash. Connected to CPLD. CPLD will drive it to the flash chip
-C21,GPIOY0_SIOS3_N,In,BOARD_REV_ID0,"Board ID input bit0, resister straping, connect to both BMC and CPLD"
-F20,GPIOY1_SIOS5_N,In,BOARD_REV_ID1,"Board ID input bit1, resister straping, connect to both BMC and CPLD"
-G20,GPIOY2_SIOPWREQ_N,In,BOARD_REV_ID2,"Board ID input bit2, resister straping, connect to both BMC and CPLD"
diff --git a/meta-facebook/meta-wedge100/recipes-utils/openbmc-gpio/files/openbmc_gpio_setup.py b/meta-facebook/meta-wedge100/recipes-utils/openbmc-gpio/files/openbmc_gpio_setup.py
deleted file mode 100644
index dd14763..0000000
--- a/meta-facebook/meta-wedge100/recipes-utils/openbmc-gpio/files/openbmc_gpio_setup.py
+++ /dev/null
@@ -1,75 +0,0 @@
-#!/usr/bin/python -tt
-# Copyright 2015-present Facebook. All rights reserved.
-#
-# This program file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program in a file named COPYING; if not, write to the
-# Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor,
-# Boston, MA 02110-1301 USA
-from __future__ import absolute_import
-from __future__ import division
-from __future__ import print_function
-from __future__ import unicode_literals
-
-from board_gpio_rev_table import board_gpio_rev_table
-from board_gpio_table_v1 import board_gpio_table_v1
-from board_gpio_table_v2 import board_gpio_table_v2
-from soc_gpio_table import soc_gpio_table
-from openbmc_gpio_table import setup_board_gpio
-from soc_gpio import soc_get_register
-
-import openbmc_gpio
-import sys
-
-def set_register():
- '''
- For DVT/EVT boards the framework is not able to handle for GPIOS0 and
- causes error : 'Failed to configure "GPIOS0" for "BMC_SPI_WP_N":
- Not able to unsatisfy an AND condition'. In order to fix the error
- set the specific bit in the register so the framework can handle it.
- '''
- l_reg = soc_get_register(0x8C)
- l_reg.clear_bit(0, write_through=True)
-
-def wedge_board_rev(soc_gpio_table, board_gpio_rev_table):
- # Setup to read revision
- setup_board_gpio(soc_gpio_table, board_gpio_rev_table)
- # Read the gpio values
- v0 = openbmc_gpio.gpio_get('BOARD_REV_ID0')
- v1 = openbmc_gpio.gpio_get('BOARD_REV_ID1')
- v2 = openbmc_gpio.gpio_get('BOARD_REV_ID2')
- return ((v2 << 2) | (v1 << 1) | v0)
-
-def main():
- print('Setting up GPIOs ... ', end='')
- sys.stdout.flush()
- openbmc_gpio.setup_shadow()
- version = wedge_board_rev(soc_gpio_table,board_gpio_rev_table)
- # In order to satisy/unsatisfy conditions in setup_board_gpio()
- # modify the registers
- set_register()
- if version is 1:
- print('Using GPIO EVT table ', end='')
- setup_board_gpio(soc_gpio_table, board_gpio_table_v1)
- else:
- if version is 2:
- print('Using GPIO DVT table ', end='')
- else:
- print('Unexpected board version %s. Using GPIO DVT table. '
- % version, end='')
- setup_board_gpio(soc_gpio_table, board_gpio_table_v2)
- print('Done')
- sys.stdout.flush()
- return 0
-
-if __name__ == '__main__':
- sys.exit(main())
diff --git a/meta-facebook/meta-wedge100/recipes-utils/openbmc-gpio/files/setup_board.py b/meta-facebook/meta-wedge100/recipes-utils/openbmc-gpio/files/setup_board.py
deleted file mode 100644
index bb6ccb1..0000000
--- a/meta-facebook/meta-wedge100/recipes-utils/openbmc-gpio/files/setup_board.py
+++ /dev/null
@@ -1,22 +0,0 @@
-# Copyright 2015-present Facebook. All rights reserved.
-#
-# This program file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program in a file named COPYING; if not, write to the
-# Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor,
-# Boston, MA 02110-1301 USA
-
-board_py_modules=[
- 'board_gpio_table_v1',
- 'board_gpio_table_v2',
- 'board_gpio_rev_table',
-]
diff --git a/meta-facebook/meta-wedge100/recipes-utils/openbmc-gpio/files/wedge100_gpio_parse.py b/meta-facebook/meta-wedge100/recipes-utils/openbmc-gpio/files/wedge100_gpio_parse.py
deleted file mode 100644
index b53f9de..0000000
--- a/meta-facebook/meta-wedge100/recipes-utils/openbmc-gpio/files/wedge100_gpio_parse.py
+++ /dev/null
@@ -1,102 +0,0 @@
-#!/usr/bin/python -tt
-# Copyright 2015-present Facebook. All Rights Reserved.
-#
-# This program file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program in a file named COPYING; if not, write to the
-# Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor,
-# Boston, MA 02110-1301 USA
-from __future__ import absolute_import
-from __future__ import division
-from __future__ import print_function
-from __future__ import unicode_literals
-
-import argparse
-import csv
-import logging
-import re
-import sys
-
-
-GPIO_SYMBOL = 'BoardGPIO'
-
-
-class CsvReader:
- '''
- A class for parsing the CSV files containing the board GPIO config
- '''
- def __init__(self, path):
- self.path = path
-
- fileobj = open(path, 'r')
- self.reader = csv.reader(fileobj, delimiter=b',', quotechar=b'"')
-
- def next(self):
- try:
- line = self.reader.next()
- except StopIteration:
- return None
- return line
-
-
-class WedgeGPIO(object):
- def __init__(self, data):
- self.data = data
- self.gpios = {}
- self.names = set()
-
- def parse(self):
- while True:
- line = self.data.next()
- if line is None:
- break
-
- logging.debug('Parsing line: %s' % line)
-
- if len(line) < 4:
- logging.error('No enough fields in "%s". Skip!' % line)
- continue
-
- gpio = None
- for part in line[1].split('_'):
- if part.startswith('GPIO'):
- gpio = part
- break
- if gpio is None:
- logging.error('Cannot find GPIO file from "%s". Skip!' % line)
- continue
-
- name = line[3]
- assert gpio not in self.gpios and name not in self.names
- self.gpios[gpio] = name
- self.names.add(name)
-
- def print(self, out):
- for gpio in sorted(self.gpios):
- out.write(' %s(\'%s\', \'%s\'),\n'
- % (GPIO_SYMBOL, gpio, self.gpios[gpio]))
-
-
-def main():
- ap = argparse.ArgumentParser()
- ap.add_argument('data', help='The GPIO data file')
- args = ap.parse_args()
-
- logging.basicConfig(level=logging.INFO, format='%(asctime)s: %(message)s')
-
- gpio = WedgeGPIO(CsvReader(args.data))
- gpio.parse()
- gpio.print(sys.stdout)
-
-
-rc = main()
-sys.exit(rc)
diff --git a/meta-facebook/meta-wedge100/recipes-utils/openbmc-gpio/openbmc-gpio_%.bbappend b/meta-facebook/meta-wedge100/recipes-utils/openbmc-gpio/openbmc-gpio_%.bbappend
deleted file mode 100644
index afc133a..0000000
--- a/meta-facebook/meta-wedge100/recipes-utils/openbmc-gpio/openbmc-gpio_%.bbappend
+++ /dev/null
@@ -1,36 +0,0 @@
-# Copyright 2014-present Facebook. All Rights Reserved.
-#
-# This program file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program in a file named COPYING; if not, write to the
-# Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor,
-# Boston, MA 02110-1301 USA
-
-FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
-
-SRC_URI += " \
- file://board_gpio_table_v1.py \
- file://board_gpio_table_v2.py \
- file://board_gpio_rev_table.py \
- file://openbmc_gpio_setup.py \
- file://setup_board.py \
- "
-OPENBMC_GPIO_SOC_TABLE = "ast2400_gpio_table.py"
-
-do_install_append() {
- install -d ${D}${sysconfdir}/init.d
- install -d ${D}${sysconfdir}/rcS.d
- install -m 755 openbmc_gpio_setup.py ${D}${sysconfdir}/init.d/openbmc_gpio_setup.py
- update-rc.d -r ${D} openbmc_gpio_setup.py start 59 S .
-}
-
-FILES_${PN} += "/usr/local/bin ${sysconfdir}"
diff --git a/meta-facebook/meta-wedge100/recipes-utils/openbmc-utils/files/COPYING b/meta-facebook/meta-wedge100/recipes-utils/openbmc-utils/files/COPYING
deleted file mode 100644
index 3912109..0000000
--- a/meta-facebook/meta-wedge100/recipes-utils/openbmc-utils/files/COPYING
+++ /dev/null
@@ -1,340 +0,0 @@
- GNU GENERAL PUBLIC LICENSE
- Version 2, June 1991
-
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.
- 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
- Preamble
-
- The licenses for most software are designed to take away your
-freedom to share and change it. By contrast, the GNU General Public
-License is intended to guarantee your freedom to share and change free
-software--to make sure the software is free for all its users. This
-General Public License applies to most of the Free Software
-Foundation's software and to any other program whose authors commit to
-using it. (Some other Free Software Foundation software is covered by
-the GNU Library General Public License instead.) You can apply it to
-your programs, too.
-
- When we speak of free software, we are referring to freedom, not
-price. Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-this service if you wish), that you receive source code or can get it
-if you want it, that you can change the software or use pieces of it
-in new free programs; and that you know you can do these things.
-
- To protect your rights, we need to make restrictions that forbid
-anyone to deny you these rights or to ask you to surrender the rights.
-These restrictions translate to certain responsibilities for you if you
-distribute copies of the software, or if you modify it.
-
- For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must give the recipients all the rights that
-you have. You must make sure that they, too, receive or can get the
-source code. And you must show them these terms so they know their
-rights.
-
- We protect your rights with two steps: (1) copyright the software, and
-(2) offer you this license which gives you legal permission to copy,
-distribute and/or modify the software.
-
- Also, for each author's protection and ours, we want to make certain
-that everyone understands that there is no warranty for this free
-software. If the software is modified by someone else and passed on, we
-want its recipients to know that what they have is not the original, so
-that any problems introduced by others will not reflect on the original
-authors' reputations.
-
- Finally, any free program is threatened constantly by software
-patents. We wish to avoid the danger that redistributors of a free
-program will individually obtain patent licenses, in effect making the
-program proprietary. To prevent this, we have made it clear that any
-patent must be licensed for everyone's free use or not licensed at all.
-
- The precise terms and conditions for copying, distribution and
-modification follow.
-
- GNU GENERAL PUBLIC LICENSE
- TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
- 0. This License applies to any program or other work which contains
-a notice placed by the copyright holder saying it may be distributed
-under the terms of this General Public License. The "Program", below,
-refers to any such program or work, and a "work based on the Program"
-means either the Program or any derivative work under copyright law:
-that is to say, a work containing the Program or a portion of it,
-either verbatim or with modifications and/or translated into another
-language. (Hereinafter, translation is included without limitation in
-the term "modification".) Each licensee is addressed as "you".
-
-Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope. The act of
-running the Program is not restricted, and the output from the Program
-is covered only if its contents constitute a work based on the
-Program (independent of having been made by running the Program).
-Whether that is true depends on what the Program does.
-
- 1. You may copy and distribute verbatim copies of the Program's
-source code as you receive it, in any medium, provided that you
-conspicuously and appropriately publish on each copy an appropriate
-copyright notice and disclaimer of warranty; keep intact all the
-notices that refer to this License and to the absence of any warranty;
-and give any other recipients of the Program a copy of this License
-along with the Program.
-
-You may charge a fee for the physical act of transferring a copy, and
-you may at your option offer warranty protection in exchange for a fee.
-
- 2. You may modify your copy or copies of the Program or any portion
-of it, thus forming a work based on the Program, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
- a) You must cause the modified files to carry prominent notices
- stating that you changed the files and the date of any change.
-
- b) You must cause any work that you distribute or publish, that in
- whole or in part contains or is derived from the Program or any
- part thereof, to be licensed as a whole at no charge to all third
- parties under the terms of this License.
-
- c) If the modified program normally reads commands interactively
- when run, you must cause it, when started running for such
- interactive use in the most ordinary way, to print or display an
- announcement including an appropriate copyright notice and a
- notice that there is no warranty (or else, saying that you provide
- a warranty) and that users may redistribute the program under
- these conditions, and telling the user how to view a copy of this
- License. (Exception: if the Program itself is interactive but
- does not normally print such an announcement, your work based on
- the Program is not required to print an announcement.)
-
-These requirements apply to the modified work as a whole. If
-identifiable sections of that work are not derived from the Program,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works. But when you
-distribute the same sections as part of a whole which is a work based
-on the Program, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Program.
-
-In addition, mere aggregation of another work not based on the Program
-with the Program (or with a work based on the Program) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
- 3. You may copy and distribute the Program (or a work based on it,
-under Section 2) in object code or executable form under the terms of
-Sections 1 and 2 above provided that you also do one of the following:
-
- a) Accompany it with the complete corresponding machine-readable
- source code, which must be distributed under the terms of Sections
- 1 and 2 above on a medium customarily used for software interchange; or,
-
- b) Accompany it with a written offer, valid for at least three
- years, to give any third party, for a charge no more than your
- cost of physically performing source distribution, a complete
- machine-readable copy of the corresponding source code, to be
- distributed under the terms of Sections 1 and 2 above on a medium
- customarily used for software interchange; or,
-
- c) Accompany it with the information you received as to the offer
- to distribute corresponding source code. (This alternative is
- allowed only for noncommercial distribution and only if you
- received the program in object code or executable form with such
- an offer, in accord with Subsection b above.)
-
-The source code for a work means the preferred form of the work for
-making modifications to it. For an executable work, complete source
-code means all the source code for all modules it contains, plus any
-associated interface definition files, plus the scripts used to
-control compilation and installation of the executable. However, as a
-special exception, the source code distributed need not include
-anything that is normally distributed (in either source or binary
-form) with the major components (compiler, kernel, and so on) of the
-operating system on which the executable runs, unless that component
-itself accompanies the executable.
-
-If distribution of executable or object code is made by offering
-access to copy from a designated place, then offering equivalent
-access to copy the source code from the same place counts as
-distribution of the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
- 4. You may not copy, modify, sublicense, or distribute the Program
-except as expressly provided under this License. Any attempt
-otherwise to copy, modify, sublicense or distribute the Program is
-void, and will automatically terminate your rights under this License.
-However, parties who have received copies, or rights, from you under
-this License will not have their licenses terminated so long as such
-parties remain in full compliance.
-
- 5. You are not required to accept this License, since you have not
-signed it. However, nothing else grants you permission to modify or
-distribute the Program or its derivative works. These actions are
-prohibited by law if you do not accept this License. Therefore, by
-modifying or distributing the Program (or any work based on the
-Program), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Program or works based on it.
-
- 6. Each time you redistribute the Program (or any work based on the
-Program), the recipient automatically receives a license from the
-original licensor to copy, distribute or modify the Program subject to
-these terms and conditions. You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties to
-this License.
-
- 7. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License. If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Program at all. For example, if a patent
-license would not permit royalty-free redistribution of the Program by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Program.
-
-If any portion of this section is held invalid or unenforceable under
-any particular circumstance, the balance of the section is intended to
-apply and the section as a whole is intended to apply in other
-circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system, which is
-implemented by public license practices. Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
- 8. If the distribution and/or use of the Program is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Program under this License
-may add an explicit geographical distribution limitation excluding
-those countries, so that distribution is permitted only in or among
-countries not thus excluded. In such case, this License incorporates
-the limitation as if written in the body of this License.
-
- 9. The Free Software Foundation may publish revised and/or new versions
-of the General Public License from time to time. Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
-Each version is given a distinguishing version number. If the Program
-specifies a version number of this License which applies to it and "any
-later version", you have the option of following the terms and conditions
-either of that version or of any later version published by the Free
-Software Foundation. If the Program does not specify a version number of
-this License, you may choose any version ever published by the Free Software
-Foundation.
-
- 10. If you wish to incorporate parts of the Program into other free
-programs whose distribution conditions are different, write to the author
-to ask for permission. For software which is copyrighted by the Free
-Software Foundation, write to the Free Software Foundation; we sometimes
-make exceptions for this. Our decision will be guided by the two goals
-of preserving the free status of all derivatives of our free software and
-of promoting the sharing and reuse of software generally.
-
- NO WARRANTY
-
- 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
-FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
-OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
-PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
-OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
-TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
-PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
-REPAIR OR CORRECTION.
-
- 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
-REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
-INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
-OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
-TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
-YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
-PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGES.
-
- END OF TERMS AND CONDITIONS
-
- How to Apply These Terms to Your New Programs
-
- If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
- To do so, attach the following notices to the program. It is safest
-to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least
-the "copyright" line and a pointer to where the full notice is found.
-
- <one line to give the program's name and a brief idea of what it does.>
- Copyright (C) <year> <name of author>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
-
-Also add information on how to contact you by electronic and paper mail.
-
-If the program is interactive, make it output a short notice like this
-when it starts in an interactive mode:
-
- Gnomovision version 69, Copyright (C) year name of author
- Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
- This is free software, and you are welcome to redistribute it
- under certain conditions; type `show c' for details.
-
-The hypothetical commands `show w' and `show c' should show the appropriate
-parts of the General Public License. Of course, the commands you use may
-be called something other than `show w' and `show c'; they could even be
-mouse-clicks or menu items--whatever suits your program.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the program, if
-necessary. Here is a sample; alter the names:
-
- Yoyodyne, Inc., hereby disclaims all copyright interest in the program
- `Gnomovision' (which makes passes at compilers) written by James Hacker.
-
- <signature of Ty Coon>, 1 April 1989
- Ty Coon, President of Vice
-
-This General Public License does not permit incorporating your program into
-proprietary programs. If your program is a subroutine library, you may
-consider it more useful to permit linking proprietary applications with the
-library. If this is what you want to do, use the GNU Library General
-Public License instead of this License.
diff --git a/meta-facebook/meta-wedge100/recipes-utils/openbmc-utils/files/board-utils.sh b/meta-facebook/meta-wedge100/recipes-utils/openbmc-utils/files/board-utils.sh
deleted file mode 100644
index a999a9c..0000000
--- a/meta-facebook/meta-wedge100/recipes-utils/openbmc-utils/files/board-utils.sh
+++ /dev/null
@@ -1,81 +0,0 @@
-# Copyright 2015-present Facebook. All Rights Reserved.
-
-SYSCPLD_SYSFS_DIR="/sys/class/i2c-adapter/i2c-12/12-0031"
-PWR_MAIN_SYSFS="${SYSCPLD_SYSFS_DIR}/pwr_main_n"
-PWR_USRV_SYSFS="${SYSCPLD_SYSFS_DIR}/pwr_usrv_en"
-PWR_USRV_BTN_SYSFS="${SYSCPLD_SYSFS_DIR}/pwr_usrv_btn_en"
-SLOTID_SYSFS="${SYSCPLD_SYSFS_DIR}/slotid"
-
-wedge_iso_buf_enable() {
- # TODO, no isolation buffer
- return 0
-}
-
-wedge_iso_buf_disable() {
- # TODO, no isolation buffer
- return 0
-}
-
-wedge_is_us_on() {
- local val n retries prog
- if [ $# -gt 0 ]; then
- retries="$1"
- else
- retries=1
- fi
- if [ $# -gt 1 ]; then
- prog="$2"
- else
- prog=""
- fi
- if [ $# -gt 2 ]; then
- default=$3 # value 0 means defaul is 'ON'
- else
- default=1
- fi
- val=$(cat $PWR_USRV_SYSFS 2> /dev/null | head -n 1)
- if [ -z "$val" ]; then
- return $default
- elif [ "$val" == "0x1" ]; then
- return 0 # powered on
- else
- return 1
- fi
-}
-
-wedge_board_type() {
- echo 'WEDGE100'
-}
-
-wedge_slot_id() {
- printf "%d\n" $(cat $SLOTID_SYSFS)
-}
-
-wedge_board_rev() {
- local val0 val1 val2
- val0=$(gpio_get BOARD_REV_ID0)
- val1=$(gpio_get BOARD_REV_ID1)
- val2=$(gpio_get BOARD_REV_ID2)
- echo $((val0 | (val1 << 1) | (val2 << 2)))
-}
-
-# Should we enable OOB interface or not
-wedge_should_enable_oob() {
- # wedge100 uses BMC MAC since beginning
- return -1
-}
-
-wedge_power_on_board() {
- local val
- # power on main power, uServer power, and enable power button
- val=$(cat $PWR_MAIN_SYSFS | head -n 1)
- if [ "$val" != "0x1" ]; then
- echo 1 > $PWR_MAIN_SYSFS
- sleep 2
- fi
- val=$(cat $PWR_USRV_BTN_SYSFS | head -n 1)
- if [ "$val" != "0x1" ]; then
- echo 1 > $PWR_USRV_BTN_SYSFS
- sleep 1
- fi
-}
diff --git a/meta-facebook/meta-wedge100/recipes-utils/openbmc-utils/files/disable_watchdog.sh b/meta-facebook/meta-wedge100/recipes-utils/openbmc-utils/files/disable_watchdog.sh
deleted file mode 100644
index 07826d6..0000000
--- a/meta-facebook/meta-wedge100/recipes-utils/openbmc-utils/files/disable_watchdog.sh
+++ /dev/null
@@ -1,6 +0,0 @@
-#!/bin/sh
-
-. /usr/local/bin/openbmc-utils.sh
-
-# Disable the dual boot watch dog
-devmem_clear_bit 0x1e78502c 0
diff --git a/meta-facebook/meta-wedge100/recipes-utils/openbmc-utils/files/power-on.sh b/meta-facebook/meta-wedge100/recipes-utils/openbmc-utils/files/power-on.sh
deleted file mode 100644
index 1f22dcf..0000000
--- a/meta-facebook/meta-wedge100/recipes-utils/openbmc-utils/files/power-on.sh
+++ /dev/null
@@ -1,51 +0,0 @@
-#!/bin/sh
-#
-# Copyright 2014-present Facebook. All Rights Reserved.
-#
-# This program file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program in a file named COPYING; if not, write to the
-# Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor,
-# Boston, MA 02110-1301 USA
-
-### BEGIN INIT INFO
-# Provides: power-on
-# Required-Start:
-# Required-Stop:
-# Default-Start: S
-# Default-Stop:
-# Short-Description: Power on micro-server
-### END INIT INFO
-. /usr/local/bin/openbmc-utils.sh
-
-PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin
-
-# make power button high to prepare for power on sequence
-gpio_set BMC_PWR_BTN_OUT_N 1
-
-# First power on TH, and if Panther+ is used,
-# provide standby power to Panther+.
-wedge_power_on_board
-
-echo -n "Checking microserver power status ... "
-if wedge_is_us_on 10 "."; then
- echo "on"
- on=1
-else
- echo "off"
- on=0
-fi
-
-if [ $on -eq 0 ]; then
- # Power on now
- wedge_power.sh on -f
-fi
diff --git a/meta-facebook/meta-wedge100/recipes-utils/openbmc-utils/files/wedge_power.sh b/meta-facebook/meta-wedge100/recipes-utils/openbmc-utils/files/wedge_power.sh
deleted file mode 100644
index 0ad93e6..0000000
--- a/meta-facebook/meta-wedge100/recipes-utils/openbmc-utils/files/wedge_power.sh
+++ /dev/null
@@ -1,187 +0,0 @@
-#!/bin/bash
-#
-# Copyright 2015-present Facebook. All Rights Reserved.
-#
-# This program file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program in a file named COPYING; if not, write to the
-# Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor,
-# Boston, MA 02110-1301 USA
-#
-
-. /usr/local/bin/openbmc-utils.sh
-
-PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin
-
-prog="$0"
-
-PWR_BTN_GPIO="BMC_PWR_BTN_OUT_N"
-PWR_SYSTEM_SYSFS="${SYSCPLD_SYSFS_DIR}/pwr_cyc_all_n"
-PWR_USRV_RST_SYSFS="${SYSCPLD_SYSFS_DIR}/usrv_rst_n"
-
-usage() {
- echo "Usage: $prog <command> [command options]"
- echo
- echo "Commands:"
- echo " status: Get the current microserver power status"
- echo
- echo " on: Power on microserver if not powered on already"
- echo " options:"
- echo " -f: Re-do power on sequence no matter if microserver has "
- echo " been powered on or not."
- echo
- echo " off: Power off microserver ungracefully"
- echo
- echo " reset: Power reset microserver ungracefully"
- echo " options:"
- echo " -s: Power reset whole wedge system ungracefully"
- echo
-}
-
-do_status() {
- echo -n "Microserver power is "
- if wedge_is_us_on; then
- echo "on"
- else
- echo "off"
- fi
- return 0
-}
-
-do_on_com_e() {
- echo 1 > $PWR_USRV_SYSFS
- return $?
-}
-
-do_on() {
- local force opt ret
- force=0
- while getopts "f" opt; do
- case $opt in
- f)
- force=1
- ;;
- *)
- usage
- exit -1
- ;;
-
- esac
- done
- echo -n "Power on microserver ..."
- if [ $force -eq 0 ]; then
- # need to check if uS is on or not
- if wedge_is_us_on 10 "."; then
- echo " Already on. Skip!"
- return 1
- fi
- fi
-
- # power on sequence
- do_on_com_e
- ret=$?
- if [ $ret -eq 0 ]; then
- echo " Done"
- else
- echo " Failed"
- fi
- return $ret
-}
-
-do_off_com_e() {
- echo 0 > $PWR_USRV_SYSFS
- return $?
-}
-
-do_off() {
- local ret
- echo -n "Power off microserver ..."
- do_off_com_e
- ret=$?
- if [ $ret -eq 0 ]; then
- echo " Done"
- else
- echo " Failed"
- fi
- return $ret
-}
-
-do_reset() {
- local system opt pulse_us
- system=0
- while getopts "s" opt; do
- case $opt in
- s)
- system=1
- ;;
- *)
- usage
- exit -1
- ;;
- esac
- done
- if [ $system -eq 1 ]; then
- pulse_us=100000 # 100ms
- echo -n "Power reset whole system ..."
- sleep 1
- echo 0 > $PWR_SYSTEM_SYSFS
- # Echo 0 above should work already. However, after CPLD upgrade,
- # We need to re-generate the pulse to make this work
- usleep $pulse_us
- echo 1 > $PWR_SYSTEM_SYSFS
- usleep $pulse_us
- echo 0 > $PWR_SYSTEM_SYSFS
- usleep $pulse_us
- echo 1 > $PWR_SYSTEM_SYSFS
- else
- if ! wedge_is_us_on; then
- echo "Power resetting microserver that is powered off has no effect."
- echo "Use '$prog on' to power the microserver on"
- return -1
- fi
- echo -n "Power reset microserver ..."
- echo 0 > $PWR_USRV_RST_SYSFS
- sleep 1
- echo 1 > $PWR_USRV_RST_SYSFS
- fi
- echo " Done"
- return 0
-}
-
-if [ $# -lt 1 ]; then
- usage
- exit -1
-fi
-
-command="$1"
-shift
-
-case "$command" in
- status)
- do_status $@
- ;;
- on)
- do_on $@
- ;;
- off)
- do_off $@
- ;;
- reset)
- do_reset $@
- ;;
- *)
- usage
- exit -1
- ;;
-esac
-
-exit $?
diff --git a/meta-facebook/meta-wedge100/recipes-utils/openbmc-utils/files/wedge_us_mac.sh b/meta-facebook/meta-wedge100/recipes-utils/openbmc-utils/files/wedge_us_mac.sh
deleted file mode 100644
index 8ad2fec..0000000
--- a/meta-facebook/meta-wedge100/recipes-utils/openbmc-utils/files/wedge_us_mac.sh
+++ /dev/null
@@ -1,38 +0,0 @@
-#!/bin/bash
-#
-# Copyright 2015-present Facebook. All Rights Reserved.
-#
-# This program file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program in a file named COPYING; if not, write to the
-# Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor,
-# Boston, MA 02110-1301 USA
-#
-
-PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin
-
-. /usr/local/bin/openbmc-utils.sh
-
-if ! wedge_is_us_on; then
- echo "Cannot retrive microserver MAC when microserver is powered off." 1>&2
- exit -2
-fi
-
-mac=$(i2cdump -f -y 0x4 0x33 b 2> /dev/null | grep '^50: '| awk '{ printf "%s:%s:%s:%s:%s:%s\n", $2, $3, $4, $5, $6, $7 }')
-
-if [ -n "$mac" -a "${mac/X/}" = "${mac}" ]; then
- echo $mac
- exit 0
-else
- echo "Cannot find out the microserver MAC" 1>&2
- exit -1
-fi
diff --git a/meta-facebook/meta-wedge100/recipes-utils/openbmc-utils/openbmc-utils_%.bbappend b/meta-facebook/meta-wedge100/recipes-utils/openbmc-utils/openbmc-utils_%.bbappend
deleted file mode 100644
index 87db374..0000000
--- a/meta-facebook/meta-wedge100/recipes-utils/openbmc-utils/openbmc-utils_%.bbappend
+++ /dev/null
@@ -1,64 +0,0 @@
-# Copyright 2015-present Facebook. All Rights Reserved.
-#
-# This program file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program in a file named COPYING; if not, write to the
-# Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor,
-# Boston, MA 02110-1301 USA
-
-FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
-
-SRC_URI += "file://disable_watchdog.sh \
- file://board-utils.sh \
- "
-
-OPENBMC_UTILS_FILES += " \
- disable_watchdog.sh \
- "
-
-DEPENDS_append = " update-rc.d-native"
-
-do_install_board() {
- # for backward compatible, create /usr/local/fbpackages/utils/ast-functions
- olddir="/usr/local/fbpackages/utils"
- install -d ${D}${olddir}
- ln -s "/usr/local/bin/openbmc-utils.sh" "${D}${olddir}/ast-functions"
-
- # common lib and include files
- install -d ${D}${includedir}/facebook
- install -m 0644 src/include/i2c-dev.h ${D}${includedir}/facebook/i2c-dev.h
-
- # init
- install -d ${D}${sysconfdir}/init.d
- install -d ${D}${sysconfdir}/rcS.d
- # the script to mount /mnt/data
- install -m 0755 ${WORKDIR}/mount_data0.sh ${D}${sysconfdir}/init.d/mount_data0.sh
- update-rc.d -r ${D} mount_data0.sh start 03 S .
- install -m 0755 ${WORKDIR}/rc.early ${D}${sysconfdir}/init.d/rc.early
- update-rc.d -r ${D} rc.early start 04 S .
-
- # networking is done after rcS, any start level within rcS
- # for mac fixup should work
- install -m 755 eth0_mac_fixup.sh ${D}${sysconfdir}/init.d/eth0_mac_fixup.sh
- update-rc.d -r ${D} eth0_mac_fixup.sh start 70 S .
-
- install -m 755 power-on.sh ${D}${sysconfdir}/init.d/power-on.sh
- update-rc.d -r ${D} power-on.sh start 85 S .
-
- install -m 0755 ${WORKDIR}/rc.local ${D}${sysconfdir}/init.d/rc.local
- update-rc.d -r ${D} rc.local start 99 2 3 4 5 .
-
- install -m 0755 ${WORKDIR}/disable_watchdog.sh ${D}${sysconfdir}/init.d/disable_watchdog.sh
- update-rc.d -r ${D} disable_watchdog.sh start 99 2 3 4 5 .
-}
-
-FILES_${PN} += "${sysconfdir}"
diff --git a/meta-facebook/meta-wedge100/recipes-utils/wedge-eeprom/libwedge-eeprom_0.1.bbappend b/meta-facebook/meta-wedge100/recipes-utils/wedge-eeprom/libwedge-eeprom_0.1.bbappend
deleted file mode 100644
index bb2fba7..0000000
--- a/meta-facebook/meta-wedge100/recipes-utils/wedge-eeprom/libwedge-eeprom_0.1.bbappend
+++ /dev/null
@@ -1,18 +0,0 @@
-# Copyright 2015-present Facebook. All Rights Reserved.
-#
-# This program file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program in a file named COPYING; if not, write to the
-# Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor,
-# Boston, MA 02110-1301 USA
-
-CFLAGS_prepend = "-DFBW_EEPROM_FILE=\\"/sys/class/i2c-adapter/i2c-6/6-0051/eeprom\\" "
diff --git a/meta-facebook/meta-yosemite/conf/bblayers.conf.sample b/meta-facebook/meta-yosemite/conf/bblayers.conf.sample
deleted file mode 100644
index 6c7c0c9..0000000
--- a/meta-facebook/meta-yosemite/conf/bblayers.conf.sample
+++ /dev/null
@@ -1,22 +0,0 @@
-# LAYER_CONF_VERSION is increased each time build/conf/bblayers.conf
-# changes incompatibly
-LCONF_VERSION = "6"
-
-BBPATH = "${TOPDIR}"
-BBFILES ?= ""
-
-BBLAYERS ?= " \
- ##OEROOT##/meta \
- ##OEROOT##/meta-yocto \
- ##OEROOT##/meta-yocto-bsp \
- ##OEROOT##/meta-openembedded/meta-oe \
- ##OEROOT##/meta-openembedded/meta-networking \
- ##OEROOT##/meta-openembedded/meta-python \
- ##OEROOT##/meta-openbmc \
- ##OEROOT##/meta-openbmc/meta-aspeed \
- ##OEROOT##/meta-openbmc/meta-facebook/meta-yosemite \
- "
-BBLAYERS_NON_REMOVABLE ?= " \
- ##OEROOT##/meta \
- ##OEROOT##/meta-yocto \
- "
diff --git a/meta-facebook/meta-yosemite/conf/conf-notes.txt b/meta-facebook/meta-yosemite/conf/conf-notes.txt
deleted file mode 100644
index 87ebd18..0000000
--- a/meta-facebook/meta-yosemite/conf/conf-notes.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-Common targets are:
- yosemite-image
diff --git a/meta-facebook/meta-yosemite/conf/layer.conf b/meta-facebook/meta-yosemite/conf/layer.conf
deleted file mode 100644
index 281d2cc..0000000
--- a/meta-facebook/meta-yosemite/conf/layer.conf
+++ /dev/null
@@ -1,10 +0,0 @@
-# We have a conf and classes directory, add to BBPATH
-BBPATH .= ":${LAYERDIR}"
-
-# We have recipes-* directories, add to BBFILES
-BBFILES += "${LAYERDIR}/recipes-*/*/*.bb \
- ${LAYERDIR}/recipes-*/*/*.bbappend"
-
-BBFILE_COLLECTIONS += "yosemite"
-BBFILE_PATTERN_yosemite = "^${LAYERDIR}/"
-BBFILE_PRIORITY_yosemite = "8"
diff --git a/meta-facebook/meta-yosemite/conf/local.conf.sample b/meta-facebook/meta-yosemite/conf/local.conf.sample
deleted file mode 100644
index 6da6659..0000000
--- a/meta-facebook/meta-yosemite/conf/local.conf.sample
+++ /dev/null
@@ -1,145 +0,0 @@
-#
-# Local configuration file for building the OpenBMC image.
-#
-
-# Always look for packages first in our own local package mirror
-SOURCE_MIRROR_URL ?= "file://${TOPDIR}/../meta-openbmc/source_mirror/"
-INHERIT += "own-mirrors"
-
-# Save local tarballs for all packages we download.
-# This can be used to update our mirror directory above.
-BB_GENERATE_MIRROR_TARBALLS = "1"
-
-# The following setting will prevent bitbake from downloading anything over the
-# network. This can be used to ensure that we get everything from a local
-# file:// mirror.
-#
-# Comment this out if you do need to download new packages from the internet.
-# However, once you have downloaded the package you should check them into our
-# mirror repository so that other developers will always get it from the mirror
-# repo.
-BB_NO_NETWORK = "fb-only"
-
-# Parallelism Options
-#
-# How many tasks bitbake should run in parallel:
-BB_NUMBER_THREADS ?= "${@oe.utils.cpu_count()}"
-# How many processes make should run in parallel:
-PARALLEL_MAKE ?= "-j ${@oe.utils.cpu_count()}"
-
-# Machine Selection
-MACHINE ??= "yosemite"
-
-# Build directory locationds.
-#
-#DL_DIR ?= "${TOPDIR}/downloads"
-#SSTATE_DIR ?= "${TOPDIR}/sstate-cache"
-#TMPDIR = "${TOPDIR}/tmp"
-
-#
-# Default policy config
-# We could eventually create our own distro config if desired,
-# but for now we use the standard poky distro settings.
-#
-DISTRO ?= "poky"
-
-# Use RPM packages
-PACKAGE_CLASSES ?= "package_rpm"
-
-# Extra image features.
-# Currently we do not enable anything extra here.
-#EXTRA_IMAGE_FEATURES = ""
-
-# We build on CentOS 6.3.
-# Don't complain about it, even though it isn't in poky's default
-# list of supported distros.
-SANITY_TESTED_DISTROS_append ?= " CentOS-6.3 \n "
-
-#
-# Additional image features
-#
-# The following is a list of additional classes to use when building images which
-# enable extra features. Some available options which can be included in this variable
-# are:
-# - 'buildstats' collect build statistics
-# - 'image-mklibs' to reduce shared library files size for an image
-# - 'image-prelink' in order to prelink the filesystem image
-# - 'image-swab' to perform host system intrusion detection
-# NOTE: if listing mklibs & prelink both, then make sure mklibs is before prelink
-# NOTE: mklibs also needs to be explicitly enabled for a given image, see local.conf.extended
-USER_CLASSES ?= "buildstats image-mklibs image-prelink"
-
-#
-# Interactive shell configuration
-#
-# Under certain circumstances the system may need input from you and to do this it
-# can launch an interactive shell. It needs to do this since the build is
-# multithreaded and needs to be able to handle the case where more than one parallel
-# process may require the user's attention. The default is iterate over the available
-# terminal types to find one that works.
-#
-# Examples of the occasions this may happen are when resolving patches which cannot
-# be applied, to use the devshell or the kernel menuconfig
-#
-# Supported values are auto, gnome, xfce, rxvt, screen, konsole (KDE 3.x only), none
-# Note: currently, Konsole support only works for KDE 3.x due to the way
-# newer Konsole versions behave
-#OE_TERMINAL = "auto"
-# By default disable interactive patch resolution (tasks will just fail instead):
-PATCHRESOLVE = "noop"
-
-#
-# Disk Space Monitoring during the build
-#
-# Monitor the disk space during the build. If there is less that 1GB of space or less
-# than 100K inodes in any key build location (TMPDIR, DL_DIR, SSTATE_DIR), gracefully
-# shutdown the build. If there is less that 100MB or 1K inodes, perform a hard abort
-# of the build. The reason for this is that running completely out of space can corrupt
-# files and damages the build in ways which may not be easily recoverable.
-BB_DISKMON_DIRS = "\
- STOPTASKS,${TMPDIR},1G,100K \
- STOPTASKS,${DL_DIR},1G,100K \
- STOPTASKS,${SSTATE_DIR},1G,100K \
- ABORT,${TMPDIR},100M,1K \
- ABORT,${DL_DIR},100M,1K \
- ABORT,${SSTATE_DIR},100M,1K"
-
-#
-# Shared-state files from other locations
-#
-# As mentioned above, shared state files are prebuilt cache data objects which can
-# used to accelerate build time. This variable can be used to configure the system
-# to search other mirror locations for these objects before it builds the data itself.
-#
-# This can be a filesystem directory, or a remote url such as http or ftp. These
-# would contain the sstate-cache results from previous builds (possibly from other
-# machines). This variable works like fetcher MIRRORS/PREMIRRORS and points to the
-# cache locations to check for the shared objects.
-# NOTE: if the mirror uses the same structure as SSTATE_DIR, you need to add PATH
-# at the end as shown in the examples below. This will be substituted with the
-# correct path within the directory structure.
-#SSTATE_MIRRORS ?= "\
-#file://.* http://someserver.tld/share/sstate/PATH;downloadfilename=PATH \n \
-#file://.* file:///some/local/dir/sstate/PATH"
-
-
-# CONF_VERSION is increased each time build/conf/ changes incompatibly and is used to
-# track the version of this file when it was generated. This can safely be ignored if
-# this doesn't mean anything to you.
-CONF_VERSION = "1"
-
-
-# Update root password to '0penBmc' and change the root shell back to bash.
-# This default root password is used at the ODM and system integrator. It will be
-# changed during provisioning at the datacenter.
-INHERIT += "extrausers"
-
-EXTRA_USERS_PARAMS = " \
- usermod -s /bin/bash root; \
- usermod -p '\$1\$UGMqyqdG\$FZiylVFmRRfl9Z0Ue8G7e/' root; \
- "
-
-OLDEST_KERNEL = "2.6.28"
-
-INHERIT += "blacklist"
-PNBLACKLIST[glibc] = "glibc 2.21 does not work with our kernel 2.6.28"
diff --git a/meta-facebook/meta-yosemite/conf/machine/yosemite.conf b/meta-facebook/meta-yosemite/conf/machine/yosemite.conf
deleted file mode 100644
index 99d6caa..0000000
--- a/meta-facebook/meta-yosemite/conf/machine/yosemite.conf
+++ /dev/null
@@ -1,9 +0,0 @@
-#@TYPE: Machine
-#@NAME: Yosemite
-#@DESCRIPTION: Machine configuration for Facebook Yosemite
-
-UBOOT_MACHINE_yosemite = "fbyosemite_config"
-
-require conf/machine/include/ast1250.inc
-
-TCLIBC = 'eglibc'
diff --git a/meta-facebook/meta-yosemite/recipes-core/busybox/busybox/busybox.cfg b/meta-facebook/meta-yosemite/recipes-core/busybox/busybox/busybox.cfg
deleted file mode 100644
index 66da117..0000000
--- a/meta-facebook/meta-yosemite/recipes-core/busybox/busybox/busybox.cfg
+++ /dev/null
@@ -1,18 +0,0 @@
-CONFIG_SH_MATH_SUPPORT_64=y
-CONFIG_DEVMEM=y
-CONFIG_LSUSB=y
-CONFIG_FEATURE_PS_ADDITIONAL_COLUMNS=y
-CONFIG_RX=y
-CONFIG_FLASHCP=y
-CONFIG_FLASH_LOCK=y
-CONFIG_FLASH_UNLOCK=y
-CONFIG_FLASH_ERASEALL=y
-CONFIG_TRACEROUTE6=y
-CONFIG_VCONFIG=y
-# we use the standalone ip util
-CONFIG_IP=n
-# use dhclient, as udhcpc will flush all v6 link local addresses during renew
-CONFIG_FEATURE_IFUPDOWN_EXTERNAL_DHCP=y
-CONFIG_UDHCPD=n
-CONFIG_UDHCPC=n
-CONFIG_UDHCPC6=n
diff --git a/meta-facebook/meta-yosemite/recipes-core/busybox/busybox/syslog.conf b/meta-facebook/meta-yosemite/recipes-core/busybox/busybox/syslog.conf
deleted file mode 100644
index f033341..0000000
--- a/meta-facebook/meta-yosemite/recipes-core/busybox/busybox/syslog.conf
+++ /dev/null
@@ -1,5 +0,0 @@
-# /etc/syslog.conf Configuration file for busybox's syslogd utility
-# Send emergency messages to the console
-*.crit /mnt/data/logfile
-# Store everything else
-*.* /var/log/messages
diff --git a/meta-facebook/meta-yosemite/recipes-core/busybox/busybox_%.bbappend b/meta-facebook/meta-yosemite/recipes-core/busybox/busybox_%.bbappend
deleted file mode 100644
index 0047f92..0000000
--- a/meta-facebook/meta-yosemite/recipes-core/busybox/busybox_%.bbappend
+++ /dev/null
@@ -1,6 +0,0 @@
-FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
-
-SRC_URI += " \
- file://busybox.cfg \
- file://syslog.conf \
- "
diff --git a/meta-facebook/meta-yosemite/recipes-core/images/yosemite-image.bb b/meta-facebook/meta-yosemite/recipes-core/images/yosemite-image.bb
deleted file mode 100644
index 300f167..0000000
--- a/meta-facebook/meta-yosemite/recipes-core/images/yosemite-image.bb
+++ /dev/null
@@ -1 +0,0 @@
-include yosemite-image.inc
diff --git a/meta-facebook/meta-yosemite/recipes-core/images/yosemite-image.inc b/meta-facebook/meta-yosemite/recipes-core/images/yosemite-image.inc
deleted file mode 100644
index e316aa0..0000000
--- a/meta-facebook/meta-yosemite/recipes-core/images/yosemite-image.inc
+++ /dev/null
@@ -1,91 +0,0 @@
-inherit aspeed_uboot_image
-
-# /dev
-require recipes-core/images/aspeed-dev.inc
-
-# Base this image on core-image-minimal
-include recipes-core/images/core-image-minimal.bb
-
-# Changing the image compression from gz to lzma achieves 30% saving (~3M).
-# However, the current u-boot does not have lzma enabled. Stick to gz
-# until we generate a new u-boot image.
-IMAGE_FSTYPES += "cpio.lzma.u-boot"
-UBOOT_IMAGE_ENTRYPOINT = "0x40800000"
-
-PYTHON_PKGS = " \
- python-core \
- python-io \
- python-json \
- python-shell \
- python-subprocess \
- python-argparse \
- python-ctypes \
- python-datetime \
- python-email \
- python-threading \
- python-mime \
- python-pickle \
- python-misc \
- python-netserver \
- "
-
-NTP_PKGS = " \
- ntp \
- ntp-utils \
- sntp \
- ntpdate \
- "
-
-# Include modules in rootfs
-IMAGE_INSTALL += " \
- kernel-modules \
- u-boot \
- u-boot-fw-utils \
- healthd \
- fbutils \
- fan-ctrl \
- watchdog-ctrl \
- i2c-tools \
- sensor-setup \
- usb-console \
- lmsensors-sensors \
- rest-api \
- bottle \
- ipmid \
- ${PYTHON_PKGS} \
- ${NTP_PKGS} \
- iproute2 \
- dhcp-client \
- fruid \
- ipmbd \
- bic-cached \
- bic-util \
- yosemite-sensors \
- sensor-util \
- sensor-mon \
- gpiod \
- front-paneld \
- power-util \
- consoled \
- cfg-util \
- fw-util \
- fpc-util \
- me-util \
- log-util \
- cherryPy \
- lldp-util \
- spatula \
- "
-
-IMAGE_FEATURES += " \
- ssh-server-openssh \
- tools-debug \
- "
-
-DISTRO_FEATURES += " \
- ext2 \
- ipv6 \
- nfs \
- usbgadget \
- usbhost \
- "
diff --git a/meta-facebook/meta-yosemite/recipes-core/init-ifupdown/files/interfaces b/meta-facebook/meta-yosemite/recipes-core/init-ifupdown/files/interfaces
deleted file mode 100644
index 36e342e..0000000
--- a/meta-facebook/meta-yosemite/recipes-core/init-ifupdown/files/interfaces
+++ /dev/null
@@ -1,11 +0,0 @@
-# The loopback interface
-auto lo
-iface lo inet loopback
-
-auto eth0
-iface eth0 inet dhcp
-
-auto usb0
-iface usb0 inet6 static
- address fe80::1
- netmask 64
diff --git a/meta-facebook/meta-yosemite/recipes-core/init-ifupdown/init-ifupdown_%.bbappend b/meta-facebook/meta-yosemite/recipes-core/init-ifupdown/init-ifupdown_%.bbappend
deleted file mode 100644
index 7d74521..0000000
--- a/meta-facebook/meta-yosemite/recipes-core/init-ifupdown/init-ifupdown_%.bbappend
+++ /dev/null
@@ -1,2 +0,0 @@
-
-FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
diff --git a/meta-facebook/meta-yosemite/recipes-core/sysvinit/sysvinit-inittab_%.bbappend b/meta-facebook/meta-yosemite/recipes-core/sysvinit/sysvinit-inittab_%.bbappend
deleted file mode 100644
index 9624d65..0000000
--- a/meta-facebook/meta-yosemite/recipes-core/sysvinit/sysvinit-inittab_%.bbappend
+++ /dev/null
@@ -1,2 +0,0 @@
-# ttyS0 is UART5, BMC's serial port
-SERIAL_CONSOLES += "57600;ttyS0"
diff --git a/meta-facebook/meta-yosemite/recipes-kernel/linux/files/defconfig b/meta-facebook/meta-yosemite/recipes-kernel/linux/files/defconfig
deleted file mode 100644
index d32f18e..0000000
--- a/meta-facebook/meta-yosemite/recipes-kernel/linux/files/defconfig
+++ /dev/null
@@ -1,1480 +0,0 @@
-#
-# Automatically generated make config: don't edit
-# Linux kernel version: 2.6.28.9
-# Tue Feb 3 16:41:40 2015
-#
-CONFIG_ARM=y
-CONFIG_SYS_SUPPORTS_APM_EMULATION=y
-CONFIG_GENERIC_GPIO=y
-CONFIG_GENERIC_TIME=y
-CONFIG_GENERIC_CLOCKEVENTS=y
-CONFIG_MMU=y
-# CONFIG_NO_IOPORT is not set
-CONFIG_GENERIC_HARDIRQS=y
-CONFIG_STACKTRACE_SUPPORT=y
-CONFIG_HAVE_LATENCYTOP_SUPPORT=y
-CONFIG_LOCKDEP_SUPPORT=y
-CONFIG_TRACE_IRQFLAGS_SUPPORT=y
-CONFIG_HARDIRQS_SW_RESEND=y
-CONFIG_GENERIC_IRQ_PROBE=y
-CONFIG_RWSEM_GENERIC_SPINLOCK=y
-# CONFIG_ARCH_HAS_ILOG2_U32 is not set
-# CONFIG_ARCH_HAS_ILOG2_U64 is not set
-CONFIG_GENERIC_HWEIGHT=y
-CONFIG_GENERIC_CALIBRATE_DELAY=y
-CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
-CONFIG_VECTORS_BASE=0xffff0000
-CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
-
-#
-# General setup
-#
-CONFIG_EXPERIMENTAL=y
-CONFIG_BROKEN_ON_SMP=y
-CONFIG_INIT_ENV_ARG_LIMIT=32
-CONFIG_LOCALVERSION=""
-# CONFIG_LOCALVERSION_AUTO is not set
-CONFIG_KERNEL_GZIP=y
-# CONFIG_KERNEL_BZIP2 is not set
-# CONFIG_KERNEL_LZMA is not set
-CONFIG_SWAP=y
-CONFIG_SYSVIPC=y
-CONFIG_SYSVIPC_SYSCTL=y
-CONFIG_POSIX_MQUEUE=y
-# CONFIG_BSD_PROCESS_ACCT is not set
-# CONFIG_TASKSTATS is not set
-# CONFIG_AUDIT is not set
-CONFIG_IKCONFIG=m
-CONFIG_IKCONFIG_PROC=y
-CONFIG_LOG_BUF_SHIFT=16
-# CONFIG_CGROUPS is not set
-# CONFIG_GROUP_SCHED is not set
-CONFIG_SYSFS_DEPRECATED=y
-CONFIG_SYSFS_DEPRECATED_V2=y
-# CONFIG_RELAY is not set
-CONFIG_NAMESPACES=y
-# CONFIG_UTS_NS is not set
-# CONFIG_IPC_NS is not set
-# CONFIG_USER_NS is not set
-# CONFIG_PID_NS is not set
-CONFIG_BLK_DEV_INITRD=y
-CONFIG_INITRAMFS_SOURCE=""
-CONFIG_CC_OPTIMIZE_FOR_SIZE=y
-CONFIG_SYSCTL=y
-CONFIG_ANON_INODES=y
-# CONFIG_EMBEDDED is not set
-CONFIG_UID16=y
-CONFIG_SYSCTL_SYSCALL=y
-CONFIG_KALLSYMS=y
-CONFIG_KALLSYMS_EXTRA_PASS=y
-CONFIG_HOTPLUG=y
-CONFIG_PRINTK=y
-CONFIG_BUG=y
-CONFIG_ELF_CORE=y
-CONFIG_BASE_FULL=y
-CONFIG_FUTEX=y
-CONFIG_EPOLL=y
-CONFIG_SIGNALFD=y
-CONFIG_TIMERFD=y
-CONFIG_EVENTFD=y
-CONFIG_SHMEM=y
-CONFIG_AIO=y
-CONFIG_VM_EVENT_COUNTERS=y
-CONFIG_SLUB_DEBUG=y
-CONFIG_COMPAT_BRK=y
-# CONFIG_SLAB is not set
-CONFIG_SLUB=y
-# CONFIG_SLOB is not set
-# CONFIG_PROFILING is not set
-# CONFIG_MARKERS is not set
-CONFIG_HAVE_OPROFILE=y
-# CONFIG_KPROBES is not set
-CONFIG_HAVE_KPROBES=y
-CONFIG_HAVE_KRETPROBES=y
-CONFIG_HAVE_GENERIC_DMA_COHERENT=y
-CONFIG_SLABINFO=y
-CONFIG_RT_MUTEXES=y
-# CONFIG_TINY_SHMEM is not set
-CONFIG_BASE_SMALL=0
-CONFIG_MODULES=y
-# CONFIG_MODULE_FORCE_LOAD is not set
-CONFIG_MODULE_UNLOAD=y
-# CONFIG_MODULE_FORCE_UNLOAD is not set
-# CONFIG_MODVERSIONS is not set
-# CONFIG_MODULE_SRCVERSION_ALL is not set
-CONFIG_KMOD=y
-CONFIG_BLOCK=y
-# CONFIG_LBD is not set
-# CONFIG_BLK_DEV_IO_TRACE is not set
-# CONFIG_LSF is not set
-# CONFIG_BLK_DEV_BSG is not set
-# CONFIG_BLK_DEV_INTEGRITY is not set
-
-#
-# IO Schedulers
-#
-CONFIG_IOSCHED_NOOP=y
-CONFIG_IOSCHED_AS=y
-CONFIG_IOSCHED_DEADLINE=y
-CONFIG_IOSCHED_CFQ=y
-# CONFIG_DEFAULT_AS is not set
-# CONFIG_DEFAULT_DEADLINE is not set
-CONFIG_DEFAULT_CFQ=y
-# CONFIG_DEFAULT_NOOP is not set
-CONFIG_DEFAULT_IOSCHED="cfq"
-CONFIG_CLASSIC_RCU=y
-CONFIG_FREEZER=y
-
-#
-# System Type
-#
-CONFIG_ARCH_ASPEED=y
-# CONFIG_ARCH_AAEC2000 is not set
-# CONFIG_ARCH_INTEGRATOR is not set
-# CONFIG_ARCH_REALVIEW is not set
-# CONFIG_ARCH_VERSATILE is not set
-# CONFIG_ARCH_AT91 is not set
-# CONFIG_ARCH_CLPS7500 is not set
-# CONFIG_ARCH_CLPS711X is not set
-# CONFIG_ARCH_EBSA110 is not set
-# CONFIG_ARCH_EP93XX is not set
-# CONFIG_ARCH_FOOTBRIDGE is not set
-# CONFIG_ARCH_NETX is not set
-# CONFIG_ARCH_H720X is not set
-# CONFIG_ARCH_IMX is not set
-# CONFIG_ARCH_IOP13XX is not set
-# CONFIG_ARCH_IOP32X is not set
-# CONFIG_ARCH_IOP33X is not set
-# CONFIG_ARCH_IXP23XX is not set
-# CONFIG_ARCH_IXP2000 is not set
-# CONFIG_ARCH_IXP4XX is not set
-# CONFIG_ARCH_L7200 is not set
-# CONFIG_ARCH_KIRKWOOD is not set
-# CONFIG_ARCH_KS8695 is not set
-# CONFIG_ARCH_NS9XXX is not set
-# CONFIG_ARCH_LOKI is not set
-# CONFIG_ARCH_MV78XX0 is not set
-# CONFIG_ARCH_MXC is not set
-# CONFIG_ARCH_ORION5X is not set
-# CONFIG_ARCH_PNX4008 is not set
-# CONFIG_ARCH_PXA is not set
-# CONFIG_ARCH_RPC is not set
-# CONFIG_ARCH_SA1100 is not set
-# CONFIG_ARCH_S3C2410 is not set
-# CONFIG_ARCH_SHARK is not set
-# CONFIG_ARCH_LH7A40X is not set
-# CONFIG_ARCH_DAVINCI is not set
-# CONFIG_ARCH_OMAP is not set
-# CONFIG_ARCH_MSM is not set
-CONFIG_IRMP=y
-# CONFIG_PCEXT is not set
-# CONFIG_REMOTEFX is not set
-# CONFIG_ARCH_AST1100 is not set
-# CONFIG_ARCH_AST2100 is not set
-# CONFIG_ARCH_AST2200 is not set
-# CONFIG_ARCH_AST2300 is not set
-CONFIG_ARCH_AST2400=y
-CONFIG_YOSEMITE=y
-# CONFIG_ARCH_AST2500 is not set
-
-#
-# FLASH Chip Select
-#
-# CONFIG_AST_CS0_NOR is not set
-# CONFIG_AST_CS0_NAND is not set
-CONFIG_AST_CS0_SPI=y
-# CONFIG_AST_CS0_NONE is not set
-# CONFIG_AST_CS1_NOR is not set
-# CONFIG_AST_CS1_NAND is not set
-# CONFIG_AST_CS1_SPI is not set
-CONFIG_AST_CS1_NONE=y
-# CONFIG_AST_CS2_NOR is not set
-# CONFIG_AST_CS2_NAND is not set
-# CONFIG_AST_CS2_SPI is not set
-CONFIG_AST_CS2_NONE=y
-# CONFIG_AST_CS3_NOR is not set
-# CONFIG_AST_CS3_NAND is not set
-# CONFIG_AST_CS3_SPI is not set
-CONFIG_AST_CS3_NONE=y
-# CONFIG_AST_CS4_NOR is not set
-# CONFIG_AST_CS4_NAND is not set
-# CONFIG_AST_CS4_SPI is not set
-CONFIG_AST_CS4_NONE=y
-# CONFIG_ARCH_AST1070 is not set
-# CONFIG_AST_SCU_LOCK is not set
-
-#
-# Boot options
-#
-
-#
-# Power management
-#
-CONFIG_PLAT_ASPEED=y
-
-#
-# Processor Type
-#
-CONFIG_CPU_32=y
-CONFIG_CPU_ARM926T=y
-CONFIG_CPU_32v5=y
-CONFIG_CPU_ABRT_EV5TJ=y
-CONFIG_CPU_PABRT_NOIFAR=y
-CONFIG_CPU_CACHE_VIVT=y
-CONFIG_CPU_COPY_V4WB=y
-CONFIG_CPU_TLB_V4WBI=y
-CONFIG_CPU_CP15=y
-CONFIG_CPU_CP15_MMU=y
-
-#
-# Processor Features
-#
-CONFIG_ARM_THUMB=y
-# CONFIG_CPU_ICACHE_DISABLE is not set
-# CONFIG_CPU_DCACHE_DISABLE is not set
-# CONFIG_CPU_DCACHE_WRITETHROUGH is not set
-# CONFIG_CPU_CACHE_ROUND_ROBIN is not set
-# CONFIG_OUTER_CACHE is not set
-
-#
-# Bus support
-#
-CONFIG_ARM_AMBA=y
-# CONFIG_PCI_SYSCALL is not set
-# CONFIG_ARCH_SUPPORTS_MSI is not set
-# CONFIG_PCCARD is not set
-
-#
-# Kernel Features
-#
-CONFIG_TICK_ONESHOT=y
-CONFIG_NO_HZ=y
-CONFIG_HIGH_RES_TIMERS=y
-CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
-CONFIG_VMSPLIT_3G=y
-# CONFIG_VMSPLIT_2G is not set
-# CONFIG_VMSPLIT_1G is not set
-CONFIG_PAGE_OFFSET=0xC0000000
-# CONFIG_PREEMPT is not set
-CONFIG_HZ=100
-CONFIG_AEABI=y
-CONFIG_OABI_COMPAT=y
-CONFIG_ARCH_FLATMEM_HAS_HOLES=y
-# CONFIG_ARCH_SPARSEMEM_DEFAULT is not set
-# CONFIG_ARCH_SELECT_MEMORY_MODEL is not set
-CONFIG_SELECT_MEMORY_MODEL=y
-CONFIG_FLATMEM_MANUAL=y
-# CONFIG_DISCONTIGMEM_MANUAL is not set
-# CONFIG_SPARSEMEM_MANUAL is not set
-CONFIG_FLATMEM=y
-CONFIG_FLAT_NODE_MEM_MAP=y
-CONFIG_PAGEFLAGS_EXTENDED=y
-CONFIG_SPLIT_PTLOCK_CPUS=4096
-# CONFIG_RESOURCES_64BIT is not set
-# CONFIG_PHYS_ADDR_T_64BIT is not set
-CONFIG_ZONE_DMA_FLAG=0
-CONFIG_VIRT_TO_BUS=y
-CONFIG_UNEVICTABLE_LRU=y
-CONFIG_ALIGNMENT_TRAP=y
-
-#
-# Boot options
-#
-CONFIG_ZBOOT_ROM_TEXT=0
-CONFIG_ZBOOT_ROM_BSS=0
-CONFIG_CMDLINE=""
-# CONFIG_XIP_KERNEL is not set
-# CONFIG_KEXEC is not set
-
-#
-# CPU Power Management
-#
-# CONFIG_CPU_IDLE is not set
-
-#
-# Floating point emulation
-#
-
-#
-# At least one emulation must be selected
-#
-CONFIG_FPE_NWFPE=y
-CONFIG_FPE_NWFPE_XP=y
-# CONFIG_FPE_FASTFPE is not set
-CONFIG_VFP=y
-
-#
-# Userspace binary formats
-#
-CONFIG_BINFMT_ELF=y
-# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
-CONFIG_HAVE_AOUT=y
-CONFIG_BINFMT_AOUT=y
-# CONFIG_BINFMT_MISC is not set
-
-#
-# Power management options
-#
-CONFIG_PM=y
-# CONFIG_PM_DEBUG is not set
-CONFIG_PM_SLEEP=y
-CONFIG_SUSPEND=y
-CONFIG_SUSPEND_FREEZER=y
-# CONFIG_APM_EMULATION is not set
-CONFIG_ARCH_SUSPEND_POSSIBLE=y
-CONFIG_NET=y
-
-#
-# Networking options
-#
-CONFIG_PACKET=y
-# CONFIG_PACKET_MMAP is not set
-CONFIG_UNIX=y
-CONFIG_XFRM=y
-# CONFIG_XFRM_USER is not set
-# CONFIG_XFRM_SUB_POLICY is not set
-# CONFIG_XFRM_MIGRATE is not set
-# CONFIG_XFRM_STATISTICS is not set
-# CONFIG_NET_KEY is not set
-CONFIG_INET=y
-CONFIG_IP_MULTICAST=y
-# CONFIG_IP_ADVANCED_ROUTER is not set
-CONFIG_IP_FIB_HASH=y
-CONFIG_IP_PNP=y
-CONFIG_IP_PNP_DHCP=y
-CONFIG_IP_PNP_BOOTP=y
-# CONFIG_IP_PNP_RARP is not set
-# CONFIG_NET_IPIP is not set
-# CONFIG_NET_IPGRE is not set
-# CONFIG_IP_MROUTE is not set
-# CONFIG_ARPD is not set
-# CONFIG_SYN_COOKIES is not set
-# CONFIG_INET_AH is not set
-# CONFIG_INET_ESP is not set
-# CONFIG_INET_IPCOMP is not set
-# CONFIG_INET_XFRM_TUNNEL is not set
-CONFIG_INET_TUNNEL=m
-CONFIG_INET_XFRM_MODE_TRANSPORT=y
-CONFIG_INET_XFRM_MODE_TUNNEL=y
-CONFIG_INET_XFRM_MODE_BEET=y
-# CONFIG_INET_LRO is not set
-CONFIG_INET_DIAG=y
-CONFIG_INET_TCP_DIAG=y
-# CONFIG_TCP_CONG_ADVANCED is not set
-CONFIG_TCP_CONG_CUBIC=y
-CONFIG_DEFAULT_TCP_CONG="cubic"
-# CONFIG_TCP_MD5SIG is not set
-CONFIG_IPV6=m
-# CONFIG_IPV6_PRIVACY is not set
-# CONFIG_IPV6_ROUTER_PREF is not set
-# CONFIG_IPV6_OPTIMISTIC_DAD is not set
-# CONFIG_INET6_AH is not set
-# CONFIG_INET6_ESP is not set
-# CONFIG_INET6_IPCOMP is not set
-# CONFIG_IPV6_MIP6 is not set
-# CONFIG_INET6_XFRM_TUNNEL is not set
-# CONFIG_INET6_TUNNEL is not set
-CONFIG_INET6_XFRM_MODE_TRANSPORT=m
-CONFIG_INET6_XFRM_MODE_TUNNEL=m
-CONFIG_INET6_XFRM_MODE_BEET=m
-# CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION is not set
-CONFIG_IPV6_SIT=m
-CONFIG_IPV6_NDISC_NODETYPE=y
-# CONFIG_IPV6_TUNNEL is not set
-# CONFIG_IPV6_MULTIPLE_TABLES is not set
-# CONFIG_IPV6_MROUTE is not set
-# CONFIG_NETWORK_SECMARK is not set
-# CONFIG_NETFILTER is not set
-# CONFIG_IP_DCCP is not set
-# CONFIG_IP_SCTP is not set
-# CONFIG_TIPC is not set
-# CONFIG_ATM is not set
-# CONFIG_BRIDGE is not set
-# CONFIG_NET_DSA is not set
-CONFIG_VLAN_8021Q=m
-# CONFIG_VLAN_8021Q_GVRP is not set
-# CONFIG_DECNET is not set
-# CONFIG_LLC2 is not set
-# CONFIG_IPX is not set
-# CONFIG_ATALK is not set
-# CONFIG_X25 is not set
-# CONFIG_LAPB is not set
-# CONFIG_ECONET is not set
-CONFIG_WAN_ROUTER=y
-# CONFIG_NET_SCHED is not set
-
-#
-# Network testing
-#
-# CONFIG_NET_PKTGEN is not set
-# CONFIG_HAMRADIO is not set
-# CONFIG_CAN is not set
-# CONFIG_IRDA is not set
-# CONFIG_BT is not set
-# CONFIG_AF_RXRPC is not set
-# CONFIG_PHONET is not set
-# CONFIG_WIRELESS is not set
-# CONFIG_RFKILL is not set
-# CONFIG_NET_9P is not set
-
-#
-# Device Drivers
-#
-
-#
-# Generic Driver Options
-#
-CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
-CONFIG_STANDALONE=y
-CONFIG_PREVENT_FIRMWARE_BUILD=y
-CONFIG_FW_LOADER=y
-CONFIG_FIRMWARE_IN_KERNEL=y
-CONFIG_EXTRA_FIRMWARE=""
-# CONFIG_SYS_HYPERVISOR is not set
-CONFIG_CONNECTOR=y
-CONFIG_PROC_EVENTS=y
-CONFIG_MTD=y
-# CONFIG_MTD_DEBUG is not set
-CONFIG_MTD_CONCAT=y
-CONFIG_MTD_PARTITIONS=y
-# CONFIG_MTD_REDBOOT_PARTS is not set
-CONFIG_MTD_CMDLINE_PARTS=y
-# CONFIG_MTD_AFS_PARTS is not set
-# CONFIG_MTD_AR7_PARTS is not set
-
-#
-# User Modules And Translation Layers
-#
-CONFIG_MTD_CHAR=y
-CONFIG_MTD_BLKDEVS=y
-CONFIG_MTD_BLOCK=y
-# CONFIG_FTL is not set
-# CONFIG_NFTL is not set
-# CONFIG_INFTL is not set
-# CONFIG_RFD_FTL is not set
-# CONFIG_SSFDC is not set
-# CONFIG_MTD_OOPS is not set
-
-#
-# RAM/ROM/Flash chip drivers
-#
-# CONFIG_MTD_CFI is not set
-# CONFIG_MTD_JEDECPROBE is not set
-CONFIG_MTD_MAP_BANK_WIDTH_1=y
-CONFIG_MTD_MAP_BANK_WIDTH_2=y
-CONFIG_MTD_MAP_BANK_WIDTH_4=y
-# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
-# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
-# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
-CONFIG_MTD_CFI_I1=y
-CONFIG_MTD_CFI_I2=y
-# CONFIG_MTD_CFI_I4 is not set
-# CONFIG_MTD_CFI_I8 is not set
-# CONFIG_MTD_RAM is not set
-# CONFIG_MTD_ROM is not set
-# CONFIG_MTD_ABSENT is not set
-
-#
-# Mapping drivers for chip access
-#
-# CONFIG_MTD_COMPLEX_MAPPINGS is not set
-# CONFIG_MTD_PLATRAM is not set
-
-#
-# Self-contained MTD device drivers
-#
-CONFIG_MTD_DATAFLASH=m
-CONFIG_MTD_DATAFLASH_WRITE_VERIFY=y
-# CONFIG_MTD_DATAFLASH_OTP is not set
-CONFIG_MTD_M25P80=y
-CONFIG_M25PXX_USE_FAST_READ=y
-# CONFIG_MTD_SLRAM is not set
-# CONFIG_MTD_PHRAM is not set
-# CONFIG_MTD_MTDRAM is not set
-# CONFIG_MTD_BLOCK2MTD is not set
-
-#
-# Disk-On-Chip Device Drivers
-#
-# CONFIG_MTD_DOC2000 is not set
-# CONFIG_MTD_DOC2001 is not set
-# CONFIG_MTD_DOC2001PLUS is not set
-# CONFIG_MTD_NAND is not set
-# CONFIG_MTD_ONENAND is not set
-
-#
-# UBI - Unsorted block images
-#
-# CONFIG_MTD_UBI is not set
-# CONFIG_PARPORT is not set
-CONFIG_BLK_DEV=y
-# CONFIG_BLK_DEV_COW_COMMON is not set
-CONFIG_BLK_DEV_LOOP=y
-# CONFIG_BLK_DEV_CRYPTOLOOP is not set
-CONFIG_BLK_DEV_NBD=y
-# CONFIG_BLK_DEV_UB is not set
-CONFIG_BLK_DEV_RAM=y
-CONFIG_BLK_DEV_RAM_COUNT=16
-CONFIG_BLK_DEV_RAM_SIZE=16384
-# CONFIG_BLK_DEV_XIP is not set
-# CONFIG_RD_BZIP2 is not set
-CONFIG_RD_LZMA=y
-CONFIG_RD_GZIP=y
-# CONFIG_CDROM_PKTCDVD is not set
-# CONFIG_ATA_OVER_ETH is not set
-CONFIG_MISC_DEVICES=y
-# CONFIG_EEPROM_93CX6 is not set
-# CONFIG_ICS932S401 is not set
-# CONFIG_ENCLOSURE_SERVICES is not set
-# CONFIG_C2PORT is not set
-CONFIG_HAVE_IDE=y
-# CONFIG_IDE is not set
-
-#
-# SCSI device support
-#
-# CONFIG_RAID_ATTRS is not set
-CONFIG_SCSI=y
-CONFIG_SCSI_DMA=y
-CONFIG_SCSI_TGT=y
-# CONFIG_SCSI_NETLINK is not set
-CONFIG_SCSI_PROC_FS=y
-
-#
-# SCSI support type (disk, tape, CD-ROM)
-#
-CONFIG_BLK_DEV_SD=y
-# CONFIG_CHR_DEV_ST is not set
-# CONFIG_CHR_DEV_OSST is not set
-# CONFIG_BLK_DEV_SR is not set
-CONFIG_CHR_DEV_SG=y
-# CONFIG_CHR_DEV_SCH is not set
-
-#
-# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
-#
-# CONFIG_SCSI_MULTI_LUN is not set
-# CONFIG_SCSI_CONSTANTS is not set
-# CONFIG_SCSI_LOGGING is not set
-CONFIG_SCSI_SCAN_ASYNC=y
-CONFIG_SCSI_WAIT_SCAN=m
-
-#
-# SCSI Transports
-#
-# CONFIG_SCSI_SPI_ATTRS is not set
-# CONFIG_SCSI_FC_ATTRS is not set
-CONFIG_SCSI_ISCSI_ATTRS=m
-# CONFIG_SCSI_SAS_LIBSAS is not set
-# CONFIG_SCSI_SRP_ATTRS is not set
-# CONFIG_SCSI_LOWLEVEL is not set
-# CONFIG_SCSI_DH is not set
-# CONFIG_ATA is not set
-# CONFIG_MD is not set
-CONFIG_NETDEVICES=y
-# CONFIG_DUMMY is not set
-CONFIG_BONDING=m
-# CONFIG_MACVLAN is not set
-# CONFIG_EQUALIZER is not set
-CONFIG_TUN=m
-# CONFIG_VETH is not set
-# CONFIG_NET_ETHERNET is not set
-CONFIG_NETDEV_1000=y
-CONFIG_ASPEEDMAC=y
-# CONFIG_NETDEV_10000 is not set
-
-#
-# Wireless LAN
-#
-# CONFIG_WLAN_PRE80211 is not set
-# CONFIG_WLAN_80211 is not set
-# CONFIG_IWLWIFI_LEDS is not set
-
-#
-# USB Network Adapters
-#
-# CONFIG_USB_CATC is not set
-# CONFIG_USB_KAWETH is not set
-# CONFIG_USB_PEGASUS is not set
-# CONFIG_USB_RTL8150 is not set
-# CONFIG_USB_USBNET is not set
-# CONFIG_WAN is not set
-# CONFIG_PPP is not set
-# CONFIG_SLIP is not set
-# CONFIG_NETCONSOLE is not set
-# CONFIG_NETPOLL is not set
-# CONFIG_NET_POLL_CONTROLLER is not set
-# CONFIG_ISDN is not set
-
-#
-# Input device support
-#
-CONFIG_INPUT=y
-# CONFIG_INPUT_FF_MEMLESS is not set
-# CONFIG_INPUT_POLLDEV is not set
-
-#
-# Userland interfaces
-#
-CONFIG_INPUT_MOUSEDEV=y
-CONFIG_INPUT_MOUSEDEV_PSAUX=y
-CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
-CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
-# CONFIG_INPUT_JOYDEV is not set
-CONFIG_INPUT_EVDEV=y
-# CONFIG_INPUT_EVBUG is not set
-
-#
-# Input Device Drivers
-#
-CONFIG_INPUT_KEYBOARD=y
-CONFIG_KEYBOARD_ATKBD=y
-# CONFIG_KEYBOARD_SUNKBD is not set
-# CONFIG_KEYBOARD_LKKBD is not set
-# CONFIG_KEYBOARD_XTKBD is not set
-# CONFIG_KEYBOARD_NEWTON is not set
-# CONFIG_KEYBOARD_STOWAWAY is not set
-# CONFIG_KEYBOARD_GPIO is not set
-CONFIG_INPUT_MOUSE=y
-CONFIG_MOUSE_PS2=y
-CONFIG_MOUSE_PS2_ALPS=y
-CONFIG_MOUSE_PS2_LOGIPS2PP=y
-CONFIG_MOUSE_PS2_SYNAPTICS=y
-CONFIG_MOUSE_PS2_LIFEBOOK=y
-CONFIG_MOUSE_PS2_TRACKPOINT=y
-# CONFIG_MOUSE_PS2_ELANTECH is not set
-# CONFIG_MOUSE_PS2_TOUCHKIT is not set
-CONFIG_MOUSE_SERIAL=y
-# CONFIG_MOUSE_APPLETOUCH is not set
-# CONFIG_MOUSE_BCM5974 is not set
-# CONFIG_MOUSE_VSXXXAA is not set
-# CONFIG_MOUSE_GPIO is not set
-# CONFIG_INPUT_JOYSTICK is not set
-# CONFIG_INPUT_TABLET is not set
-# CONFIG_INPUT_TOUCHSCREEN is not set
-# CONFIG_INPUT_MISC is not set
-
-#
-# Hardware I/O ports
-#
-CONFIG_SERIO=y
-CONFIG_SERIO_SERPORT=y
-# CONFIG_SERIO_AMBAKMI is not set
-CONFIG_SERIO_LIBPS2=y
-# CONFIG_SERIO_RAW is not set
-# CONFIG_GAMEPORT is not set
-
-#
-# Character devices
-#
-CONFIG_VT=y
-CONFIG_CONSOLE_TRANSLATIONS=y
-CONFIG_VT_CONSOLE=y
-CONFIG_HW_CONSOLE=y
-# CONFIG_VT_HW_CONSOLE_BINDING is not set
-CONFIG_DEVKMEM=y
-CONFIG_SERIAL_NONSTANDARD=y
-# CONFIG_N_HDLC is not set
-# CONFIG_RISCOM8 is not set
-# CONFIG_SPECIALIX is not set
-# CONFIG_RIO is not set
-# CONFIG_STALDRV is not set
-
-#
-# Serial drivers
-#
-CONFIG_SERIAL_8250=y
-CONFIG_SERIAL_8250_CONSOLE=y
-CONFIG_SERIAL_8250_NR_UARTS=5
-CONFIG_SERIAL_8250_RUNTIME_UARTS=5
-# CONFIG_SERIAL_AST_DMA_UART is not set
-# CONFIG_SERIAL_8250_EXTENDED is not set
-
-#
-# Non-8250 serial port support
-#
-# CONFIG_SERIAL_AMBA_PL010 is not set
-# CONFIG_SERIAL_AMBA_PL011 is not set
-# CONFIG_SERIAL_AST is not set
-CONFIG_SERIAL_CORE=y
-CONFIG_SERIAL_CORE_CONSOLE=y
-CONFIG_UNIX98_PTYS=y
-CONFIG_LEGACY_PTYS=y
-CONFIG_LEGACY_PTY_COUNT=256
-# CONFIG_IPMI_HANDLER is not set
-CONFIG_AST_MISC=y
-# CONFIG_AST_VIDEO is not set
-# CONFIG_ADC_CAT9883 is not set
-# CONFIG_AST_SPI_BIOS is not set
-CONFIG_AST_PECI=y
-# CONFIG_AST_KCS is not set
-# CONFIG_AST_GPIO is not set
-# CONFIG_HW_RANDOM is not set
-CONFIG_NVRAM=y
-# CONFIG_R3964 is not set
-# CONFIG_RAW_DRIVER is not set
-# CONFIG_TCG_TPM is not set
-CONFIG_I2C=y
-CONFIG_I2C_BOARDINFO=y
-CONFIG_I2C_CHARDEV=y
-CONFIG_I2C_HELPER_AUTO=y
-
-#
-# I2C Hardware Bus support
-#
-
-#
-# I2C system bus drivers (mostly embedded / system-on-chip)
-#
-# CONFIG_I2C_GPIO is not set
-# CONFIG_I2C_OCORES is not set
-CONFIG_I2C_AST=y
-CONFIG_AST_I2C_SLAVE_MODE=y
-# CONFIG_AST_I2C_SLAVE_EEPROM is not set
-CONFIG_AST_I2C_SLAVE_RDWR=y
-# CONFIG_I2C_SIMTEC is not set
-
-#
-# External I2C/SMBus adapter drivers
-#
-# CONFIG_I2C_PARPORT_LIGHT is not set
-# CONFIG_I2C_TAOS_EVM is not set
-# CONFIG_I2C_TINY_USB is not set
-
-#
-# Other I2C/SMBus bus drivers
-#
-# CONFIG_I2C_PCA_PLATFORM is not set
-# CONFIG_I2C_STUB is not set
-
-#
-# Miscellaneous I2C Chip support
-#
-# CONFIG_DS1682 is not set
-CONFIG_AT24=m
-# CONFIG_SENSORS_EEPROM is not set
-CONFIG_SENSORS_PCF8574=m
-# CONFIG_PCF8575 is not set
-# CONFIG_SENSORS_PCA9539 is not set
-# CONFIG_SENSORS_PCF8591 is not set
-# CONFIG_TPS65010 is not set
-# CONFIG_SENSORS_MAX6875 is not set
-# CONFIG_SENSORS_TSL2550 is not set
-# CONFIG_I2C_DEBUG_CORE is not set
-# CONFIG_I2C_DEBUG_ALGO is not set
-# CONFIG_I2C_DEBUG_BUS is not set
-# CONFIG_I2C_DEBUG_CHIP is not set
-CONFIG_SPI=y
-CONFIG_SPI_MASTER=y
-
-#
-# SPI Master Controller Drivers
-#
-CONFIG_SPI_AST=y
-CONFIG_SPI_FMC=y
-CONFIG_SPI_BITBANG=y
-
-#
-# SPI Protocol Masters
-#
-CONFIG_SPI_AT25=m
-# CONFIG_SPI_SPIDEV is not set
-# CONFIG_SPI_TLE62X0 is not set
-CONFIG_ARCH_REQUIRE_GPIOLIB=y
-CONFIG_GPIOLIB=y
-CONFIG_GPIO_SYSFS=y
-
-#
-# Memory mapped GPIO expanders:
-#
-
-#
-# I2C GPIO expanders:
-#
-# CONFIG_GPIO_MAX732X is not set
-# CONFIG_GPIO_PCA953X is not set
-# CONFIG_GPIO_PCF857X is not set
-
-#
-# PCI GPIO expanders:
-#
-
-#
-# SPI GPIO expanders:
-#
-# CONFIG_GPIO_MAX7301 is not set
-# CONFIG_GPIO_MCP23S08 is not set
-# CONFIG_W1 is not set
-# CONFIG_POWER_SUPPLY is not set
-CONFIG_HWMON=y
-# CONFIG_HWMON_VID is not set
-# CONFIG_SENSORS_AD7414 is not set
-# CONFIG_SENSORS_AD7418 is not set
-# CONFIG_SENSORS_ADCXX is not set
-# CONFIG_SENSORS_ADM1021 is not set
-# CONFIG_SENSORS_ADM1025 is not set
-# CONFIG_SENSORS_ADM1026 is not set
-# CONFIG_SENSORS_ADM1029 is not set
-# CONFIG_SENSORS_ADM1031 is not set
-# CONFIG_SENSORS_ADM9240 is not set
-# CONFIG_SENSORS_ADT7462 is not set
-# CONFIG_SENSORS_ADT7470 is not set
-# CONFIG_SENSORS_ADT7473 is not set
-# CONFIG_SENSORS_ATXP1 is not set
-# CONFIG_SENSORS_DS1621 is not set
-# CONFIG_SENSORS_F71805F is not set
-# CONFIG_SENSORS_F71882FG is not set
-# CONFIG_SENSORS_F75375S is not set
-# CONFIG_SENSORS_GL518SM is not set
-# CONFIG_SENSORS_GL520SM is not set
-# CONFIG_SENSORS_IT87 is not set
-# CONFIG_SENSORS_LM63 is not set
-# CONFIG_SENSORS_LM70 is not set
-CONFIG_SENSORS_LM75=m
-# CONFIG_SENSORS_LM77 is not set
-# CONFIG_SENSORS_LM78 is not set
-# CONFIG_SENSORS_LM80 is not set
-# CONFIG_SENSORS_LM83 is not set
-# CONFIG_SENSORS_LM85 is not set
-# CONFIG_SENSORS_LM87 is not set
-# CONFIG_SENSORS_LM90 is not set
-# CONFIG_SENSORS_LM92 is not set
-# CONFIG_SENSORS_LM93 is not set
-CONFIG_SENSORS_MAX127=m
-# CONFIG_SENSORS_MAX1111 is not set
-# CONFIG_SENSORS_MAX1619 is not set
-# CONFIG_SENSORS_MAX6650 is not set
-# CONFIG_SENSORS_PC87360 is not set
-# CONFIG_SENSORS_PC87427 is not set
-# CONFIG_SENSORS_DME1737 is not set
-# CONFIG_SENSORS_SMSC47M1 is not set
-# CONFIG_SENSORS_SMSC47M192 is not set
-# CONFIG_SENSORS_SMSC47B397 is not set
-CONFIG_SENSORS_ADS7828=m
-# CONFIG_SENSORS_THMC50 is not set
-# CONFIG_SENSORS_VT1211 is not set
-# CONFIG_SENSORS_W83781D is not set
-# CONFIG_SENSORS_W83791D is not set
-# CONFIG_SENSORS_W83792D is not set
-# CONFIG_SENSORS_W83793 is not set
-# CONFIG_SENSORS_W83L785TS is not set
-# CONFIG_SENSORS_W83L786NG is not set
-# CONFIG_SENSORS_W83627HF is not set
-# CONFIG_SENSORS_W83627EHF is not set
-CONFIG_SENSORS_AST_ADC=y
-CONFIG_SENSORS_AST_PWM_FAN=y
-# CONFIG_SENSORS_FB_PANTHER_PLUS is not set
-CONFIG_PMBUS=m
-CONFIG_SENSORS_PMBUS=m
-CONFIG_SENSORS_ADM1275=m
-# CONFIG_SENSORS_LM25066 is not set
-# CONFIG_SENSORS_LTC2978 is not set
-# CONFIG_SENSORS_MAX16064 is not set
-# CONFIG_SENSORS_MAX34440 is not set
-# CONFIG_SENSORS_MAX8688 is not set
-CONFIG_SENSORS_PFE1100=m
-CONFIG_SENSORS_PFE3000=m
-# CONFIG_SENSORS_UCD9000 is not set
-# CONFIG_SENSORS_UCD9200 is not set
-# CONFIG_SENSORS_ZL6100 is not set
-# CONFIG_HWMON_DEBUG_CHIP is not set
-CONFIG_THERMAL=y
-CONFIG_THERMAL_HWMON=y
-CONFIG_WATCHDOG=y
-# CONFIG_WATCHDOG_NOWAYOUT is not set
-
-#
-# Watchdog Device Drivers
-#
-# CONFIG_SOFT_WATCHDOG is not set
-CONFIG_AST_WATCHDOG=y
-
-#
-# USB-based Watchdog Cards
-#
-# CONFIG_USBPCWATCHDOG is not set
-CONFIG_SSB_POSSIBLE=y
-
-#
-# Sonics Silicon Backplane
-#
-# CONFIG_SSB is not set
-
-#
-# Multifunction device drivers
-#
-# CONFIG_MFD_CORE is not set
-# CONFIG_MFD_SM501 is not set
-# CONFIG_MFD_ASIC3 is not set
-# CONFIG_HTC_EGPIO is not set
-# CONFIG_HTC_PASIC3 is not set
-# CONFIG_MFD_TMIO is not set
-# CONFIG_MFD_TC6393XB is not set
-# CONFIG_PMIC_DA903X is not set
-# CONFIG_MFD_WM8400 is not set
-# CONFIG_MFD_WM8350_I2C is not set
-
-#
-# Multimedia devices
-#
-
-#
-# Multimedia core support
-#
-# CONFIG_VIDEO_DEV is not set
-# CONFIG_DVB_CORE is not set
-# CONFIG_VIDEO_MEDIA is not set
-
-#
-# Multimedia drivers
-#
-# CONFIG_DAB is not set
-
-#
-# Graphics support
-#
-# CONFIG_VGASTATE is not set
-# CONFIG_VIDEO_OUTPUT_CONTROL is not set
-# CONFIG_FB is not set
-# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
-
-#
-# Display device support
-#
-# CONFIG_DISPLAY_SUPPORT is not set
-
-#
-# Console display driver support
-#
-# CONFIG_VGA_CONSOLE is not set
-CONFIG_DUMMY_CONSOLE=y
-# CONFIG_SOUND is not set
-# CONFIG_HID_SUPPORT is not set
-CONFIG_USB_SUPPORT=y
-CONFIG_USB_ARCH_HAS_HCD=y
-# CONFIG_USB_ARCH_HAS_OHCI is not set
-CONFIG_USB_ARCH_HAS_EHCI=y
-CONFIG_USB=m
-# CONFIG_USB_DEBUG is not set
-# CONFIG_USB_ANNOUNCE_NEW_DEVICES is not set
-
-#
-# Miscellaneous USB options
-#
-CONFIG_USB_DEVICEFS=y
-CONFIG_USB_DEVICE_CLASS=y
-# CONFIG_USB_DYNAMIC_MINORS is not set
-# CONFIG_USB_SUSPEND is not set
-# CONFIG_USB_OTG is not set
-# CONFIG_USB_MON is not set
-# CONFIG_USB_WUSB is not set
-# CONFIG_USB_WUSB_CBAF is not set
-
-#
-# USB Host Controller Drivers
-#
-# CONFIG_USB_C67X00_HCD is not set
-# CONFIG_USB_EHCI_HCD is not set
-# CONFIG_USB_ISP116X_HCD is not set
-# CONFIG_USB_SL811_HCD is not set
-# CONFIG_USB_R8A66597_HCD is not set
-# CONFIG_USB_HWA_HCD is not set
-
-#
-# AST USB Drivers
-#
-CONFIG_AST_USB_UHCI_HCD=y
-# CONFIG_AST_USB_UHCI_MULTIPORT_1 is not set
-# CONFIG_AST_USB_UHCI_MULTIPORT_2 is not set
-CONFIG_AST_USB_UHCI_MULTIPORT_4=y
-# CONFIG_USB_EHCI_SPLIT_ISO is not set
-
-#
-# USB Device Class drivers
-#
-# CONFIG_USB_ACM is not set
-# CONFIG_USB_PRINTER is not set
-# CONFIG_USB_WDM is not set
-# CONFIG_USB_TMC is not set
-
-#
-# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may also be needed;
-#
-
-#
-# see USB_STORAGE Help for more information
-#
-CONFIG_USB_STORAGE=m
-# CONFIG_USB_STORAGE_DEBUG is not set
-# CONFIG_USB_STORAGE_DATAFAB is not set
-# CONFIG_USB_STORAGE_FREECOM is not set
-# CONFIG_USB_STORAGE_ISD200 is not set
-# CONFIG_USB_STORAGE_DPCM is not set
-# CONFIG_USB_STORAGE_USBAT is not set
-# CONFIG_USB_STORAGE_SDDR09 is not set
-# CONFIG_USB_STORAGE_SDDR55 is not set
-# CONFIG_USB_STORAGE_JUMPSHOT is not set
-# CONFIG_USB_STORAGE_ALAUDA is not set
-# CONFIG_USB_STORAGE_ONETOUCH is not set
-# CONFIG_USB_STORAGE_KARMA is not set
-# CONFIG_USB_STORAGE_CYPRESS_ATACB is not set
-# CONFIG_USB_LIBUSUAL is not set
-
-#
-# USB Imaging devices
-#
-# CONFIG_USB_MDC800 is not set
-# CONFIG_USB_MICROTEK is not set
-
-#
-# USB port drivers
-#
-# CONFIG_USB_SERIAL is not set
-
-#
-# USB Miscellaneous drivers
-#
-# CONFIG_USB_EMI62 is not set
-# CONFIG_USB_EMI26 is not set
-# CONFIG_USB_ADUTUX is not set
-# CONFIG_USB_SEVSEG is not set
-# CONFIG_USB_RIO500 is not set
-# CONFIG_USB_LEGOTOWER is not set
-# CONFIG_USB_LCD is not set
-# CONFIG_USB_BERRY_CHARGE is not set
-# CONFIG_USB_LED is not set
-# CONFIG_USB_CYPRESS_CY7C63 is not set
-# CONFIG_USB_CYTHERM is not set
-# CONFIG_USB_PHIDGET is not set
-# CONFIG_USB_IDMOUSE is not set
-# CONFIG_USB_FTDI_ELAN is not set
-# CONFIG_USB_APPLEDISPLAY is not set
-# CONFIG_USB_LD is not set
-# CONFIG_USB_TRANCEVIBRATOR is not set
-# CONFIG_USB_IOWARRIOR is not set
-# CONFIG_USB_TEST is not set
-# CONFIG_USB_ISIGHTFW is not set
-# CONFIG_USB_VST is not set
-CONFIG_USB_GADGET=y
-# CONFIG_USB_GADGET_DEBUG_FILES is not set
-CONFIG_USB_GADGET_VBUS_DRAW=2
-CONFIG_USB_GADGET_SELECTED=y
-# CONFIG_USB_GADGET_AT91 is not set
-# CONFIG_USB_GADGET_ATMEL_USBA is not set
-# CONFIG_USB_GADGET_FSL_USB2 is not set
-# CONFIG_USB_GADGET_LH7A40X is not set
-# CONFIG_USB_GADGET_OMAP is not set
-# CONFIG_USB_GADGET_PXA25X is not set
-# CONFIG_USB_GADGET_PXA27X is not set
-# CONFIG_USB_GADGET_S3C2410 is not set
-# CONFIG_USB_GADGET_M66592 is not set
-# CONFIG_USB_GADGET_AMD5536UDC is not set
-# CONFIG_USB_GADGET_FSL_QE is not set
-# CONFIG_USB_GADGET_NET2280 is not set
-# CONFIG_USB_GADGET_GOKU is not set
-CONFIG_USB_GADGET_ASPEED_AST=y
-CONFIG_USB_ASPEED_AST=y
-# CONFIG_USB_GADGET_DUMMY_HCD is not set
-CONFIG_USB_GADGET_DUALSPEED=y
-CONFIG_USB_ZERO=m
-CONFIG_USB_ETH=m
-CONFIG_USB_ETH_RNDIS=y
-CONFIG_USB_GADGETFS=m
-CONFIG_USB_FILE_STORAGE=m
-# CONFIG_USB_FILE_STORAGE_TEST is not set
-CONFIG_USB_G_SERIAL=m
-# CONFIG_USB_MIDI_GADGET is not set
-# CONFIG_USB_G_PRINTER is not set
-CONFIG_USB_CDC_COMPOSITE=m
-# CONFIG_MMC is not set
-# CONFIG_MEMSTICK is not set
-# CONFIG_ACCESSIBILITY is not set
-# CONFIG_NEW_LEDS is not set
-CONFIG_RTC_LIB=y
-CONFIG_RTC_CLASS=y
-# CONFIG_RTC_HCTOSYS is not set
-# CONFIG_RTC_DEBUG is not set
-
-#
-# RTC interfaces
-#
-CONFIG_RTC_INTF_SYSFS=y
-CONFIG_RTC_INTF_PROC=y
-CONFIG_RTC_INTF_DEV=y
-# CONFIG_RTC_INTF_DEV_UIE_EMUL is not set
-# CONFIG_RTC_DRV_TEST is not set
-
-#
-# I2C RTC drivers
-#
-# CONFIG_RTC_DRV_DS1307 is not set
-# CONFIG_RTC_DRV_DS1374 is not set
-# CONFIG_RTC_DRV_DS1672 is not set
-# CONFIG_RTC_DRV_MAX6900 is not set
-# CONFIG_RTC_DRV_RS5C372 is not set
-# CONFIG_RTC_DRV_ISL1208 is not set
-# CONFIG_RTC_DRV_X1205 is not set
-# CONFIG_RTC_DRV_PCF8563 is not set
-# CONFIG_RTC_DRV_PCF8583 is not set
-# CONFIG_RTC_DRV_M41T80 is not set
-# CONFIG_RTC_DRV_S35390A is not set
-# CONFIG_RTC_DRV_FM3130 is not set
-# CONFIG_RTC_DRV_RX8581 is not set
-
-#
-# SPI RTC drivers
-#
-# CONFIG_RTC_DRV_M41T94 is not set
-# CONFIG_RTC_DRV_DS1305 is not set
-# CONFIG_RTC_DRV_DS1390 is not set
-# CONFIG_RTC_DRV_MAX6902 is not set
-# CONFIG_RTC_DRV_R9701 is not set
-# CONFIG_RTC_DRV_RS5C348 is not set
-# CONFIG_RTC_DRV_DS3234 is not set
-
-#
-# Platform RTC drivers
-#
-# CONFIG_RTC_DRV_CMOS is not set
-# CONFIG_RTC_DRV_DS1286 is not set
-# CONFIG_RTC_DRV_DS1511 is not set
-# CONFIG_RTC_DRV_DS1553 is not set
-# CONFIG_RTC_DRV_DS1742 is not set
-# CONFIG_RTC_DRV_STK17TA8 is not set
-# CONFIG_RTC_DRV_M48T86 is not set
-# CONFIG_RTC_DRV_M48T35 is not set
-# CONFIG_RTC_DRV_M48T59 is not set
-# CONFIG_RTC_DRV_BQ4802 is not set
-# CONFIG_RTC_DRV_V3020 is not set
-
-#
-# on-CPU RTC drivers
-#
-# CONFIG_RTC_DRV_PL030 is not set
-# CONFIG_RTC_DRV_PL031 is not set
-CONFIG_RTC_DRV_ASPEED=y
-# CONFIG_DMADEVICES is not set
-# CONFIG_REGULATOR is not set
-# CONFIG_UIO is not set
-
-#
-# File systems
-#
-CONFIG_EXT2_FS=y
-CONFIG_EXT2_FS_XATTR=y
-CONFIG_EXT2_FS_POSIX_ACL=y
-CONFIG_EXT2_FS_SECURITY=y
-# CONFIG_EXT2_FS_XIP is not set
-# CONFIG_EXT3_FS is not set
-# CONFIG_EXT4_FS is not set
-CONFIG_FS_MBCACHE=y
-# CONFIG_REISERFS_FS is not set
-# CONFIG_JFS_FS is not set
-CONFIG_FS_POSIX_ACL=y
-CONFIG_FILE_LOCKING=y
-# CONFIG_XFS_FS is not set
-# CONFIG_OCFS2_FS is not set
-CONFIG_DNOTIFY=y
-CONFIG_INOTIFY=y
-CONFIG_INOTIFY_USER=y
-# CONFIG_QUOTA is not set
-# CONFIG_AUTOFS_FS is not set
-# CONFIG_AUTOFS4_FS is not set
-# CONFIG_FUSE_FS is not set
-CONFIG_GENERIC_ACL=y
-
-#
-# CD-ROM/DVD Filesystems
-#
-# CONFIG_ISO9660_FS is not set
-# CONFIG_UDF_FS is not set
-
-#
-# DOS/FAT/NT Filesystems
-#
-CONFIG_FAT_FS=y
-CONFIG_MSDOS_FS=y
-CONFIG_VFAT_FS=y
-CONFIG_FAT_DEFAULT_CODEPAGE=437
-CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
-CONFIG_NTFS_FS=y
-# CONFIG_NTFS_DEBUG is not set
-CONFIG_NTFS_RW=y
-
-#
-# Pseudo filesystems
-#
-CONFIG_PROC_FS=y
-CONFIG_PROC_SYSCTL=y
-CONFIG_PROC_PAGE_MONITOR=y
-CONFIG_SYSFS=y
-CONFIG_TMPFS=y
-CONFIG_TMPFS_POSIX_ACL=y
-# CONFIG_HUGETLB_PAGE is not set
-CONFIG_CONFIGFS_FS=m
-
-#
-# Miscellaneous filesystems
-#
-# CONFIG_ADFS_FS is not set
-# CONFIG_AFFS_FS is not set
-# CONFIG_HFS_FS is not set
-# CONFIG_HFSPLUS_FS is not set
-# CONFIG_BEFS_FS is not set
-# CONFIG_BFS_FS is not set
-# CONFIG_EFS_FS is not set
-CONFIG_YAFFS_FS=y
-CONFIG_YAFFS_YAFFS1=y
-# CONFIG_YAFFS_9BYTE_TAGS is not set
-# CONFIG_YAFFS_DOES_ECC is not set
-CONFIG_YAFFS_YAFFS2=y
-CONFIG_YAFFS_AUTO_YAFFS2=y
-# CONFIG_YAFFS_DISABLE_TAGS_ECC is not set
-# CONFIG_YAFFS_DISABLE_LAZY_LOAD is not set
-# CONFIG_YAFFS_DISABLE_WIDE_TNODES is not set
-# CONFIG_YAFFS_ALWAYS_CHECK_CHUNK_ERASED is not set
-CONFIG_YAFFS_SHORT_NAMES_IN_RAM=y
-# CONFIG_YAFFS_EMPTY_LOST_AND_FOUND is not set
-CONFIG_JFFS2_FS=y
-CONFIG_JFFS2_FS_DEBUG=0
-CONFIG_JFFS2_FS_WRITEBUFFER=y
-# CONFIG_JFFS2_FS_WBUF_VERIFY is not set
-# CONFIG_JFFS2_SUMMARY is not set
-# CONFIG_JFFS2_FS_XATTR is not set
-# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
-CONFIG_JFFS2_ZLIB=y
-# CONFIG_JFFS2_LZO is not set
-CONFIG_JFFS2_RTIME=y
-# CONFIG_JFFS2_RUBIN is not set
-# CONFIG_CRAMFS is not set
-# CONFIG_VXFS_FS is not set
-# CONFIG_MINIX_FS is not set
-# CONFIG_OMFS_FS is not set
-# CONFIG_HPFS_FS is not set
-# CONFIG_QNX4FS_FS is not set
-# CONFIG_ROMFS_FS is not set
-# CONFIG_SYSV_FS is not set
-# CONFIG_UFS_FS is not set
-CONFIG_NETWORK_FILESYSTEMS=y
-CONFIG_NFS_FS=y
-# CONFIG_NFS_V3 is not set
-# CONFIG_NFS_V4 is not set
-CONFIG_ROOT_NFS=y
-# CONFIG_NFSD is not set
-CONFIG_LOCKD=y
-CONFIG_NFS_COMMON=y
-CONFIG_SUNRPC=y
-# CONFIG_SUNRPC_REGISTER_V4 is not set
-# CONFIG_RPCSEC_GSS_KRB5 is not set
-# CONFIG_RPCSEC_GSS_SPKM3 is not set
-# CONFIG_SMB_FS is not set
-# CONFIG_CIFS is not set
-# CONFIG_NCP_FS is not set
-# CONFIG_CODA_FS is not set
-# CONFIG_AFS_FS is not set
-
-#
-# Partition Types
-#
-# CONFIG_PARTITION_ADVANCED is not set
-CONFIG_MSDOS_PARTITION=y
-CONFIG_NLS=y
-CONFIG_NLS_DEFAULT="utf8"
-CONFIG_NLS_CODEPAGE_437=y
-# CONFIG_NLS_CODEPAGE_737 is not set
-# CONFIG_NLS_CODEPAGE_775 is not set
-# CONFIG_NLS_CODEPAGE_850 is not set
-# CONFIG_NLS_CODEPAGE_852 is not set
-# CONFIG_NLS_CODEPAGE_855 is not set
-# CONFIG_NLS_CODEPAGE_857 is not set
-# CONFIG_NLS_CODEPAGE_860 is not set
-# CONFIG_NLS_CODEPAGE_861 is not set
-# CONFIG_NLS_CODEPAGE_862 is not set
-# CONFIG_NLS_CODEPAGE_863 is not set
-# CONFIG_NLS_CODEPAGE_864 is not set
-# CONFIG_NLS_CODEPAGE_865 is not set
-# CONFIG_NLS_CODEPAGE_866 is not set
-# CONFIG_NLS_CODEPAGE_869 is not set
-CONFIG_NLS_CODEPAGE_936=y
-CONFIG_NLS_CODEPAGE_950=y
-CONFIG_NLS_CODEPAGE_932=y
-# CONFIG_NLS_CODEPAGE_949 is not set
-# CONFIG_NLS_CODEPAGE_874 is not set
-# CONFIG_NLS_ISO8859_8 is not set
-# CONFIG_NLS_CODEPAGE_1250 is not set
-# CONFIG_NLS_CODEPAGE_1251 is not set
-CONFIG_NLS_ASCII=y
-CONFIG_NLS_ISO8859_1=y
-# CONFIG_NLS_ISO8859_2 is not set
-# CONFIG_NLS_ISO8859_3 is not set
-# CONFIG_NLS_ISO8859_4 is not set
-# CONFIG_NLS_ISO8859_5 is not set
-# CONFIG_NLS_ISO8859_6 is not set
-# CONFIG_NLS_ISO8859_7 is not set
-# CONFIG_NLS_ISO8859_9 is not set
-# CONFIG_NLS_ISO8859_13 is not set
-# CONFIG_NLS_ISO8859_14 is not set
-# CONFIG_NLS_ISO8859_15 is not set
-# CONFIG_NLS_KOI8_R is not set
-# CONFIG_NLS_KOI8_U is not set
-CONFIG_NLS_UTF8=y
-# CONFIG_DLM is not set
-
-#
-# Kernel hacking
-#
-# CONFIG_PRINTK_TIME is not set
-# CONFIG_ENABLE_WARN_DEPRECATED is not set
-CONFIG_ENABLE_MUST_CHECK=y
-CONFIG_FRAME_WARN=1024
-CONFIG_MAGIC_SYSRQ=y
-# CONFIG_UNUSED_SYMBOLS is not set
-# CONFIG_DEBUG_FS is not set
-# CONFIG_HEADERS_CHECK is not set
-# CONFIG_DEBUG_KERNEL is not set
-# CONFIG_SLUB_DEBUG_ON is not set
-# CONFIG_SLUB_STATS is not set
-CONFIG_DEBUG_BUGVERBOSE=y
-CONFIG_DEBUG_MEMORY_INIT=y
-CONFIG_FRAME_POINTER=y
-# CONFIG_RCU_CPU_STALL_DETECTOR is not set
-# CONFIG_LATENCYTOP is not set
-# CONFIG_SYSCTL_SYSCALL_CHECK is not set
-CONFIG_HAVE_FUNCTION_TRACER=y
-
-#
-# Tracers
-#
-# CONFIG_DYNAMIC_PRINTK_DEBUG is not set
-# CONFIG_SAMPLES is not set
-CONFIG_HAVE_ARCH_KGDB=y
-# CONFIG_DEBUG_USER is not set
-
-#
-# Security options
-#
-# CONFIG_KEYS is not set
-# CONFIG_SECURITY is not set
-# CONFIG_SECURITYFS is not set
-# CONFIG_SECURITY_FILE_CAPABILITIES is not set
-CONFIG_CRYPTO=y
-
-#
-# Crypto core or helper
-#
-# CONFIG_CRYPTO_FIPS is not set
-CONFIG_CRYPTO_ALGAPI=y
-CONFIG_CRYPTO_ALGAPI2=y
-CONFIG_CRYPTO_AEAD=m
-CONFIG_CRYPTO_AEAD2=y
-CONFIG_CRYPTO_BLKCIPHER=y
-CONFIG_CRYPTO_BLKCIPHER2=y
-CONFIG_CRYPTO_HASH=y
-CONFIG_CRYPTO_HASH2=y
-CONFIG_CRYPTO_RNG2=y
-CONFIG_CRYPTO_MANAGER=y
-CONFIG_CRYPTO_MANAGER2=y
-# CONFIG_CRYPTO_GF128MUL is not set
-CONFIG_CRYPTO_NULL=y
-# CONFIG_CRYPTO_CRYPTD is not set
-CONFIG_CRYPTO_AUTHENC=m
-# CONFIG_CRYPTO_TEST is not set
-
-#
-# Authenticated Encryption with Associated Data
-#
-# CONFIG_CRYPTO_CCM is not set
-# CONFIG_CRYPTO_GCM is not set
-# CONFIG_CRYPTO_SEQIV is not set
-
-#
-# Block modes
-#
-CONFIG_CRYPTO_CBC=y
-# CONFIG_CRYPTO_CTR is not set
-# CONFIG_CRYPTO_CTS is not set
-# CONFIG_CRYPTO_ECB is not set
-# CONFIG_CRYPTO_LRW is not set
-# CONFIG_CRYPTO_PCBC is not set
-# CONFIG_CRYPTO_XTS is not set
-
-#
-# Hash modes
-#
-CONFIG_CRYPTO_HMAC=y
-# CONFIG_CRYPTO_XCBC is not set
-
-#
-# Digest
-#
-# CONFIG_CRYPTO_CRC32C is not set
-# CONFIG_CRYPTO_MD4 is not set
-CONFIG_CRYPTO_MD5=y
-# CONFIG_CRYPTO_MICHAEL_MIC is not set
-# CONFIG_CRYPTO_RMD128 is not set
-# CONFIG_CRYPTO_RMD160 is not set
-# CONFIG_CRYPTO_RMD256 is not set
-# CONFIG_CRYPTO_RMD320 is not set
-CONFIG_CRYPTO_SHA1=y
-# CONFIG_CRYPTO_SHA256 is not set
-# CONFIG_CRYPTO_SHA512 is not set
-# CONFIG_CRYPTO_TGR192 is not set
-# CONFIG_CRYPTO_WP512 is not set
-
-#
-# Ciphers
-#
-# CONFIG_CRYPTO_AES is not set
-# CONFIG_CRYPTO_ANUBIS is not set
-# CONFIG_CRYPTO_ARC4 is not set
-# CONFIG_CRYPTO_BLOWFISH is not set
-# CONFIG_CRYPTO_CAMELLIA is not set
-# CONFIG_CRYPTO_CAST5 is not set
-# CONFIG_CRYPTO_CAST6 is not set
-CONFIG_CRYPTO_DES=y
-# CONFIG_CRYPTO_FCRYPT is not set
-# CONFIG_CRYPTO_KHAZAD is not set
-# CONFIG_CRYPTO_SALSA20 is not set
-# CONFIG_CRYPTO_SEED is not set
-# CONFIG_CRYPTO_SERPENT is not set
-# CONFIG_CRYPTO_TEA is not set
-# CONFIG_CRYPTO_TWOFISH is not set
-
-#
-# Compression
-#
-CONFIG_CRYPTO_DEFLATE=m
-# CONFIG_CRYPTO_LZO is not set
-
-#
-# Random Number Generation
-#
-# CONFIG_CRYPTO_ANSI_CPRNG is not set
-# CONFIG_CRYPTO_HW is not set
-
-#
-# Library routines
-#
-CONFIG_BITREVERSE=y
-# CONFIG_CRC_CCITT is not set
-# CONFIG_CRC16 is not set
-# CONFIG_CRC_T10DIF is not set
-CONFIG_CRC_ITU_T=m
-CONFIG_CRC32=y
-# CONFIG_CRC7 is not set
-# CONFIG_LIBCRC32C is not set
-CONFIG_ZLIB_INFLATE=y
-CONFIG_ZLIB_DEFLATE=y
-CONFIG_PLIST=y
-CONFIG_HAS_IOMEM=y
-CONFIG_HAS_IOPORT=y
-CONFIG_HAS_DMA=y
-
-
-# GUC USB Drivers
-#
-CONFIG_GUC_USB_UHCI_HCD=m
-# CONFIG_GUC_USB_UHCI_MULTIPORT_1 is not set
-# CONFIG_GUC_USB_UHCI_MULTIPORT_2 is not set
-CONFIG_GUC_USB_UHCI_MULTIPORT_4=y
-# CONFIG_USB_GADGET_MUSB_HDRC is not set
diff --git a/meta-facebook/meta-yosemite/recipes-kernel/linux/linux-aspeed_2.6%.bbappend b/meta-facebook/meta-yosemite/recipes-kernel/linux/linux-aspeed_2.6%.bbappend
deleted file mode 100644
index 846b197..0000000
--- a/meta-facebook/meta-yosemite/recipes-kernel/linux/linux-aspeed_2.6%.bbappend
+++ /dev/null
@@ -1,8 +0,0 @@
-LINUX_VERSION_EXTENSION = "-yosemite"
-
-COMPATIBLE_MACHINE = "yosemite"
-
-FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
-
-SRC_URI += "file://defconfig \
- "
diff --git a/meta-facebook/meta-yosemite/recipes-yosemite/bic-cached/bic-cached_0.1.bb b/meta-facebook/meta-yosemite/recipes-yosemite/bic-cached/bic-cached_0.1.bb
deleted file mode 100644
index 010e8cf..0000000
--- a/meta-facebook/meta-yosemite/recipes-yosemite/bic-cached/bic-cached_0.1.bb
+++ /dev/null
@@ -1,44 +0,0 @@
-# Copyright 2015-present Facebook. All Rights Reserved.
-
-SUMMARY = "Bridge IC Cache Daemon"
-DESCRIPTION = "Daemon to provide Bridge IC Cache information."
-SECTION = "base"
-PR = "r1"
-LICENSE = "GPLv2"
-LIC_FILES_CHKSUM = "file://bic-cached.c;beginline=5;endline=17;md5=da35978751a9d71b73679307c4d296ec"
-
-
-DEPENDS_append = "libbic update-rc.d-native"
-
-SRC_URI = "file://Makefile \
- file://setup-bic-cached.sh \
- file://bic-cached.c \
- "
-
-S = "${WORKDIR}"
-
-binfiles = "bic-cached"
-
-pkgdir = "bic-cached"
-
-do_install() {
- dst="${D}/usr/local/fbpackages/${pkgdir}"
- bin="${D}/usr/local/bin"
- install -d $dst
- install -d $bin
- install -m 755 bic-cached ${dst}/bic-cached
- ln -snf ../fbpackages/${pkgdir}/bic-cached ${bin}/bic-cached
- install -d ${D}${sysconfdir}/init.d
- install -d ${D}${sysconfdir}/rcS.d
- install -m 755 setup-bic-cached.sh ${D}${sysconfdir}/init.d/setup-bic-cached.sh
- update-rc.d -r ${D} setup-bic-cached.sh start 66 5 .
-}
-
-FBPACKAGEDIR = "${prefix}/local/fbpackages"
-
-FILES_${PN} = "${FBPACKAGEDIR}/bic-cached ${prefix}/local/bin ${sysconfdir} "
-
-# Inhibit complaints about .debug directories:
-
-INHIBIT_PACKAGE_DEBUG_SPLIT = "1"
-INHIBIT_PACKAGE_STRIP = "1"
diff --git a/meta-facebook/meta-yosemite/recipes-yosemite/bic-cached/files/Makefile b/meta-facebook/meta-yosemite/recipes-yosemite/bic-cached/files/Makefile
deleted file mode 100644
index 478b25e..0000000
--- a/meta-facebook/meta-yosemite/recipes-yosemite/bic-cached/files/Makefile
+++ /dev/null
@@ -1,10 +0,0 @@
-# Copyright 2015-present Facebook. All Rights Reserved.
-all: bic-cached
-
-bic-cached: bic-cached.c
- $(CC) -pthread -lbic -std=c99 -o $@ $^ $(LDFLAGS)
-
-.PHONY: clean
-
-clean:
- rm -rf *.o bic-cached
diff --git a/meta-facebook/meta-yosemite/recipes-yosemite/bic-cached/files/bic-cached.c b/meta-facebook/meta-yosemite/recipes-yosemite/bic-cached/files/bic-cached.c
deleted file mode 100644
index 78e443d..0000000
--- a/meta-facebook/meta-yosemite/recipes-yosemite/bic-cached/files/bic-cached.c
+++ /dev/null
@@ -1,133 +0,0 @@
-/*
- *
- * Copyright 2015-present Facebook. All Rights Reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <errno.h>
-#include <syslog.h>
-#include <string.h>
-#include <pthread.h>
-#include <fcntl.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <sys/un.h>
-#include <openbmc/ipmi.h>
-#include <openbmc/ipmb.h>
-#include <facebook/bic.h>
-
-#define LAST_RECORD_ID 0xFFFF
-#define MAX_SENSOR_NUM 0xFF
-#define BYTES_ENTIRE_RECORD 0xFF
-
-void
-fruid_cache_init(uint8_t slot_id) {
- // Initialize Slot0's fruid
- int ret;
- int i;
- char fruid_temp_path[64] = {0};
- char fruid_path[64] = {0};
-
- sprintf(fruid_temp_path, "/tmp/tfruid_slot%d.bin", slot_id);
- sprintf(fruid_path, "/tmp/fruid_slot%d.bin", slot_id);
-
- ret = bic_read_fruid(slot_id, 0, fruid_temp_path);
- if (ret) {
- syslog(LOG_WARNING, "fruid_cache_init: bic_read_fruid returns %d\n", ret);
- }
-
- rename(fruid_temp_path, fruid_path);
-
- return;
-}
-
-void
-sdr_cache_init(uint8_t slot_id) {
- int ret;
- int fd;
- uint8_t rlen;
- uint8_t rbuf[MAX_IPMB_RES_LEN] = {0};
- char *path = NULL;
- char sdr_temp_path[64] = {0};
- char sdr_path[64] = {0};
-
- sprintf(sdr_temp_path, "/tmp/tsdr_slot%d.bin", slot_id);
- sprintf(sdr_path, "/tmp/sdr_slot%d.bin", slot_id);
-
- ipmi_sel_sdr_req_t req;
- ipmi_sel_sdr_res_t *res = (ipmi_sel_sdr_res_t *) rbuf;
-
- req.rsv_id = 0;
- req.rec_id = 0;
- req.offset = 0;
- req.nbytes = BYTES_ENTIRE_RECORD;
-
- // Read Slot0's SDR records and store
- path = sdr_temp_path;
- unlink(path);
- fd = open(path, O_WRONLY | O_CREAT | O_EXCL, 0666);
- if (fd < 0) {
- syslog(LOG_WARNING, "sdr_cache_init: open fails for path: %s\n", path);
- return;
- }
-
- while (1) {
- ret = bic_get_sdr(slot_id, &req, res, &rlen);
- if (ret) {
- syslog(LOG_WARNING, "sdr_cache_init:bic_get_sdr returns %d\n", ret);
- continue;
- }
-
- sdr_full_t *sdr = res->data;
-
- write(fd, sdr, sizeof(sdr_full_t));
-
- req.rec_id = res->next_rec_id;
- if (req.rec_id == LAST_RECORD_ID) {
- // syslog(LOG_INFO, "This record is LAST record\n");
- break;
- }
- }
-
- rename(sdr_temp_path, sdr_path);
-}
-
-int
-main (int argc, char * const argv[])
-{
- int ret;
- ipmi_dev_id_t id = {0};
- uint8_t slot_id;
-
- if (argc != 2) {
- return -1;
- }
-
- slot_id = atoi(argv[1]);
-
- do {
- ret = bic_get_dev_id(slot_id, &id);
- sleep(5);
- } while (ret != 0);
-
- fruid_cache_init(slot_id);
- sdr_cache_init(slot_id);
-
- return 0;
-}
diff --git a/meta-facebook/meta-yosemite/recipes-yosemite/bic-cached/files/setup-bic-cached.sh b/meta-facebook/meta-yosemite/recipes-yosemite/bic-cached/files/setup-bic-cached.sh
deleted file mode 100644
index 45eb1e3..0000000
--- a/meta-facebook/meta-yosemite/recipes-yosemite/bic-cached/files/setup-bic-cached.sh
+++ /dev/null
@@ -1,33 +0,0 @@
-#!/bin/sh
-#
-# Copyright 2015-present Facebook. All Rights Reserved.
-#
-### BEGIN INIT INFO
-# Provides: setup-bic-cached
-# Required-Start:
-# Required-Stop:
-# Default-Start: S
-# Default-Stop:
-# Short-Description: Set Cachcing for Bridge IC info
-### END INIT INFO
-
-. /usr/local/fbpackages/utils/ast-functions
-
-echo -n "Setup Caching for Bridge IC info.."
-if [ $(is_server_prsnt 1) == "1" ]; then
- /usr/local/bin/bic-cached 1 > /dev/null 2>&1 &
-fi
-
-if [ $(is_server_prsnt 2) == "1" ]; then
-/usr/local/bin/bic-cached 2 > /dev/null 2>&1 &
-fi
-
-if [ $(is_server_prsnt 3) == "1" ]; then
-/usr/local/bin/bic-cached 3 > /dev/null 2>&1 &
-fi
-
-if [ $(is_server_prsnt 4) == "1" ]; then
-/usr/local/bin/bic-cached 4 > /dev/null 2>&1 &
-fi
-
-echo "done."
diff --git a/meta-facebook/meta-yosemite/recipes-yosemite/consoled/consoled_0.1.bbappend b/meta-facebook/meta-yosemite/recipes-yosemite/consoled/consoled_0.1.bbappend
deleted file mode 100644
index 12a1d17..0000000
--- a/meta-facebook/meta-yosemite/recipes-yosemite/consoled/consoled_0.1.bbappend
+++ /dev/null
@@ -1,53 +0,0 @@
-# Copyright 2015-present Facebook. All Rights Reserved.
-#
-# This program file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program in a file named COPYING; if not, write to the
-# Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor,
-# Boston, MA 02110-1301 USA
-
-FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
-
-SRC_URI += "file://setup-consoled.sh \
- "
-
-S = "${WORKDIR}"
-
-
-pkgdir = "consoled"
-
-do_install() {
- dst="${D}/usr/local/fbpackages/${pkgdir}"
- bin="${D}/usr/local/bin"
- install -d $dst
- install -d $bin
- for f in ${binfiles}; do
- install -m 755 $f ${dst}/$f
- ln -snf ../fbpackages/${pkgdir}/$f ${bin}/$f
- done
- for f in ${otherfiles}; do
- install -m 644 $f ${dst}/$f
- done
- install -d ${D}${sysconfdir}/init.d
- install -d ${D}${sysconfdir}/rcS.d
- install -m 755 setup-consoled.sh ${D}${sysconfdir}/init.d/setup-consoled.sh
- update-rc.d -r ${D} setup-consoled.sh start 91 S .
-}
-
-FBPACKAGEDIR = "${prefix}/local/fbpackages"
-
-FILES_${PN} = "${FBPACKAGEDIR}/consoled ${prefix}/local/bin ${sysconfdir} "
-
-# Inhibit complaints about .debug directories for the sensord binary:
-
-INHIBIT_PACKAGE_DEBUG_SPLIT = "1"
-INHIBIT_PACKAGE_STRIP = "1"
diff --git a/meta-facebook/meta-yosemite/recipes-yosemite/consoled/files/setup-consoled.sh b/meta-facebook/meta-yosemite/recipes-yosemite/consoled/files/setup-consoled.sh
deleted file mode 100644
index 8c50e49..0000000
--- a/meta-facebook/meta-yosemite/recipes-yosemite/consoled/files/setup-consoled.sh
+++ /dev/null
@@ -1,51 +0,0 @@
-#!/bin/sh
-#
-# Copyright 2015-present Facebook. All Rights Reserved.
-#
-# This program file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program in a file named COPYING; if not, write to the
-# Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor,
-# Boston, MA 02110-1301 USA
-#
-
-### BEGIN INIT INFO
-# Provides: setup-consoled
-# Required-Start:
-# Required-Stop:
-# Default-Start: S
-# Default-Stop:
-# Short-Description: Setup console history buffering
-### END INIT INFO
-
-. /usr/local/fbpackages/utils/ast-functions
-
-# TODO: check for the if slot/server is present before starting the daemon
-echo -n "Setup console buffering..."
-
- if [ $(is_server_prsnt 1) == "1" ] ; then
- /usr/local/bin/consoled slot1 --buffer
- fi
-
- if [ $(is_server_prsnt 2) == "1" ] ; then
- /usr/local/bin/consoled slot2 --buffer
- fi
-
- if [ $(is_server_prsnt 3) == "1" ] ; then
- /usr/local/bin/consoled slot3 --buffer
- fi
-
- if [ $(is_server_prsnt 4) == "1" ] ; then
- /usr/local/bin/consoled slot4 --buffer
- fi
-
-echo "done."
diff --git a/meta-facebook/meta-yosemite/recipes-yosemite/fan-ctrl/fan-ctrl/get_fan_speed.sh b/meta-facebook/meta-yosemite/recipes-yosemite/fan-ctrl/fan-ctrl/get_fan_speed.sh
deleted file mode 100755
index c77c6f0..0000000
--- a/meta-facebook/meta-yosemite/recipes-yosemite/fan-ctrl/fan-ctrl/get_fan_speed.sh
+++ /dev/null
@@ -1,53 +0,0 @@
-#!/bin/sh
-#
-# Copyright 2015-present Facebook. All Rights Reserved.
-#
-# This program file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program in a file named COPYING; if not, write to the
-# Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor,
-# Boston, MA 02110-1301 USA
-#
-usage() {
- echo "Usage: $0 [Fan Unit (0..1)]" >&2
-}
-
-PWM_DIR=/sys/devices/platform/ast_pwm_tacho.0
-set -e
-
-# refer to the comments in init_pwn.sh regarding
-# the fan unit and tacho mapping
-if [ "$#" -eq 0 ]; then
- TACHOS="0:0 1:1"
-elif [ "$#" -eq 1 ]; then
- case "$1" in
- "0")
- TACHOS="0:0"
- ;;
- "1")
- TACHOS="1:1"
- ;;
- *)
- usage
- exit 1
- ;;
- esac
-else
- usage
- exit 1
-fi
-
-for fan_tacho in $TACHOS; do
- fan=${fan_tacho%%:*}
- tacho=${fan_tacho##*:}
- echo "Fan $fan RPM: $(cat $PWM_DIR/tacho${tacho}_rpm)"
-done
diff --git a/meta-facebook/meta-yosemite/recipes-yosemite/fan-ctrl/fan-ctrl/init_pwm.sh b/meta-facebook/meta-yosemite/recipes-yosemite/fan-ctrl/fan-ctrl/init_pwm.sh
deleted file mode 100755
index 8c8adc6..0000000
--- a/meta-facebook/meta-yosemite/recipes-yosemite/fan-ctrl/fan-ctrl/init_pwm.sh
+++ /dev/null
@@ -1,64 +0,0 @@
-#!/bin/sh
-#
-# Copyright 2015-present Facebook. All Rights Reserved.
-#
-# This program file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program in a file named COPYING; if not, write to the
-# Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor,
-# Boston, MA 02110-1301 USA
-#
-PWM_DIR=/sys/devices/platform/ast_pwm_tacho.0
-
-set -e
-
-# The PWM frequency is
-
-# clk_source / ((2 ^ division_) * (2 * division_l) * (unit + 1))
-#
-# Our clk_source is 24Mhz. 4-pin fans are generally supposed to be driven with
-# a 25Khz PWM control signal. Therefore we want the divisor to equal 960.
-#
-# We also want the unit to be as large as possible, since this controls the
-# granularity with which we can modulate the PWM signal. The following
-# settings allow us to set the fan from 0 to 100% in increments of 1/96th.
-#
-# The AST chip supports 3 different PWM clock configurations, but we only use
-# type M for now.
-echo 0 > $PWM_DIR/pwm_type_m_division_h
-echo 5 > $PWM_DIR/pwm_type_m_division_l
-echo 95 > $PWM_DIR/pwm_type_m_unit
-
-# On Yosemite, there are 2 fans connected.
-# Each fan uses same PWM input and provide one tacho output.
-# Here is the mapping between the fan and PWN/Tacho,
-# staring from the one from the edge
-# Fan 0: PWM 0, Tacho0
-# Fan 1: PWM 0, Tacho1
-
-# For each fan, setting the type, and 100% initially
-for pwm in 0 1; do
- echo 0 > $PWM_DIR/pwm${pwm}_type
- echo 0 > $PWM_DIR/pwm${pwm}_rising
- echo 0 > $PWM_DIR/pwm${pwm}_falling
- echo 1 > $PWM_DIR/pwm${pwm}_en
-done
-
-# Enable Tach 0..1
-echo 0 > $PWM_DIR/tacho0_source
-echo 1 > $PWM_DIR/tacho1_source
-
-t=0
-while [ $t -le 1 ]; do
- echo 1 > $PWM_DIR/tacho${t}_en
- t=$((t+1))
-done
diff --git a/meta-facebook/meta-yosemite/recipes-yosemite/fan-ctrl/fan-ctrl/set_fan_speed.sh b/meta-facebook/meta-yosemite/recipes-yosemite/fan-ctrl/fan-ctrl/set_fan_speed.sh
deleted file mode 100755
index 7876619..0000000
--- a/meta-facebook/meta-yosemite/recipes-yosemite/fan-ctrl/fan-ctrl/set_fan_speed.sh
+++ /dev/null
@@ -1,79 +0,0 @@
-#!/bin/sh
-#
-# Copyright 2004-present Facebook. All Rights Reserved.
-#
-# This program file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program in a file named COPYING; if not, write to the
-# Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor,
-# Boston, MA 02110-1301 USA
-#
-usage() {
- echo "Usage: $0 <PERCENT (0..100)> <Fan Unit (0..1)> " >&2
-}
-
-PWM_DIR=/sys/devices/platform/ast_pwm_tacho.0
-
-# The maximum unit setting.
-# This should be the value in pwm_type_m_unit plus 1
-PWM_UNIT_MAX=96
-
-set -e
-
-if [ "$#" -ne 2 ] && [ "$#" -ne 1 ]; then
- usage
- exit 1
-fi
-
-# refer to the comments in init_pwn.sh regarding
-# the fan unit and PWM mapping
-if [ "$#" -eq 1 ]; then
- PWMS="0:0 1:1"
-else
- case "$2" in
- "0")
- PWMS="0:0"
- ;;
- "1")
- PWMS="1:1"
- ;;
- *)
- usage
- exit 1
- ;;
- esac
-fi
-
-# Convert the percentage to our 1/96th unit.
-unit=$(( ( $1 * $PWM_UNIT_MAX ) / 100 ))
-
-for FAN_PWM in $PWMS; do
- FAN_N=${FAN_PWM%%:*}
- PWM_N=${FAN_PWM##*:}
- if [ "$unit" -eq 0 ]; then
- # For 0%, turn off the PWM entirely
- echo 0 > $PWM_DIR/pwm${PWM_N}_en
- else
- if [ "$unit" -eq $PWM_UNIT_MAX ]; then
- # For 100%, set falling and rising to the same value
- unit=0
- fi
-
- # always use type M. refer to the comments in init_pwm.sh
- echo 0 > $PWM_DIR/pwm${PWM_N}_type
- echo 0 > $PWM_DIR/pwm${PWM_N}_rising
- echo "$unit" > $PWM_DIR/pwm${PWM_N}_falling
- echo 1 > $PWM_DIR/pwm${PWM_N}_en
- fi
-
- echo "Successfully set fan ${FAN_N} (PWM: $PWM_N) speed to $1%"
-done
diff --git a/meta-facebook/meta-yosemite/recipes-yosemite/fan-ctrl/fan-ctrl/setup-fan.sh b/meta-facebook/meta-yosemite/recipes-yosemite/fan-ctrl/fan-ctrl/setup-fan.sh
deleted file mode 100644
index 72016d0..0000000
--- a/meta-facebook/meta-yosemite/recipes-yosemite/fan-ctrl/fan-ctrl/setup-fan.sh
+++ /dev/null
@@ -1,36 +0,0 @@
-#!/bin/sh
-#
-# Copyright 2015-present Facebook. All Rights Reserved.
-#
-# This program file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program in a file named COPYING; if not, write to the
-# Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor,
-# Boston, MA 02110-1301 USA
-#
-
-### BEGIN INIT INFO
-# Provides: setup-fan
-# Required-Start: board-id
-# Required-Stop:
-# Default-Start: S
-# Default-Stop:
-# Short-Description: Set fan speed
-### END INIT INFO
-
-. /usr/local/fbpackages/utils/ast-functions
-
-echo -n "Setup fan speed... "
-/usr/local/bin/init_pwm.sh
-/usr/local/bin/set_fan_speed.sh 50
-/usr/local/bin/fand
-echo "done."
diff --git a/meta-facebook/meta-yosemite/recipes-yosemite/fan-ctrl/fan-ctrl_0.1.bbappend b/meta-facebook/meta-yosemite/recipes-yosemite/fan-ctrl/fan-ctrl_0.1.bbappend
deleted file mode 100644
index eb91d6c..0000000
--- a/meta-facebook/meta-yosemite/recipes-yosemite/fan-ctrl/fan-ctrl_0.1.bbappend
+++ /dev/null
@@ -1,64 +0,0 @@
-# Copyright 2014-present Facebook. All Rights Reserved.
-#
-# This program file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program in a file named COPYING; if not, write to the
-# Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor,
-# Boston, MA 02110-1301 USA
-
-DEPENDS_append = "update-rc.d-native libyosemite-sensor"
-
-FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
-SRC_URI += "file://get_fan_speed.sh \
- file://init_pwm.sh \
- file://set_fan_speed.sh \
- file://setup-fan.sh \
- "
-
-S = "${WORKDIR}"
-
-binfiles += "get_fan_speed.sh \
- init_pwm.sh \
- set_fan_speed.sh \
- "
-
-CXXFLAGS_prepend = "-DCONFIG_YOSEMITE "
-LDFLAGS_append = " -lyosemite_sensor"
-
-pkgdir = "fan_ctrl"
-
-do_install() {
- dst="${D}/usr/local/fbpackages/${pkgdir}"
- bin="${D}/usr/local/bin"
- install -d $dst
- install -d $bin
- for f in ${binfiles}; do
- install -m 755 $f ${dst}/$f
- ln -snf ../fbpackages/${pkgdir}/$f ${bin}/$f
- done
- for f in ${otherfiles}; do
- install -m 644 $f ${dst}/$f
- done
- install -d ${D}${sysconfdir}/init.d
- install -d ${D}${sysconfdir}/rcS.d
- install -m 755 setup-fan.sh ${D}${sysconfdir}/init.d/setup-fan.sh
- update-rc.d -r ${D} setup-fan.sh start 91 5 .
-}
-
-FBPACKAGEDIR = "${prefix}/local/fbpackages"
-
-FILES_${PN} = "${FBPACKAGEDIR}/fan_ctrl ${prefix}/local/bin ${sysconfdir} "
-
-# Inhibit complaints about .debug directories for the fand binary:
-
-INHIBIT_PACKAGE_DEBUG_SPLIT = "1"
-INHIBIT_PACKAGE_STRIP = "1"
diff --git a/meta-facebook/meta-yosemite/recipes-yosemite/fblibs/files/bic/Makefile b/meta-facebook/meta-yosemite/recipes-yosemite/fblibs/files/bic/Makefile
deleted file mode 100644
index 12cb085..0000000
--- a/meta-facebook/meta-yosemite/recipes-yosemite/fblibs/files/bic/Makefile
+++ /dev/null
@@ -1,11 +0,0 @@
-# Copyright 2015-present Facebook. All Rights Reserved.
-lib: libbic.so
-
-libbic.so: bic.c
- $(CC) $(CFLAGS) -fPIC -c -o bic.o bic.c
- $(CC) -lipmb -shared -o libbic.so bic.o -lc
-
-.PHONY: clean
-
-clean:
- rm -rf *.o libbic.so
diff --git a/meta-facebook/meta-yosemite/recipes-yosemite/fblibs/files/bic/bic.c b/meta-facebook/meta-yosemite/recipes-yosemite/fblibs/files/bic/bic.c
deleted file mode 100644
index 4139b44..0000000
--- a/meta-facebook/meta-yosemite/recipes-yosemite/fblibs/files/bic/bic.c
+++ /dev/null
@@ -1,755 +0,0 @@
-/*
- *
- * Copyright 2015-present Facebook. All Rights Reserved.
- *
- * This file contains code to support IPMI2.0 Specificaton available @
- * http://www.intel.com/content/www/us/en/servers/ipmi/ipmi-specifications.html
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-#include <stdio.h>
-#include <stdint.h>
-#include <fcntl.h>
-#include <syslog.h>
-#include "bic.h"
-
-#define FRUID_READ_COUNT_MAX 0x30
-#define FRUID_WRITE_COUNT_MAX 0x30
-#define CPLD_WRITE_COUNT_MAX 0x50
-#define SDR_READ_COUNT_MAX 0x1A
-#define SIZE_SYS_GUID 16
-#define SIZE_IANA_ID 3
-
-enum {
- IPMB_BUS_SLOT1 = 3,
- IPMB_BUS_SLOT2 = 1,
- IPMB_BUS_SLOT3 = 7,
- IPMB_BUS_SLOT4 = 5,
-};
-
-#pragma pack(push, 1)
-typedef struct _sdr_rec_hdr_t {
- uint16_t rec_id;
- uint8_t ver;
- uint8_t type;
- uint8_t len;
-} sdr_rec_hdr_t;
-#pragma pack(pop)
-
-// Common IPMB Wrapper function
-
-static int
-get_ipmb_bus_id(uint8_t slot_id) {
- int bus_id;
-
- switch(slot_id) {
- case 1:
- bus_id = IPMB_BUS_SLOT1;
- break;
- case 2:
- bus_id = IPMB_BUS_SLOT2;
- break;
- case 3:
- bus_id = IPMB_BUS_SLOT3;
- break;
- case 4:
- bus_id = IPMB_BUS_SLOT4;
- break;
- default:
- bus_id = -1;
- break;
- }
-
- return bus_id;
-}
-
-static int
-bic_ipmb_wrapper(uint8_t slot_id, uint8_t netfn, uint8_t cmd,
- uint8_t *txbuf, uint8_t txlen,
- uint8_t *rxbuf, uint8_t *rxlen) {
- ipmb_req_t *req;
- ipmb_res_t *res;
- uint8_t rbuf[MAX_IPMB_RES_LEN] = {0};
- uint8_t tbuf[MAX_IPMB_RES_LEN] = {0};
- uint8_t tlen = 0;
- uint8_t rlen = 0;
- int count = 0;
- int i = 0;
- int ret;
- uint8_t bus_id;
-
- ret = get_ipmb_bus_id(slot_id);
- if (ret < 0) {
-#ifdef DEBUG
- syslog(LOG_ERR, "bic_ipmb_wrapper: Wrong Slot ID %d\n", slot_id);
-#endif
- return ret;
- }
-
- bus_id = (uint8_t) ret;
-
- req = (ipmb_req_t*)tbuf;
-
- req->res_slave_addr = BRIDGE_SLAVE_ADDR << 1;
- req->netfn_lun = netfn << LUN_OFFSET;
- req->hdr_cksum = req->res_slave_addr +
- req->netfn_lun;
- req->hdr_cksum = ZERO_CKSUM_CONST - req->hdr_cksum;
-
- req->req_slave_addr = BMC_SLAVE_ADDR << 1;
- req->seq_lun = 0x00;
- req->cmd = cmd;
-
- //copy the data to be send
- if (txlen) {
- memcpy(req->data, txbuf, txlen);
- }
-
- tlen = IPMB_HDR_SIZE + IPMI_REQ_HDR_SIZE + txlen;
-
- // Invoke IPMB library handler
- lib_ipmb_handle(bus_id, tbuf, tlen, &rbuf, &rlen);
-
- if (rlen == 0) {
-#ifdef DEBUG
- syslog(LOG_DEBUG, "bic_ipmb_wrapper: Zero bytes received\n");
-#endif
- return -1;
- }
-
- // Handle IPMB response
- res = (ipmb_res_t*) rbuf;
-
- if (res->cc) {
-#ifdef DEBUG
- syslog(LOG_ERR, "bic_ipmb_wrapper: Completion Code: 0x%X\n", res->cc);
-#endif
- return -1;
- }
-
- // copy the received data back to caller
- *rxlen = rlen - IPMB_HDR_SIZE - IPMI_RESP_HDR_SIZE;
- memcpy(rxbuf, res->data, *rxlen);
-
- return 0;
-}
-
-// Get Device ID
-int
-bic_get_dev_id(uint8_t slot_id, ipmi_dev_id_t *dev_id) {
- uint8_t rlen = 0;
- int ret;
-
- ret = bic_ipmb_wrapper(slot_id, NETFN_APP_REQ, CMD_APP_GET_DEVICE_ID, NULL, 0, (uint8_t *) dev_id, &rlen);
-
- return ret;
-}
-
-// Get GPIO value and configuration
-int
-bic_get_gpio(uint8_t slot_id, bic_gpio_t *gpio) {
- uint8_t tbuf[3] = {0x15, 0xA0, 0x00}; // IANA ID
- uint8_t rbuf[7] = {0x00};
- uint8_t rlen = 0;
- int ret;
-
- ret = bic_ipmb_wrapper(slot_id, NETFN_OEM_1S_REQ, CMD_OEM_1S_GET_GPIO, tbuf, 0x03, rbuf, &rlen);
-
- // Ignore first 3 bytes of IANA ID
- memcpy((uint8_t*) gpio, &rbuf[3], 4);
-
- return ret;
-}
-
-int
-bic_get_gpio_config(uint8_t slot_id, uint8_t gpio, bic_gpio_config_t *gpio_config) {
- uint8_t tbuf[7] = {0x15, 0xA0, 0x00}; // IANA ID
- uint8_t rbuf[4] = {0x00};
- uint8_t rlen = 0;
- uint8_t tlen = 0;
- uint32_t pin;
- int ret;
-
- pin = 1 << gpio;
-
- tbuf[3] = pin & 0xFF;
- tbuf[4] = (pin >> 8) & 0xFF;
- tbuf[5] = (pin >> 16) & 0xFF;
- tbuf[6] = (pin >> 24) & 0xFF;
-
- tlen = 7;
-
- ret = bic_ipmb_wrapper(slot_id, NETFN_OEM_1S_REQ, CMD_OEM_1S_GET_GPIO_CONFIG, tbuf, tlen, rbuf, &rlen);
-
- // Ignore IANA ID
- *(uint8_t *) gpio_config = rbuf[3];
-
- return ret;
-}
-
-int
-bic_set_gpio_config(uint8_t slot_id, uint8_t gpio, bic_gpio_config_t *gpio_config) {
- uint8_t tbuf[8] = {0x15, 0xA0, 0x00}; // IANA ID
- uint8_t rbuf[4] = {0x00};
- uint8_t rlen = 0;
- uint8_t tlen = 0;
- uint32_t pin;
- int ret;
-
- pin = 1 << gpio;
-
- tbuf[3] = pin & 0xFF;
- tbuf[4] = (pin >> 8) & 0xFF;
- tbuf[5] = (pin >> 16) & 0xFF;
- tbuf[6] = (pin >> 24) & 0xFF;
- tbuf[7] = (*(uint8_t *) gpio_config) & 0x1F;
-
- tlen = 8;
-
- ret = bic_ipmb_wrapper(slot_id, NETFN_OEM_1S_REQ, CMD_OEM_1S_SET_GPIO_CONFIG,
- tbuf, tlen, rbuf, &rlen);
- return ret;
-}
-
-// Get BIC Configuration
-int
-bic_get_config(uint8_t slot_id, bic_config_t *cfg) {
- uint8_t tbuf[3] = {0x15, 0xA0, 0x00}; // IANA ID
- uint8_t rbuf[4] = {0x00};
- uint8_t rlen = 0;
- int ret;
-
- ret = bic_ipmb_wrapper(slot_id, NETFN_OEM_1S_REQ, CMD_OEM_1S_GET_CONFIG,
- tbuf, 0x03, rbuf, &rlen);
- // Ignore IANA ID
- *(uint8_t *) cfg = rbuf[3];
-
- return ret;
-}
-
-// Set BIC Configuration
-int
-bic_set_config(uint8_t slot_id, bic_config_t *cfg) {
- uint8_t tbuf[4] = {0x15, 0xA0, 0x00}; // IANA ID
- uint8_t rlen = 0;
- uint8_t rbuf[4] = {0};
- int ret;
-
- tbuf[3] = *(uint8_t *) cfg;
-
- ret = bic_ipmb_wrapper(slot_id, NETFN_OEM_1S_REQ, CMD_OEM_1S_SET_CONFIG,
- tbuf, 0x04, rbuf, &rlen);
- return ret;
-}
-
-// Read POST Buffer
-int
-bic_get_post_buf(uint8_t slot_id, uint8_t *buf, uint8_t *len) {
- uint8_t tbuf[3] = {0x15, 0xA0, 0x00}; // IANA ID
- uint8_t rbuf[255] = {0x00};
- uint8_t rlen = 0;
- int ret;
-
- ret = bic_ipmb_wrapper(slot_id, NETFN_OEM_1S_REQ, CMD_OEM_1S_GET_POST_BUF, tbuf, 0x03, rbuf, &rlen);
-
- //Ignore IANA ID
- memcpy(buf, &rbuf[3], rlen-3);
-
- *len = rlen - 3;
-
- return ret;
-}
-
-// Read Firwmare Versions of various components
-int
-bic_get_fw_ver(uint8_t slot_id, uint8_t comp, uint8_t *ver) {
- uint8_t tbuf[4] = {0x15, 0xA0, 0x00}; // IANA ID
- uint8_t rbuf[16] = {0x00};
- uint8_t rlen = 0;
- int ret;
-
- // Fill the component for which firmware is requested
- tbuf[3] = comp;
-
- ret = bic_ipmb_wrapper(slot_id, NETFN_OEM_1S_REQ, CMD_OEM_1S_GET_FW_VER, tbuf, 0x04, rbuf, &rlen);
- // fw version has to be between 2 and 5 bytes based on component
- if (ret || (rlen < 2+SIZE_IANA_ID) || (rlen > 5+SIZE_IANA_ID)) {
-#ifdef DEBUG
- syslog(LOG_ERR, "bic_get_fw_ver: ret: %d, rlen: %d\n", ret, rlen);
-#endif
- return -1;
- }
-
- //Ignore IANA ID
- memcpy(ver, &rbuf[3], rlen-3);
-
- return ret;
-}
-
-// Update firmware for various components
-static int
-_update_fw(uint8_t slot_id, uint8_t target, uint32_t offset, uint16_t len, uint8_t *buf) {
- uint8_t tbuf[256] = {0x15, 0xA0, 0x00}; // IANA ID
- uint8_t rbuf[16] = {0x00};
- uint8_t tlen = 0;
- uint8_t rlen = 0;
- int ret;
- int retries = 3;
-
- // Fill the component for which firmware is requested
- tbuf[3] = target;
-
- tbuf[4] = (offset) & 0xFF;
- tbuf[5] = (offset >> 8) & 0xFF;
- tbuf[6] = (offset >> 16) & 0xFF;
- tbuf[7] = (offset >> 24) & 0xFF;
-
- tbuf[8] = len & 0xFF;
- tbuf[9] = (len >> 8) & 0xFF;
-
- memcpy(&tbuf[10], buf, len);
-
- printf("_update_fw: target: %d, offset: %d, len: %d\n", target, offset, len);
-
- tlen = len + 10;
-
-bic_send:
- ret = bic_ipmb_wrapper(slot_id, NETFN_OEM_1S_REQ, CMD_OEM_1S_UPDATE_FW, tbuf, tlen, rbuf, &rlen);
- if ((ret) && (retries--)) {
- sleep(1);
- printf("_update_fw: retrying..\n");
- goto bic_send;
- }
-
- return ret;
-}
-
-int
-bic_update_fw(uint8_t slot_id, uint8_t comp, char *path) {
- int ret;
- uint32_t offset;
- uint16_t count;
- uint8_t buf[256] = {0};
- uint8_t len = 0;
- uint8_t target;
- int fd;
-
- // Open the file exclusively for read
- fd = open(path, O_RDONLY, 0666);
- if (fd < 0) {
-#ifdef DEBUG
- syslog(LOG_ERR, "bic_update_fw: open fails for path: %s\n", path);
-#endif
- goto error_exit;
- }
-
- // Write chunks of CPLD binary data in a loop
- offset = 0;
- while (1) {
- // Read from file
- count = read(fd, buf, CPLD_WRITE_COUNT_MAX);
- if (count <= 0) {
- break;
- }
-
- if (count == CPLD_WRITE_COUNT_MAX) {
- target = comp;
- } else {
- target = comp | 0x80;
- }
-
- // Write to the CPLD
- ret = _update_fw(slot_id, target, offset, count, buf);
- if (ret) {
- break;
- }
-
- // Update counter
- offset += count;
- }
-
-error_exit:
- if (fd > 0 ) {
- close(fd);
- }
-
- return ret;
-}
-
-int
-bic_me_xmit(uint8_t slot_id, uint8_t *txbuf, uint8_t txlen, uint8_t *rxbuf, uint8_t *rxlen) {
- uint8_t tbuf[256] = {0x15, 0xA0, 0x00}; // IANA ID
- uint8_t rbuf[256] = {0x00};
- uint8_t rlen = 0;
- uint8_t tlen = 0;
- int ret;
-
- // Fill the interface number as ME
- tbuf[3] = BIC_INTF_ME;
-
- // Fill the data to be sent
- memcpy(&tbuf[4], txbuf, txlen);
-
- // Send data length includes IANA ID and interface number
- tlen = txlen + 4;
-
- ret = bic_ipmb_wrapper(slot_id, NETFN_OEM_1S_REQ, CMD_OEM_1S_MSG_OUT, tbuf, tlen, rbuf, &rlen);
- if (ret ) {
- return -1;
- }
-
- // Make sure the received interface number is same
- if (rbuf[3] != tbuf[3]) {
- return -1;
- }
-
- // Copy the received data to caller skipping header
- memcpy(rxbuf, &rbuf[7], rlen-7);
-
- *rxlen = rlen-7;
-
- return 0;
-}
-
-// Read 1S server's FRUID
-int
-bic_get_fruid_info(uint8_t slot_id, uint8_t fru_id, ipmi_fruid_info_t *info) {
- int ret;
- uint8_t rlen = 0;
-
- ret = bic_ipmb_wrapper(slot_id, NETFN_STORAGE_REQ, CMD_STORAGE_GET_FRUID_INFO, &fru_id, 1, (uint8_t *) info, &rlen);
-
- return ret;
-}
-
-static int
-_read_fruid(uint8_t slot_id, uint8_t fru_id, uint32_t offset, uint8_t count, uint8_t *rbuf, uint8_t *rlen) {
- int ret;
- uint8_t tbuf[4] = {0};
- uint8_t tlen = 0;
-
- tbuf[0] = fru_id;
- tbuf[1] = offset & 0xFF;
- tbuf[2] = (offset >> 8) & 0xFF;
- tbuf[3] = count;
-
- ret = bic_ipmb_wrapper(slot_id, NETFN_STORAGE_REQ, CMD_STORAGE_READ_FRUID_DATA, tbuf, 4, rbuf, rlen);
-
- return ret;
-}
-
-int
-bic_read_fruid(uint8_t slot_id, uint8_t fru_id, const char *path) {
- int ret;
- uint32_t nread;
- uint32_t offset;
- uint8_t count;
- uint8_t rbuf[256] = {0};
- uint8_t rlen = 0;
- int fd;
- ipmi_fruid_info_t info;
-
- // Remove the file if exists already
- unlink(path);
-
- // Open the file exclusively for write
- fd = open(path, O_WRONLY | O_CREAT | O_EXCL, 0666);
- if (fd < 0) {
-#ifdef DEBUG
- syslog(LOG_ERR, "bic_read_fruid: open fails for path: %s\n", path);
-#endif
- goto error_exit;
- }
-
- // Read the FRUID information
- ret = bic_get_fruid_info(slot_id, fru_id, &info);
- if (ret) {
-#ifdef DEBUG
- syslog(LOG_ERR, "bic_read_fruid: bic_read_fruid_info returns %d\n", ret);
-#endif
- goto error_exit;
- }
-
- // Indicates the size of the FRUID
- nread = (info.size_msb << 6) + (info.size_lsb);
-
- // Read chunks of FRUID binary data in a loop
- offset = 0;
- while (nread > 0) {
- if (nread > FRUID_READ_COUNT_MAX) {
- count = FRUID_READ_COUNT_MAX;
- } else {
- count = nread;
- }
-
- ret = _read_fruid(slot_id, fru_id, offset, count, rbuf, &rlen);
- if (ret) {
-#ifdef DEBUG
- syslog(LOG_ERR, "bic_read_fruid: ipmb_wrapper fails\n");
-#endif
- goto error_exit;
- }
-
- // Ignore the first byte as it indicates length of response
- write(fd, &rbuf[1], rlen-1);
-
- // Update offset
- offset += (rlen-1);
- nread -= (rlen-1);
- }
-
-error_exit:
- if (fd > 0 ) {
- close(fd);
- }
-
- return ret;
-}
-
-static int
-_write_fruid(uint8_t slot_id, uint8_t fru_id, uint32_t offset, uint8_t count, uint8_t *buf) {
- int ret;
- uint8_t tbuf[64] = {0};
- uint8_t rbuf[4] = {0};
- uint8_t tlen = 0;
- uint8_t rlen = 0;
-
- tbuf[0] = fru_id;
- tbuf[1] = offset & 0xFF;
- tbuf[2] = (offset >> 8) & 0xFF;
-
- memcpy(&tbuf[3], buf, count);
- tlen = count + 3;
-
- ret = bic_ipmb_wrapper(slot_id, NETFN_STORAGE_REQ, CMD_STORAGE_WRITE_FRUID_DATA, tbuf, tlen, rbuf, &rlen);
-
- if (ret) {
- return ret;
- }
-
- if (rbuf[0] != count) {
- return -1;
- }
-
- return ret;
-}
-
-int
-bic_write_fruid(uint8_t slot_id, uint8_t fru_id, const char *path) {
- int ret;
- uint32_t offset;
- uint8_t count;
- uint8_t buf[64] = {0};
- uint8_t len = 0;
- int fd;
-
- // Open the file exclusively for read
- fd = open(path, O_RDONLY, 0666);
- if (fd < 0) {
-#ifdef DEBUG
- syslog(LOG_ERR, "bic_write_fruid: open fails for path: %s\n", path);
-#endif
- goto error_exit;
- }
-
- // Write chunks of FRUID binary data in a loop
- offset = 0;
- while (1) {
- // Read from file
- count = read(fd, buf, FRUID_WRITE_COUNT_MAX);
- if (count <= 0) {
- break;
- }
-
- // Write to the FRUID
- ret = _write_fruid(slot_id, fru_id, offset, count, buf);
- if (ret) {
- break;
- }
-
- // Update counter
- offset += count;
- }
-
-error_exit:
- if (fd > 0 ) {
- close(fd);
- }
-
- return ret;
-}
-
-// Read System Event Log (SEL)
-int
-bic_get_sel_info(uint8_t slot_id, ipmi_sel_sdr_info_t *info) {
- int ret;
- uint8_t rlen = 0;
-
- ret = bic_ipmb_wrapper(slot_id, NETFN_STORAGE_REQ, CMD_STORAGE_GET_SEL_INFO, NULL, 0, (uint8_t *)info, &rlen);
-
- return ret;
-}
-
-static int
-_get_sel_rsv(uint8_t slot_id, uint16_t *rsv) {
- int ret;
- uint8_t rlen = 0;
-
- ret = bic_ipmb_wrapper(slot_id, NETFN_STORAGE_REQ, CMD_STORAGE_RSV_SEL, NULL, 0, (uint8_t *) rsv, &rlen);
- return ret;
-}
-
-int
-bic_get_sel(uint8_t slot_id, ipmi_sel_sdr_req_t *req, ipmi_sel_sdr_res_t *res, uint8_t *rlen) {
-
- int ret;
-
- ret = bic_ipmb_wrapper(slot_id, NETFN_STORAGE_REQ, CMD_STORAGE_GET_SEL, (uint8_t *)req, sizeof(ipmi_sel_sdr_req_t), (uint8_t*)res, rlen);
-
- return ret;
-}
-
-// Read Sensor Data Records (SDR)
-int
-bic_get_sdr_info(uint8_t slot_id, ipmi_sel_sdr_info_t *info) {
- int ret;
- uint8_t rlen = 0;
-
- ret = bic_ipmb_wrapper(slot_id, NETFN_STORAGE_REQ, CMD_STORAGE_GET_SDR_INFO, NULL, 0, (uint8_t *) info, &rlen);
-
- return ret;
-}
-
-static int
-_get_sdr_rsv(uint8_t slot_id, uint16_t *rsv) {
- int ret;
- uint8_t rlen = 0;
-
- ret = bic_ipmb_wrapper(slot_id, NETFN_STORAGE_REQ, CMD_STORAGE_RSV_SDR, NULL, 0, (uint8_t *) rsv, &rlen);
-
- return ret;
-}
-
-static int
-_get_sdr(uint8_t slot_id, ipmi_sel_sdr_req_t *req, ipmi_sel_sdr_res_t *res, uint8_t *rlen) {
- int ret;
-
- ret = bic_ipmb_wrapper(slot_id, NETFN_STORAGE_REQ, CMD_STORAGE_GET_SDR, (uint8_t *)req, sizeof(ipmi_sel_sdr_req_t), (uint8_t*)res, rlen);
-
- return ret;
-}
-
-int
-bic_get_sdr(uint8_t slot_id, ipmi_sel_sdr_req_t *req, ipmi_sel_sdr_res_t *res, uint8_t *rlen) {
- int ret;
- uint8_t tbuf[MAX_IPMB_RES_LEN] = {0};
- uint8_t tlen;
- uint8_t len;
- ipmi_sel_sdr_res_t *tres;
- sdr_rec_hdr_t *hdr;
-
- tres = (ipmi_sel_sdr_res_t *) tbuf;
-
- // Get SDR reservation ID for the given record
- ret = _get_sdr_rsv(slot_id, &req->rsv_id);
- if (ret) {
-#ifdef DEBUG
- syslog(LOG_ERR, "bic_read_sdr: _get_sdr_rsv returns %d\n", ret);
-#endif
- return ret;
- }
-
- // Initialize the response length to zero
- *rlen = 0;
-
- // Read SDR Record Header
- req->offset = 0;
- req->nbytes = sizeof(sdr_rec_hdr_t);
-
- ret = _get_sdr(slot_id, req, tbuf, &tlen);
- if (ret) {
-#ifdef DEBUG
- syslog(LOG_ERR, "bic_read_sdr: _get_sdr returns %d\n", ret);
-#endif
- return ret;
- }
-
- // Copy the next record id to response
- res->next_rec_id = tres->next_rec_id;
-
- // Copy the header excluding first two bytes(next_rec_id)
- memcpy(res->data, tres->data, tlen-2);
-
- // Update response length and offset for next request
- *rlen += tlen-2;
- req->offset = tlen-2;
-
- // Find length of data from header info
- hdr = (sdr_rec_hdr_t *) tres->data;
- len = hdr->len;
-
- // Keep reading chunks of SDR record in a loop
- while (len > 0) {
- if (len > SDR_READ_COUNT_MAX) {
- req->nbytes = SDR_READ_COUNT_MAX;
- } else {
- req->nbytes = len;
- }
-
- ret = _get_sdr(slot_id, req, tbuf, &tlen);
- if (ret) {
-#ifdef DEBUG
- syslog(LOG_ERR, "bic_read_sdr: _get_sdr returns %d\n", ret);
-#endif
- return ret;
- }
-
- // Copy the data excluding the first two bytes(next_rec_id)
- memcpy(&res->data[req->offset], tres->data, tlen-2);
-
- // Update response length, offset for next request, and remaining length
- *rlen += tlen-2;
- req->offset += tlen-2;
- len -= tlen-2;
- }
-
- return 0;
-}
-
-int
-bic_read_sensor(uint8_t slot_id, uint8_t sensor_num, ipmi_sensor_reading_t *sensor) {
- int ret;
- int rlen = 0;
-
- ret = bic_ipmb_wrapper(slot_id, NETFN_SENSOR_REQ, CMD_SENSOR_GET_SENSOR_READING, (uint8_t *)&sensor_num, 1, (uint8_t *)sensor, &rlen);
-
- return ret;
-}
-
-int
-bic_get_sys_guid(uint8_t slot_id, uint8_t *guid) {
- int ret;
- int rlen = 0;
-
- ret = bic_ipmb_wrapper(slot_id, NETFN_APP_REQ, CMD_APP_GET_SYSTEM_GUID, NULL, 0, guid, &rlen);
- if (rlen != SIZE_SYS_GUID) {
-#ifdef DEBUG
- syslog(LOG_ERR, "bic_get_sys_guid: returned rlen of %d\n");
-#endif
- return -1;
- }
-
- return ret;
-}
diff --git a/meta-facebook/meta-yosemite/recipes-yosemite/fblibs/files/bic/bic.h b/meta-facebook/meta-yosemite/recipes-yosemite/fblibs/files/bic/bic.h
deleted file mode 100644
index 7110574..0000000
--- a/meta-facebook/meta-yosemite/recipes-yosemite/fblibs/files/bic/bic.h
+++ /dev/null
@@ -1,181 +0,0 @@
-/*
- *
- * Copyright 2015-present Facebook. All Rights Reserved.
- *
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-
-#ifndef __BIC_H__
-#define __BIC_H__
-
-#include <openbmc/ipmi.h>
-#include <openbmc/ipmb.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define MAX_GPIO_PINS 32
-
-// GPIO PINS
-enum {
- PWRGOOD_CPU = 0x0,
- PWRGD_PCH_PWROK,
- PVDDR_VRHOT_N,
- PVCCIN_VRHOT_N,
- FM_FAST_PROCHOT_N,
- PCHHOT_CPU_N,
- FM_CPLD_CPU_DIMM_EVENT_CO_N,
- FM_CPLD_BDXDE_THERMTRIP_N,
- THERMTRIP_PCH_N,
- FM_CPLD_FIVR_FAULT,
- FM_BDXDE_CATERR_LVT3_N,
- FM_BDXDE_ERR2_LVT3_N,
- FM_BDXDE_ERR1_LVT3_N,
- FM_BDXDE_ERR0_LVT3_N,
- SLP_S4_N,
- FM_NMI_EVENT_BMC_N,
- FM_SMI_BMC_N,
- RST_PLTRST_BMC_N,
- FP_RST_BTN_BUF_N,
- BMC_RST_BTN_OUT_N,
- FM_BDE_POST_CMPLT_N,
- FM_BDXDE_SLP3_N,
- FM_PWR_LED_N,
- PWRGD_PVCCIN,
- SVR_ID0,
- SVR_ID1,
- SVR_ID2,
- SVR_ID3,
- BMC_READY_N,
- RESERVED_29,
- RESERVED_30,
- RESERVED_31,
-};
-
-enum {
- FW_CPLD = 1,
- FW_BIC,
- FW_ME,
- FW_PVCCIN_VR,
- FW_DDRAB_VR,
- FW_P1V05_VR,
- FW_PVCCGBE_VR,
- FW_PVCCSCSUS_VR,
-};
-
-enum {
- UPDATE_BIOS = 0,
- UPDATE_CPLD,
- UPDATE_BIC_BOOT
-};
-
-// Bridge IC Spec
-typedef struct _bic_gpio_t {
- uint32_t pwrgood_cpu:1;
- uint32_t pwrgd_pch_pwrok:1;
- uint32_t pvddr_vrhot_n:1;
- uint32_t pvccin_vrhot_n:1;
- uint32_t fm_fast_prochot_n:1;
- uint32_t pchhot_cpu_n:1;
- uint32_t fm_cpld_cpu_dimm_event_c0_n:1;
- uint32_t fm_cpld_bdxde_thermtrip_n:1;
- uint32_t thermtrip_pch_n:1;
- uint32_t fm_cpld_fivr_fault:1;
- uint32_t fm_bdxde_caterr_lvt3_n:1;
- uint32_t fm_bdxde_err_lvt3_n:3;
- uint32_t slp_s4_n:1;
- uint32_t fm_nmi_event_bmc_n:1;
- uint32_t fm_smi_bmc_n:1;
- uint32_t rst_pltrst_bmc_n:1;
- uint32_t fp_rst_btn_buf_n:1;
- uint32_t bmc_rst_btn_out_n:1;
- uint32_t fm_bde_post_cmplt_n:1;
- uint32_t fm_bdxde_slp3_n:1;
- uint32_t fm_pwr_led_n:1;
- uint32_t pwrgd_pvccin:1;
- uint32_t svr_id:4;
- uint32_t bmc_ready_n:1;
- uint32_t bmc_com_sw_n:1;
- uint32_t rsvd:2;
-} bic_gpio_t;
-
-typedef union _bic_gpio_u {
- uint8_t gpio[4];
- bic_gpio_t bits;
-} bic_gpio_u;
-
-typedef struct _bic_gpio_config_t {
- uint8_t dir:1;
- uint8_t ie:1;
- uint8_t edge:1;
- uint8_t trig:2;
-} bic_gpio_config_t;
-
-typedef union _bic_gpio_config_u {
- uint8_t config;
- bic_gpio_config_t bits;
-} bic_gpio_config_u;
-
-typedef struct _bic_config_t {
- uint8_t sol:1;
- uint8_t post:1;
- uint8_t kcs:1;
- uint8_t ipmb:1;
- uint8_t rsvd:4;
-} bic_config_t;
-
-typedef union _bic_config_u {
- uint8_t config;
- bic_config_t bits;
-} bic_config_u;
-
-int bic_get_dev_id(uint8_t slot_id, ipmi_dev_id_t *id);
-
-int bic_get_bic_config(uint8_t slot_id, bic_config_t *cfg);
-int bic_set_bic_config(uint8_t slot_id, bic_config_t *cfg);
-
-int bic_get_gpio(uint8_t slot_id, bic_gpio_t *gpio);
-int bic_get_gpio_config(uint8_t slot_id, uint8_t gpio, bic_gpio_config_t *gpio_config);
-int bic_set_gpio_config(uint8_t slot_id, uint8_t gpio, bic_gpio_config_t *gpio_config);
-int bic_get_post_buf(uint8_t slot_id, uint8_t *buf, uint8_t *len);
-
-int bic_get_fruid_info(uint8_t slot_id, uint8_t fru_id, ipmi_fruid_info_t *info);
-int bic_read_fruid(uint8_t slot_id, uint8_t fru_id, const char *path);
-int bic_write_fruid(uint8_t slot_id, uint8_t fru_id, const char *path);
-
-int bic_get_sel_info(uint8_t slot_id, ipmi_sel_sdr_info_t *info);
-int bic_get_sel_rsv(uint8_t slot_id, uint16_t *rsv);
-int bic_get_sel(uint8_t slot_id, ipmi_sel_sdr_req_t *req, ipmi_sel_sdr_res_t *res, uint8_t *rlen);
-
-int bic_get_sdr_info(uint8_t slot_id, ipmi_sel_sdr_info_t *info);
-int bic_get_sdr_rsv(uint8_t slot_id, uint16_t *rsv);
-int bic_get_sdr(uint8_t slot_id, ipmi_sel_sdr_req_t *req, ipmi_sel_sdr_res_t *res, uint8_t *rlen);
-
-int bic_read_sensor(uint8_t slot_id, uint8_t sensor_num, ipmi_sensor_reading_t *sensor);
-
-int bic_get_sys_guid(uint8_t slot_id, uint8_t *guid);
-
-int bic_get_fw_ver(uint8_t slot_id, uint8_t comp, uint8_t *ver);
-
-int bic_update_fw(uint8_t slot_id, uint8_t comp, char *path);
-int bic_me_xmit(uint8_t slot_id, uint8_t *txbuf, uint8_t txlen, uint8_t *rxbuf, uint8_t *rxlen);
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
-
-#endif /* __BIC_H__ */
diff --git a/meta-facebook/meta-yosemite/recipes-yosemite/fblibs/files/pal/Makefile b/meta-facebook/meta-yosemite/recipes-yosemite/fblibs/files/pal/Makefile
deleted file mode 100644
index c207a7d..0000000
--- a/meta-facebook/meta-yosemite/recipes-yosemite/fblibs/files/pal/Makefile
+++ /dev/null
@@ -1,11 +0,0 @@
-# Copyright 2015-present Facebook. All Rights Reserved.
-lib: libpal.so
-
-libpal.so: pal.c
- $(CC) $(CFLAGS) -fPIC -c -pthread -o pal.o pal.c
- $(CC) -lbic -lyosemite_common -lyosemite_fruid -lyosemite_sensor -shared -o libpal.so pal.o -lc
-
-.PHONY: clean
-
-clean:
- rm -rf *.o libpal.so
diff --git a/meta-facebook/meta-yosemite/recipes-yosemite/fblibs/files/pal/pal.c b/meta-facebook/meta-yosemite/recipes-yosemite/fblibs/files/pal/pal.c
deleted file mode 100644
index ec0be12..0000000
--- a/meta-facebook/meta-yosemite/recipes-yosemite/fblibs/files/pal/pal.c
+++ /dev/null
@@ -1,1953 +0,0 @@
-/*
- *
- * Copyright 2015-present Facebook. All Rights Reserved.
- *
- * This file contains code to support IPMI2.0 Specificaton available @
- * http://www.intel.com/content/www/us/en/servers/ipmi/ipmi-specifications.html
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-#include <stdio.h>
-#include <stdint.h>
-#include <stdbool.h>
-#include <fcntl.h>
-#include <errno.h>
-#include <syslog.h>
-#include <sys/mman.h>
-#include <string.h>
-#include <pthread.h>
-#include "pal.h"
-
-#define BIT(value, index) ((value >> index) & 1)
-
-#define YOSEMITE_PLATFORM_NAME "Yosemite"
-#define LAST_KEY "last_key"
-#define YOSEMITE_MAX_NUM_SLOTS 4
-#define GPIO_VAL "/sys/class/gpio/gpio%d/value"
-#define GPIO_DIR "/sys/class/gpio/gpio%d/direction"
-
-#define GPIO_HAND_SW_ID1 138
-#define GPIO_HAND_SW_ID2 139
-#define GPIO_HAND_SW_ID4 140
-#define GPIO_HAND_SW_ID8 141
-
-#define GPIO_RST_BTN 144
-#define GPIO_PWR_BTN 24
-
-#define GPIO_HB_LED 135
-
-#define GPIO_USB_SW0 36
-#define GPIO_USB_SW1 37
-#define GPIO_USB_MUX_EN_N 147
-
-#define GPIO_UART_SEL0 32
-#define GPIO_UART_SEL1 33
-#define GPIO_UART_SEL2 34
-#define GPIO_UART_RX 35
-
-#define GPIO_POSTCODE_0 48
-#define GPIO_POSTCODE_1 49
-#define GPIO_POSTCODE_2 50
-#define GPIO_POSTCODE_3 51
-#define GPIO_POSTCODE_4 124
-#define GPIO_POSTCODE_5 125
-#define GPIO_POSTCODE_6 126
-#define GPIO_POSTCODE_7 127
-
-#define GPIO_DBG_CARD_PRSNT 137
-
-#define PAGE_SIZE 0x1000
-#define AST_SCU_BASE 0x1e6e2000
-#define PIN_CTRL1_OFFSET 0x80
-#define PIN_CTRL2_OFFSET 0x84
-#define AST_WDT_BASE 0x1e785000
-#define WDT_OFFSET 0x10
-
-#define UART1_TXD (1 << 22)
-#define UART2_TXD (1 << 30)
-#define UART3_TXD (1 << 22)
-#define UART4_TXD (1 << 30)
-
-#define DELAY_GRACEFUL_SHUTDOWN 1
-#define DELAY_POWER_OFF 6
-#define DELAY_POWER_CYCLE 10
-#define DELAY_12V_CYCLE 5
-
-#define CRASHDUMP_BIN "/usr/local/bin/dump.sh"
-#define CRASHDUMP_FILE "/mnt/data/crashdump_"
-const static uint8_t gpio_rst_btn[] = { 0, 57, 56, 59, 58 };
-const static uint8_t gpio_led[] = { 0, 97, 96, 99, 98 };
-const static uint8_t gpio_id_led[] = { 0, 41, 40, 43, 42 };
-const static uint8_t gpio_prsnt[] = { 0, 61, 60, 63, 62 };
-const static uint8_t gpio_power[] = { 0, 27, 25, 31, 29 };
-const static uint8_t gpio_12v[] = { 0, 117, 116, 119, 118 };
-const char pal_fru_list[] = "all, slot1, slot2, slot3, slot4, spb, nic";
-const char pal_server_list[] = "slot1, slot2, slot3, slot4";
-
-char * key_list[] = {
-"pwr_server1_last_state",
-"pwr_server2_last_state",
-"pwr_server3_last_state",
-"pwr_server4_last_state",
-"sysfw_ver_slot1",
-"sysfw_ver_slot2",
-"sysfw_ver_slot3",
-"sysfw_ver_slot4",
-"identify_sled",
-"identify_slot1",
-"identify_slot2",
-"identify_slot3",
-"identify_slot4",
-"timestamp_sled",
-"slot1_por_cfg",
-"slot2_por_cfg",
-"slot3_por_cfg",
-"slot4_por_cfg",
-/* Add more Keys here */
-LAST_KEY /* This is the last key of the list */
-};
-
-char * def_val_list[] = {
- "on", /* pwr_server1_last_state */
- "on", /* pwr_server2_last_state */
- "on", /* pwr_server3_last_state */
- "on", /* pwr_server4_last_state */
- "0", /* sysfw_ver_slot1 */
- "0", /* sysfw_ver_slot2 */
- "0", /* sysfw_ver_slot3 */
- "0", /* sysfw_ver_slot4 */
- "off", /* identify_sled */
- "off", /* identify_slot1 */
- "off", /* identify_slot2 */
- "off", /* identify_slot3 */
- "off", /* identify_slot4 */
- "0", /* timestamp_sled */
- "on", /* slot1_por_cfg */
- "on", /* slot2_por_cfg */
- "on", /* slot3_por_cfg */
- "on", /* slot4_por_cfg */
- /* Add more def values for the correspoding keys*/
- LAST_KEY /* Same as last entry of the key_list */
-};
-
-// Helper Functions
-static int
-read_device(const char *device, int *value) {
- FILE *fp;
- int rc;
-
- fp = fopen(device, "r");
- if (!fp) {
- int err = errno;
-#ifdef DEBUG
- syslog(LOG_INFO, "failed to open device %s", device);
-#endif
- return err;
- }
-
- rc = fscanf(fp, "%d", value);
- fclose(fp);
- if (rc != 1) {
-#ifdef DEBUG
- syslog(LOG_INFO, "failed to read device %s", device);
-#endif
- return ENOENT;
- } else {
- return 0;
- }
-}
-
-static int
-write_device(const char *device, const char *value) {
- FILE *fp;
- int rc;
-
- fp = fopen(device, "w");
- if (!fp) {
- int err = errno;
-#ifdef DEBUG
- syslog(LOG_INFO, "failed to open device for write %s", device);
-#endif
- return err;
- }
-
- rc = fputs(value, fp);
- fclose(fp);
-
- if (rc < 0) {
-#ifdef DEBUG
- syslog(LOG_INFO, "failed to write device %s", device);
-#endif
- return ENOENT;
- } else {
- return 0;
- }
-}
-
-// Power On the server in a given slot
-static int
-server_power_on(uint8_t slot_id) {
- char vpath[64] = {0};
-
- sprintf(vpath, GPIO_VAL, gpio_power[slot_id]);
-
- if (write_device(vpath, "1")) {
- return -1;
- }
-
- if (write_device(vpath, "0")) {
- return -1;
- }
-
- sleep(1);
-
- if (write_device(vpath, "1")) {
- return -1;
- }
-
- return 0;
-}
-
-// Power Off the server in given slot
-static int
-server_power_off(uint8_t slot_id, bool gs_flag) {
- char vpath[64] = {0};
-
- if (slot_id < 1 || slot_id > 4) {
- return -1;
- }
-
- sprintf(vpath, GPIO_VAL, gpio_power[slot_id]);
-
- if (write_device(vpath, "1")) {
- return -1;
- }
-
- sleep(1);
-
- if (write_device(vpath, "0")) {
- return -1;
- }
-
- if (gs_flag) {
- sleep(DELAY_GRACEFUL_SHUTDOWN);
- } else {
- sleep(DELAY_POWER_OFF);
- }
-
- if (write_device(vpath, "1")) {
- return -1;
- }
-
- return 0;
-}
-
-// Control 12V to the server in a given slot
-static int
-server_12v_on(uint8_t slot_id) {
- char vpath[64] = {0};
-
- if (slot_id < 1 || slot_id > 4) {
- return -1;
- }
-
- sprintf(vpath, GPIO_VAL, gpio_12v[slot_id]);
-
- if (write_device(vpath, "1")) {
- return -1;
- }
-
- return 0;
-}
-
-// Turn off 12V for the server in given slot
-static int
-server_12v_off(uint8_t slot_id) {
- char vpath[64] = {0};
-
- if (slot_id < 1 || slot_id > 4) {
- return -1;
- }
-
- sprintf(vpath, GPIO_VAL, gpio_12v[slot_id]);
-
- if (write_device(vpath, "0")) {
- return -1;
- }
-
- return 0;
-}
-
-// Debug Card's UART and BMC/SoL port share UART port and need to enable only
-// one TXD i.e. either BMC's TXD or Debug Port's TXD.
-static int
-control_sol_txd(uint8_t slot) {
- uint32_t scu_fd;
- uint32_t ctrl;
- void *scu_reg;
- void *scu_pin_ctrl1;
- void *scu_pin_ctrl2;
-
- scu_fd = open("/dev/mem", O_RDWR | O_SYNC );
- if (scu_fd < 0) {
-#ifdef DEBUG
- syslog(LOG_WARNING, "control_sol_txd: open fails\n");
-#endif
- return -1;
- }
-
- scu_reg = mmap(NULL, PAGE_SIZE, PROT_READ|PROT_WRITE, MAP_SHARED, scu_fd,
- AST_SCU_BASE);
- scu_pin_ctrl1 = (char*)scu_reg + PIN_CTRL1_OFFSET;
- scu_pin_ctrl2 = (char*)scu_reg + PIN_CTRL2_OFFSET;
-
- switch(slot) {
- case 1:
- // Disable UART2's TXD and enable others
- ctrl = *(volatile uint32_t*) scu_pin_ctrl2;
- ctrl |= UART1_TXD;
- ctrl &= (~UART2_TXD); //Disable
- *(volatile uint32_t*) scu_pin_ctrl2 = ctrl;
-
- ctrl = *(volatile uint32_t*) scu_pin_ctrl1;
- ctrl |= UART3_TXD | UART4_TXD;
- *(volatile uint32_t*) scu_pin_ctrl1 = ctrl;
- break;
- case 2:
- // Disable UART1's TXD and enable others
- ctrl = *(volatile uint32_t*) scu_pin_ctrl2;
- ctrl &= (~UART1_TXD); // Disable
- ctrl |= UART2_TXD;
- *(volatile uint32_t*) scu_pin_ctrl2 = ctrl;
-
- ctrl = *(volatile uint32_t*) scu_pin_ctrl1;
- ctrl |= UART3_TXD | UART4_TXD;
- *(volatile uint32_t*) scu_pin_ctrl1 = ctrl;
- break;
- case 3:
- // Disable UART4's TXD and enable others
- ctrl = *(volatile uint32_t*) scu_pin_ctrl2;
- ctrl |= UART1_TXD | UART2_TXD;
- *(volatile uint32_t*) scu_pin_ctrl2 = ctrl;
-
- ctrl = *(volatile uint32_t*) scu_pin_ctrl1;
- ctrl |= UART3_TXD;
- ctrl &= (~UART4_TXD); // Disable
- *(volatile uint32_t*) scu_pin_ctrl1 = ctrl;
- break;
- case 4:
- // Disable UART3's TXD and enable others
- ctrl = *(volatile uint32_t*) scu_pin_ctrl2;
- ctrl |= UART1_TXD | UART2_TXD;
- *(volatile uint32_t*) scu_pin_ctrl2 = ctrl;
-
- ctrl = *(volatile uint32_t*) scu_pin_ctrl1;
- ctrl &= (~UART3_TXD); // Disable
- ctrl |= UART4_TXD;
- *(volatile uint32_t*) scu_pin_ctrl1 = ctrl;
- break;
- default:
- // Any other slots we need to enable all TXDs
- ctrl = *(volatile uint32_t*) scu_pin_ctrl2;
- ctrl |= UART1_TXD | UART2_TXD;
- *(volatile uint32_t*) scu_pin_ctrl2 = ctrl;
-
- ctrl = *(volatile uint32_t*) scu_pin_ctrl1;
- ctrl |= UART3_TXD | UART4_TXD;
- *(volatile uint32_t*) scu_pin_ctrl1 = ctrl;
- break;
- }
-
- munmap(scu_reg, PAGE_SIZE);
- close(scu_fd);
-
- return 0;
-}
-
-// Display the given POST code using GPIO port
-static int
-pal_post_display(uint8_t status) {
- char path[64] = {0};
- int ret;
- char *val;
-
-#ifdef DEBUG
- syslog(LOG_WARNING, "pal_post_display: status is %d\n", status);
-#endif
-
- sprintf(path, GPIO_VAL, GPIO_POSTCODE_0);
-
- if (BIT(status, 0)) {
- val = "1";
- } else {
- val = "0";
- }
-
- ret = write_device(path, val);
- if (ret) {
- goto post_exit;
- }
-
- sprintf(path, GPIO_VAL, GPIO_POSTCODE_1);
- if (BIT(status, 1)) {
- val = "1";
- } else {
- val = "0";
- }
-
- ret = write_device(path, val);
- if (ret) {
- goto post_exit;
- }
-
- sprintf(path, GPIO_VAL, GPIO_POSTCODE_2);
- if (BIT(status, 2)) {
- val = "1";
- } else {
- val = "0";
- }
-
- ret = write_device(path, val);
- if (ret) {
- goto post_exit;
- }
-
- sprintf(path, GPIO_VAL, GPIO_POSTCODE_3);
- if (BIT(status, 3)) {
- val = "1";
- } else {
- val = "0";
- }
-
- ret = write_device(path, val);
- if (ret) {
- goto post_exit;
- }
-
- sprintf(path, GPIO_VAL, GPIO_POSTCODE_4);
- if (BIT(status, 4)) {
- val = "1";
- } else {
- val = "0";
- }
-
- ret = write_device(path, val);
- if (ret) {
- goto post_exit;
- }
-
- sprintf(path, GPIO_VAL, GPIO_POSTCODE_5);
- if (BIT(status, 5)) {
- val = "1";
- } else {
- val = "0";
- }
-
- ret = write_device(path, val);
- if (ret) {
- goto post_exit;
- }
-
- sprintf(path, GPIO_VAL, GPIO_POSTCODE_6);
- if (BIT(status, 6)) {
- val = "1";
- } else {
- val = "0";
- }
-
- ret = write_device(path, val);
- if (ret) {
- goto post_exit;
- }
-
- sprintf(path, GPIO_VAL, GPIO_POSTCODE_7);
- if (BIT(status, 7)) {
- val = "1";
- } else {
- val = "0";
- }
-
- ret = write_device(path, val);
- if (ret) {
- goto post_exit;
- }
-
-post_exit:
- if (ret) {
-#ifdef DEBUG
- syslog(LOG_WARNING, "write_device failed for %s\n", path);
-#endif
- return -1;
- } else {
- return 0;
- }
-}
-
-// Platform Abstraction Layer (PAL) Functions
-int
-pal_get_platform_name(char *name) {
- strcpy(name, YOSEMITE_PLATFORM_NAME);
-
- return 0;
-}
-
-int
-pal_get_num_slots(uint8_t *num) {
- *num = YOSEMITE_MAX_NUM_SLOTS;
-
- return 0;
-}
-
-int
-pal_is_server_prsnt(uint8_t slot_id, uint8_t *status) {
- int val;
- char path[64] = {0};
-
- if (slot_id < 1 || slot_id > 4) {
- return -1;
- }
-
- sprintf(path, GPIO_VAL, gpio_prsnt[slot_id]);
-
- if (read_device(path, &val)) {
- return -1;
- }
-
- if (val == 0x0) {
- *status = 1;
- } else {
- *status = 0;
- }
-
- return 0;
-}
-
-int
-pal_is_debug_card_prsnt(uint8_t *status) {
- int val;
- char path[64] = {0};
-
- sprintf(path, GPIO_VAL, GPIO_DBG_CARD_PRSNT);
-
- if (read_device(path, &val)) {
- return -1;
- }
-
- if (val == 0x0) {
- *status = 1;
- } else {
- *status = 0;
- }
-
- return 0;
-}
-
-int
-pal_get_server_power(uint8_t slot_id, uint8_t *status) {
- int ret;
- char value[MAX_VALUE_LEN];
- bic_gpio_t gpio;
-
- ret = bic_get_gpio(slot_id, &gpio);
- if (ret) {
- // Check for if the BIC is irresponsive due to 12V_OFF or 12V_CYCLE
- pal_get_last_pwr_state(slot_id, value);
- if (!(strcmp(value, "off"))) {
- *status = SERVER_POWER_OFF;
- return 0;
- } else {
- return ret;
- }
- }
-
- if (gpio.pwrgood_cpu) {
- *status = SERVER_POWER_ON;
- } else {
- *status = SERVER_POWER_OFF;
- }
-
- return 0;
-}
-
-// Power Off, Power On, or Power Reset the server in given slot
-int
-pal_set_server_power(uint8_t slot_id, uint8_t cmd) {
- uint8_t status;
- bool gs_flag = false;
-
- if (slot_id < 1 || slot_id > 4) {
- return -1;
- }
-
- if (pal_get_server_power(slot_id, &status) < 0) {
- return -1;
- }
-
- switch(cmd) {
- case SERVER_POWER_ON:
- if (status == SERVER_POWER_ON)
- return 1;
- else
- return server_power_on(slot_id);
- break;
-
- case SERVER_POWER_OFF:
- if (status == SERVER_POWER_OFF)
- return 1;
- else
- return server_power_off(slot_id, gs_flag);
- break;
-
- case SERVER_POWER_CYCLE:
- if (status == SERVER_POWER_ON) {
- if (server_power_off(slot_id, gs_flag))
- return -1;
-
- sleep(DELAY_POWER_CYCLE);
-
- return server_power_on(slot_id);
-
- } else if (status == SERVER_POWER_OFF) {
-
- return (server_power_on(slot_id));
- }
- break;
-
- case SERVER_GRACEFUL_SHUTDOWN:
- if (status == SERVER_POWER_OFF)
- return 1;
- else
- gs_flag = true;
- return server_power_off(slot_id, gs_flag);
- break;
-
- case SERVER_12V_ON:
- return server_12v_on(slot_id);
- break;
-
- case SERVER_12V_OFF:
- return server_12v_off(slot_id);
- break;
-
- case SERVER_12V_CYCLE:
- if (server_12v_off(slot_id)) {
- return -1;
- }
-
- sleep(DELAY_12V_CYCLE);
-
- return (server_12v_on(slot_id));
- default:
- return -1;
- }
-
- return 0;
-}
-
-int
-pal_sled_cycle(void) {
- // Remove the adm1275 module as the HSC device is busy
- system("rmmod adm1275");
-
- // Send command to HSC power cycle
- system("i2cset -y 10 0x40 0xd9 c");
-
- return 0;
-}
-
-// Read the Front Panel Hand Switch and return the position
-int
-pal_get_hand_sw(uint8_t *pos) {
- char path[64] = {0};
- int id1, id2, id4, id8;
- uint8_t loc;
- // Read 4 GPIOs to read the current position
- // id1: GPIOR2(138)
- // id2: GPIOR3(139)
- // id4: GPIOR4(140)
- // id8: GPIOR5(141)
-
- // Read ID1
- sprintf(path, GPIO_VAL, GPIO_HAND_SW_ID1);
- if (read_device(path, &id1)) {
- return -1;
- }
-
- // Read ID2
- sprintf(path, GPIO_VAL, GPIO_HAND_SW_ID2);
- if (read_device(path, &id2)) {
- return -1;
- }
-
- // Read ID4
- sprintf(path, GPIO_VAL, GPIO_HAND_SW_ID4);
- if (read_device(path, &id4)) {
- return -1;
- }
-
- // Read ID8
- sprintf(path, GPIO_VAL, GPIO_HAND_SW_ID8);
- if (read_device(path, &id8)) {
- return -1;
- }
-
- loc = ((id8 << 3) | (id4 << 2) | (id2 << 1) | (id1));
-
- switch(loc) {
- case 0:
- case 5:
- *pos = HAND_SW_SERVER1;
- break;
- case 1:
- case 6:
- *pos = HAND_SW_SERVER2;
- break;
- case 2:
- case 7:
- *pos = HAND_SW_SERVER3;
- break;
- case 3:
- case 8:
- *pos = HAND_SW_SERVER4;
- break;
- default:
- *pos = HAND_SW_BMC;
- break;
- }
-
- return 0;
-}
-
-// Return the Front panel Power Button
-int
-pal_get_pwr_btn(uint8_t *status) {
- char path[64] = {0};
- int val;
-
- sprintf(path, GPIO_VAL, GPIO_PWR_BTN);
- if (read_device(path, &val)) {
- return -1;
- }
-
- if (val) {
- *status = 0x0;
- } else {
- *status = 0x1;
- }
-
- return 0;
-}
-
-// Return the front panel's Reset Button status
-int
-pal_get_rst_btn(uint8_t *status) {
- char path[64] = {0};
- int val;
-
- sprintf(path, GPIO_VAL, GPIO_RST_BTN);
- if (read_device(path, &val)) {
- return -1;
- }
-
- if (val) {
- *status = 0x0;
- } else {
- *status = 0x1;
- }
-
- return 0;
-}
-
-// Update the Reset button input to the server at given slot
-int
-pal_set_rst_btn(uint8_t slot, uint8_t status) {
- char path[64] = {0};
- char *val;
-
- if (slot < 1 || slot > 4) {
- return -1;
- }
-
- if (status) {
- val = "1";
- } else {
- val = "0";
- }
-
- sprintf(path, GPIO_VAL, gpio_rst_btn[slot]);
- if (write_device(path, val)) {
- return -1;
- }
-
- return 0;
-}
-
-// Update the LED for the given slot with the status
-int
-pal_set_led(uint8_t slot, uint8_t status) {
- char path[64] = {0};
- char *val;
-
- if (slot < 1 || slot > 4) {
- return -1;
- }
-
- if (status) {
- val = "1";
- } else {
- val = "0";
- }
-
- sprintf(path, GPIO_VAL, gpio_led[slot]);
- if (write_device(path, val)) {
- return -1;
- }
-
- return 0;
-}
-
-// Update Heartbeet LED
-int
-pal_set_hb_led(uint8_t status) {
- char path[64] = {0};
- char *val;
-
- if (status) {
- val = "1";
- } else {
- val = "0";
- }
-
- sprintf(path, GPIO_VAL, GPIO_HB_LED);
- if (write_device(path, val)) {
- return -1;
- }
-
- return 0;
-}
-
-// Update the Identification LED for the given slot with the status
-int
-pal_set_id_led(uint8_t slot, uint8_t status) {
- char path[64] = {0};
- char *val;
-
- if (slot < 1 || slot > 4) {
- return -1;
- }
-
- if (status) {
- val = "1";
- } else {
- val = "0";
- }
-
- sprintf(path, GPIO_VAL, gpio_id_led[slot]);
- if (write_device(path, val)) {
- return -1;
- }
-
- return 0;
-}
-
-static int
-set_usb_mux(uint8_t state) {
- int val;
- char *new_state;
- char path[64] = {0};
-
- sprintf(path, GPIO_VAL, GPIO_USB_MUX_EN_N);
-
- if (read_device(path, &val)) {
- return -1;
- }
-
- // This GPIO Pin is active low
- if (!val == state)
- return 0;
-
- if (state)
- new_state = "0";
- else
- new_state = "1";
-
- if (write_device(path, new_state) < 0) {
-#ifdef DEBUG
- syslog(LOG_WARNING, "write_device failed for %s\n", path);
-#endif
- return -1;
- }
-
- return 0;
-}
-
-// Update the USB Mux to the server at given slot
-int
-pal_switch_usb_mux(uint8_t slot) {
- char *gpio_sw0, *gpio_sw1;
- char path[64] = {0};
-
- // Based on the USB mux table in Schematics
- switch(slot) {
- case HAND_SW_SERVER1:
- gpio_sw0 = "1";
- gpio_sw1 = "0";
- break;
- case HAND_SW_SERVER2:
- gpio_sw0 = "0";
- gpio_sw1 = "0";
- break;
- case HAND_SW_SERVER3:
- gpio_sw0 = "1";
- gpio_sw1 = "1";
- break;
- case HAND_SW_SERVER4:
- gpio_sw0 = "0";
- gpio_sw1 = "1";
- break;
- case HAND_SW_BMC:
- // Disable the USB MUX
- if (set_usb_mux(USB_MUX_OFF) < 0)
- return -1;
- else
- return 0;
- default:
- return 0;
- }
-
- // Enable the USB MUX
- if (set_usb_mux(USB_MUX_ON) < 0)
- return -1;
-
- sprintf(path, GPIO_VAL, GPIO_USB_SW0);
- if (write_device(path, gpio_sw0) < 0) {
-#ifdef DEBUG
- syslog(LOG_WARNING, "write_device failed for %s\n", path);
-#endif
- return -1;
- }
-
- sprintf(path, GPIO_VAL, GPIO_USB_SW1);
- if (write_device(path, gpio_sw1) < 0) {
-#ifdef DEBUG
- syslog(LOG_WARNING, "write_device failed for %s\n", path);
-#endif
- return -1;
- }
-
- return 0;
-}
-
-// Switch the UART mux to the given slot
-int
-pal_switch_uart_mux(uint8_t slot) {
- char * gpio_uart_sel0;
- char * gpio_uart_sel1;
- char * gpio_uart_sel2;
- char * gpio_uart_rx;
- char path[64] = {0};
- int ret;
-
- // Refer the UART select table in schematic
- switch(slot) {
- case HAND_SW_SERVER1:
- gpio_uart_sel2 = "0";
- gpio_uart_sel1 = "0";
- gpio_uart_sel0 = "1";
- gpio_uart_rx = "0";
- break;
- case HAND_SW_SERVER2:
- gpio_uart_sel2 = "0";
- gpio_uart_sel1 = "0";
- gpio_uart_sel0 = "0";
- gpio_uart_rx = "0";
- break;
- case HAND_SW_SERVER3:
- gpio_uart_sel2 = "0";
- gpio_uart_sel1 = "1";
- gpio_uart_sel0 = "1";
- gpio_uart_rx = "0";
- break;
- case HAND_SW_SERVER4:
- gpio_uart_sel2 = "0";
- gpio_uart_sel1 = "1";
- gpio_uart_sel0 = "0";
- gpio_uart_rx = "0";
- break;
- default:
- // for all other cases, assume BMC
- gpio_uart_sel2 = "1";
- gpio_uart_sel1 = "0";
- gpio_uart_sel0 = "0";
- gpio_uart_rx = "1";
- break;
- }
-
- // Diable TXD path from BMC to avoid conflict with SoL
- ret = control_sol_txd(slot);
- if (ret) {
- goto uart_exit;
- }
-
- // Enable Debug card path
- sprintf(path, GPIO_VAL, GPIO_UART_SEL2);
- ret = write_device(path, gpio_uart_sel2);
- if (ret) {
- goto uart_exit;
- }
-
- sprintf(path, GPIO_VAL, GPIO_UART_SEL1);
- ret = write_device(path, gpio_uart_sel1);
- if (ret) {
- goto uart_exit;
- }
-
- sprintf(path, GPIO_VAL, GPIO_UART_SEL0);
- ret = write_device(path, gpio_uart_sel0);
- if (ret) {
- goto uart_exit;
- }
-
- sprintf(path, GPIO_VAL, GPIO_UART_RX);
- ret = write_device(path, gpio_uart_rx);
- if (ret) {
- goto uart_exit;
- }
-
-uart_exit:
- if (ret) {
-#ifdef DEBUG
- syslog(LOG_WARNING, "pal_switch_uart_mux: write_device failed: %s\n", path);
-#endif
- return ret;
- } else {
- return 0;
- }
-}
-
-// Enable POST buffer for the server in given slot
-int
-pal_post_enable(uint8_t slot) {
- int ret;
- int i;
- bic_config_t config = {0};
- bic_config_u *t = (bic_config_u *) &config;
-
- ret = bic_get_config(slot, &config);
- if (ret) {
-#ifdef DEBUG
- syslog(LOG_WARNING, "post_enable: bic_get_config failed for fru: %d\n", slot);
-#endif
- return ret;
- }
-
- t->bits.post = 1;
-
- ret = bic_set_config(slot, &config);
- if (ret) {
-#ifdef DEBUG
- syslog(LOG_WARNING, "post_enable: bic_set_config failed\n");
-#endif
- return ret;
- }
-
- return 0;
-}
-
-// Disable POST buffer for the server in given slot
-int
-pal_post_disable(uint8_t slot) {
- int ret;
- int i;
- bic_config_t config = {0};
- bic_config_u *t = (bic_config_u *) &config;
-
- ret = bic_get_config(slot, &config);
- if (ret) {
- return ret;
- }
-
- t->bits.post = 0;
-
- ret = bic_set_config(slot, &config);
- if (ret) {
- return ret;
- }
-
- return 0;
-}
-
-// Get the last post code of the given slot
-int
-pal_post_get_last(uint8_t slot, uint8_t *status) {
- int ret;
- uint8_t buf[MAX_IPMB_RES_LEN] = {0x0};
- uint8_t len;
- int i;
-
- ret = bic_get_post_buf(slot, buf, &len);
- if (ret) {
- return ret;
- }
-
- // The post buffer is LIFO and the first byte gives the latest post code
- *status = buf[0];
-
- return 0;
-}
-
-// Handle the received post code, for now display it on debug card
-int
-pal_post_handle(uint8_t slot, uint8_t status) {
- uint8_t prsnt, pos;
- int ret;
-
- // Check for debug card presence
- ret = pal_is_debug_card_prsnt(&prsnt);
- if (ret) {
- return ret;
- }
-
- // No debug card present, return
- if (!prsnt) {
- return 0;
- }
-
- // Get the hand switch position
- ret = pal_get_hand_sw(&pos);
- if (ret) {
- return ret;
- }
-
- // If the give server is not selected, return
- if (pos != slot) {
- return 0;
- }
-
- // Display the post code in the debug card
- ret = pal_post_display(status);
- if (ret) {
- return ret;
- }
-
- return 0;
-}
-
-
-static int
-read_kv(char *key, char *value) {
-
- FILE *fp;
- int rc;
-
- fp = fopen(key, "r");
- if (!fp) {
- int err = errno;
-#ifdef DEBUG
- syslog(LOG_WARNING, "read_kv: failed to open %s", key);
-#endif
- return err;
- }
-
- rc = (int) fread(value, 1, MAX_VALUE_LEN, fp);
- fclose(fp);
- if (rc <= 0) {
-#ifdef DEBUG
- syslog(LOG_INFO, "read_kv: failed to read %s", key);
-#endif
- return ENOENT;
- } else {
- return 0;
- }
-}
-
-static int
-write_kv(char *key, char *value) {
-
- FILE *fp;
- int rc;
-
- fp = fopen(key, "w");
- if (!fp) {
- int err = errno;
-#ifdef DEBUG
- syslog(LOG_WARNING, "write_kv: failed to open %s", key);
-#endif
- return err;
- }
-
- rc = fwrite(value, 1, strlen(value), fp);
- fclose(fp);
-
- if (rc < 0) {
-#ifdef DEBUG
- syslog(LOG_WARNING, "write_kv: failed to write to %s", key);
-#endif
- return ENOENT;
- } else {
- return 0;
- }
-}
-
-int
-pal_get_fru_id(char *str, uint8_t *fru) {
-
- return yosemite_common_fru_id(str, fru);
-}
-
-int
-pal_get_fru_name(uint8_t fru, char *name) {
-
- return yosemite_common_fru_name(fru, name);
-}
-
-int
-pal_get_fru_sdr_path(uint8_t fru, char *path) {
- return yosemite_sensor_sdr_path(fru, path);
-}
-
-int
-pal_get_fru_sensor_list(uint8_t fru, uint8_t **sensor_list, int *cnt) {
-
- switch(fru) {
- case FRU_SLOT1:
- case FRU_SLOT2:
- case FRU_SLOT3:
- case FRU_SLOT4:
- *sensor_list = (uint8_t *) bic_sensor_list;
- *cnt = bic_sensor_cnt;
- break;
- case FRU_SPB:
- *sensor_list = (uint8_t *) spb_sensor_list;
- *cnt = spb_sensor_cnt;
- break;
- case FRU_NIC:
- *sensor_list = (uint8_t *) nic_sensor_list;
- *cnt = nic_sensor_cnt;
- break;
- default:
-#ifdef DEBUG
- syslog(LOG_WARNING, "pal_get_fru_sensor_list: Wrong fru id %u", fru);
-#endif
- return -1;
- }
- return 0;
-}
-
-int
-pal_fruid_write(uint8_t fru, char *path) {
- return bic_write_fruid(fru, 0, path);
-}
-
-int
-pal_sensor_sdr_init(uint8_t fru, sensor_info_t *sinfo) {
- return yosemite_sensor_sdr_init(fru, sinfo);
-}
-
-int
-pal_sensor_read(uint8_t fru, uint8_t sensor_num, void *value) {
- return yosemite_sensor_read(fru, sensor_num, value);
-}
-
-int
-pal_get_sensor_threshold(uint8_t fru, uint8_t sensor_num, uint8_t thresh, void *value) {
- return yosemite_sensor_threshold(fru, sensor_num, thresh, value);
-}
-
-int
-pal_get_sensor_name(uint8_t fru, uint8_t sensor_num, char *name) {
- return yosemite_sensor_name(fru, sensor_num, name);
-}
-
-int
-pal_get_sensor_units(uint8_t fru, uint8_t sensor_num, char *units) {
- return yosemite_sensor_units(fru, sensor_num, units);
-}
-
-int
-pal_get_fruid_path(uint8_t fru, char *path) {
- return yosemite_get_fruid_path(fru, path);
-}
-
-int
-pal_get_fruid_eeprom_path(uint8_t fru, char *path) {
- return yosemite_get_fruid_eeprom_path(fru, path);
-}
-
-int
-pal_get_fruid_name(uint8_t fru, char *name) {
- return yosemite_get_fruid_name(fru, name);
-}
-
-
-static int
-get_key_value(char* key, char *value) {
-
- char kpath[64] = {0};
-
- sprintf(kpath, KV_STORE, key);
-
- if (access(KV_STORE_PATH, F_OK) == -1) {
- mkdir(KV_STORE_PATH, 0777);
- }
-
- return read_kv(kpath, value);
-}
-
-static int
-set_key_value(char *key, char *value) {
-
- char kpath[64] = {0};
-
- sprintf(kpath, KV_STORE, key);
-
- if (access(KV_STORE_PATH, F_OK) == -1) {
- mkdir(KV_STORE_PATH, 0777);
- }
-
- return write_kv(kpath, value);
-}
-
-int
-pal_get_key_value(char *key, char *value) {
-
- int ret;
- int i;
-
- i = 0;
- while(strcmp(key_list[i], LAST_KEY)) {
-
- if (!strcmp(key, key_list[i])) {
- // Key is valid
- if ((ret = get_key_value(key, value)) < 0 ) {
-#ifdef DEBUG
- syslog(LOG_WARNING, "pal_get_key_value: get_key_value failed. %d", ret);
-#endif
- return ret;
- }
- return ret;
- }
- i++;
- }
-
- return -1;
-}
-
-int
-pal_set_def_key_value() {
-
- int ret;
- int i;
- char kpath[64] = {0};
-
- i = 0;
- while(strcmp(key_list[i], LAST_KEY)) {
-
- sprintf(kpath, KV_STORE, key_list[i]);
-
- if (access(kpath, F_OK) == -1) {
- if ((ret = set_key_value(key_list[i], def_val_list[i])) < 0) {
-#ifdef DEBUG
- syslog(LOG_WARNING, "pal_set_def_key_value: set_key_value failed. %d", ret);
-#endif
- }
- }
- i++;
- }
-
- return 0;
-}
-
-int
-pal_set_key_value(char *key, char *value) {
-
- int ret;
- int i;
-
- i = 0;
- while(strcmp(key_list[i], LAST_KEY)) {
-
- if (!strcmp(key, key_list[i])) {
- // Key is valid
- if ((ret = set_key_value(key, value)) < 0) {
-#ifdef DEBUG
- syslog(LOG_WARNING, "pal_set_key_value: set_key_value failed. %d", ret);
-#endif
- return ret;
- }
- return ret;
- }
- i++;
- }
-
- return -1;
-}
-
-int
-pal_get_fru_devtty(uint8_t fru, char *devtty) {
-
- switch(fru) {
- case FRU_SLOT1:
- sprintf(devtty, "/dev/ttyS2");
- break;
- case FRU_SLOT2:
- sprintf(devtty, "/dev/ttyS1");
- break;
- case FRU_SLOT3:
- sprintf(devtty, "/dev/ttyS4");
- break;
- case FRU_SLOT4:
- sprintf(devtty, "/dev/ttyS3");
- break;
- default:
-#ifdef DEBUG
- syslog(LOG_WARNING, "pal_get_fru_devtty: Wrong fru id %u", fru);
-#endif
- return -1;
- }
- return 0;
-}
-
-void
-pal_dump_key_value(void) {
- int i;
- int ret;
-
- char value[MAX_VALUE_LEN] = {0x0};
-
- while (strcmp(key_list[i], LAST_KEY)) {
- printf("%s:", key_list[i]);
- if (ret = get_key_value(key_list[i], value) < 0) {
- printf("\n");
- } else {
- printf("%s\n", value);
- }
- i++;
- memset(value, 0, MAX_VALUE_LEN);
- }
-}
-
-int
-pal_set_last_pwr_state(uint8_t fru, char *state) {
-
- int ret;
- char key[MAX_KEY_LEN] = {0};
-
- sprintf(key, "pwr_server%d_last_state", (int) fru);
-
- ret = pal_set_key_value(key, state);
- if (ret < 0) {
-#ifdef DEBUG
- syslog(LOG_WARNING, "pal_set_last_pwr_state: pal_set_key_value failed for "
- "fru %u", fru);
-#endif
- }
- return ret;
-}
-
-int
-pal_get_last_pwr_state(uint8_t fru, char *state) {
- int ret;
- char key[MAX_KEY_LEN] = {0};
-
- switch(fru) {
- case FRU_SLOT1:
- case FRU_SLOT2:
- case FRU_SLOT3:
- case FRU_SLOT4:
-
- sprintf(key, "pwr_server%d_last_state", (int) fru);
-
- ret = pal_get_key_value(key, state);
- if (ret < 0) {
-#ifdef DEBUG
- syslog(LOG_WARNING, "pal_get_last_pwr_state: pal_get_key_value failed for "
- "fru %u", fru);
-#endif
- }
- return ret;
- case FRU_SPB:
- case FRU_NIC:
- sprintf(state, "on");
- return 0;
- }
-}
-
-int
-pal_get_sys_guid(uint8_t slot, char *guid) {
- int ret;
-
- return bic_get_sys_guid(slot, guid);
-}
-
-int
-pal_set_sysfw_ver(uint8_t slot, uint8_t *ver) {
- int i;
- char key[MAX_KEY_LEN] = {0};
- char str[MAX_VALUE_LEN] = {0};
- char tstr[10] = {0};
-
- sprintf(key, "sysfw_ver_slot%d", (int) slot);
-
- for (i = 0; i < SIZE_SYSFW_VER; i++) {
- sprintf(tstr, "%02x", ver[i]);
- strcat(str, tstr);
- }
-
- return pal_set_key_value(key, str);
-}
-
-int
-pal_get_sysfw_ver(uint8_t slot, uint8_t *ver) {
- int i;
- int j = 0;
- int ret;
- int msb, lsb;
- char key[MAX_KEY_LEN] = {0};
- char str[MAX_VALUE_LEN] = {0};
- char tstr[4] = {0};
-
- sprintf(key, "sysfw_ver_slot%d", (int) slot);
-
- ret = pal_get_key_value(key, str);
- if (ret) {
- return ret;
- }
-
- for (i = 0; i < 2*SIZE_SYSFW_VER; i += 2) {
- sprintf(tstr, "%c\n", str[i]);
- msb = strtol(tstr, NULL, 16);
-
- sprintf(tstr, "%c\n", str[i+1]);
- lsb = strtol(tstr, NULL, 16);
- ver[j++] = (msb << 4) | lsb;
- }
-
- return 0;
-}
-
-int
-pal_is_bmc_por(void) {
- uint32_t scu_fd;
- uint32_t wdt;
- void *scu_reg;
- void *scu_wdt;
-
- scu_fd = open("/dev/mem", O_RDWR | O_SYNC );
- if (scu_fd < 0) {
- return 0;
- }
-
- scu_reg = mmap(NULL, PAGE_SIZE, PROT_READ|PROT_WRITE, MAP_SHARED, scu_fd,
- AST_WDT_BASE);
- scu_wdt = (char*)scu_reg + WDT_OFFSET;
-
- wdt = *(volatile uint32_t*) scu_wdt;
-
- munmap(scu_reg, PAGE_SIZE);
- close(scu_fd);
-
- if (wdt & 0xff00) {
- return 0;
- } else {
- return 1;
- }
-}
-
-int
-pal_get_fru_discrete_list(uint8_t fru, uint8_t **sensor_list, int *cnt) {
-
- switch(fru) {
- case FRU_SLOT1:
- case FRU_SLOT2:
- case FRU_SLOT3:
- case FRU_SLOT4:
- *sensor_list = (uint8_t *) bic_discrete_list;
- *cnt = bic_discrete_cnt;
- break;
- case FRU_SPB:
- case FRU_NIC:
- return -1;
- default:
-#ifdef DEBUG
- syslog(LOG_WARNING, "pal_get_fru_discrete_list: Wrong fru id %u", fru);
-#endif
- return -1;
- }
- return 0;
-}
-
-static void
-_print_sensor_discrete_log(uint8_t fru, uint8_t snr_num, char *snr_name,
- uint8_t val, char *event) {
- if (val) {
- syslog(LOG_CRIT, "ASSERT: %s discrete - raised - FRU: %d, num: 0x%X,"
- " snr: %-16s val: %d", event, fru, snr_num, snr_name, val);
- } else {
- syslog(LOG_CRIT, "DEASSERT: %s discrete - settled - FRU: %d, num: 0x%X,"
- " snr: %-16s val: %d", event, fru, snr_num, snr_name, val);
- }
-}
-
-int
-pal_sensor_discrete_check(uint8_t fru, uint8_t snr_num, char *snr_name,
- uint8_t o_val, uint8_t n_val) {
-
- char name[32];
- bool valid = false;
- uint8_t diff = o_val ^ n_val;
-
- if (GETBIT(diff, 0)) {
- switch(snr_num) {
- case BIC_SENSOR_SYSTEM_STATUS:
- sprintf(name, "SOC_Thermal_Trip");
- valid = true;
- break;
- case BIC_SENSOR_VR_HOT:
- sprintf(name, "SOC_VR_Hot");
- valid = true;
- break;
- case BIC_SENSOR_CPU_DIMM_HOT:
- sprintf(name, "SOC_Hot");
- valid = true;
- break;
- }
- if (valid) {
- _print_sensor_discrete_log( fru, snr_num, snr_name, GETBIT(n_val, 0), name);
- valid = false;
- }
- }
-
- if (GETBIT(diff, 1)) {
- switch(snr_num) {
- case BIC_SENSOR_SYSTEM_STATUS:
- sprintf(name, "SOC_FIVR_Fault");
- valid = true;
- break;
- case BIC_SENSOR_VR_HOT:
- sprintf(name, "SOC_DIMM_VR_Hot");
- valid = true;
- break;
- case BIC_SENSOR_CPU_DIMM_HOT:
- sprintf(name, "SOC_MEMHOT");
- valid = true;
- break;
- }
- if (valid) {
- _print_sensor_discrete_log( fru, snr_num, snr_name, GETBIT(n_val, 1), name);
- valid = false;
- }
- }
-
- if (GETBIT(diff, 2)) {
- switch(snr_num) {
- case BIC_SENSOR_SYSTEM_STATUS:
- sprintf(name, "SOC_Throttle");
- valid = true;
- break;
- }
- if (valid) {
- _print_sensor_discrete_log( fru, snr_num, snr_name, GETBIT(n_val, 2), name);
- valid = false;
- }
- }
-}
-
-static int
-pal_store_crashdump(uint8_t fru) {
-
- return yosemite_common_crashdump(fru);
-}
-
-int
-pal_sel_handler(uint8_t fru, uint8_t snr_num) {
-
- switch(snr_num) {
- case CATERR:
- pal_store_crashdump(fru);
- break;
- }
-
- return 0;
-}
-
-int
-pal_get_event_sensor_name(uint8_t fru, uint8_t snr_num, char *name) {
-
- switch(snr_num) {
- case SYSTEM_EVENT:
- sprintf(name, "SYSTEM_EVENT");
- break;
- case THERM_THRESH_EVT:
- sprintf(name, "THERM_THRESH_EVT");
- break;
- case BUTTON:
- sprintf(name, "BUTTON");
- break;
- case POWER_STATE:
- sprintf(name, "POWER_STATE");
- break;
- case CRITICAL_IRQ:
- sprintf(name, "CRITICAL_IRQ");
- break;
- case POST_ERROR:
- sprintf(name, "POST_ERROR");
- break;
- case MACHINE_CHK_ERR:
- sprintf(name, "MACHINE_CHK_ERR");
- break;
- case PCIE_ERR:
- sprintf(name, "PCIE_ERR");
- break;
- case IIO_ERR:
- sprintf(name, "IIO_ERR");
- break;
- case MEMORY_ECC_ERR:
- sprintf(name, "MEMORY_ECC_ERR");
- break;
- case PROCHOT_EXT:
- sprintf(name, "PROCHOT_EXT");
- break;
- case PWR_ERR:
- sprintf(name, "PWR_ERR");
- break;
- case CATERR:
- sprintf(name, "CATERR");
- break;
- default:
- sprintf(name, "unknown");
- break;
- }
-
- return 0;
-}
-
-int
-pal_parse_sel(uint8_t fru, uint8_t snr_num, uint8_t *event_data,
- char *error_log) {
-
- char *ed = event_data;
- char temp_log[128] = {0};
- uint8_t temp;
-
- switch(snr_num) {
- case SYSTEM_EVENT:
- sprintf(error_log, "SYSTEM_EVENT");
- if (ed[0] == 0xE5) {
- strcat(error_log, ": Cause of Time change");
-
- if (ed[2] == 0x00)
- strcat(error_log, ": NTP");
- else if (ed[2] == 0x01)
- strcat(error_log, ": Host RTL");
- else if (ed[2] == 0x02)
- strcat(error_log, ": Set SEL time cmd ");
- else if (ed[2] == 0x03)
- strcat(error_log, ": Set SEL time UTC offset cmd");
- else
- strcat(error_log, ": Unknown");
-
- if (ed[1] == 0x00)
- strcat(error_log, ": First Time");
- else if(ed[1] == 0x80)
- strcat(error_log, ": Second Time");
-
- }
- break;
-
- case THERM_THRESH_EVT:
- sprintf(error_log, "THERM_THRESH_EVT");
- if (ed[0] == 0x1)
- strcat(error_log, ": Limit Exceeded");
- else
- strcat(error_log, ": Unknown");
- break;
-
- case BUTTON:
- sprintf(error_log, "BUTTON");
- if (ed[0] == 0x0)
- strcat(error_log, ": Power button pressed");
- else if (ed[0] == 0x2)
- strcat(error_log, ": Reset button pressed");
- else
- strcat(error_log, ": Unknown");
- break;
-
- case POWER_STATE:
- sprintf(error_log, "POWER_STATE");
- if (ed[0] == 0x0)
- strcat(error_log, ": Transition to Running");
- else if (ed[0] == 0x2)
- strcat(error_log, ": Transition to Power Off");
- else
- strcat(error_log, ": Unknown");
- break;
-
- case CRITICAL_IRQ:
- sprintf(error_log, "CRITICAL_IRQ");
- if (ed[0] == 0x0)
- strcat(error_log, ": Diagnostic Interrupt");
- else
- strcat(error_log, ": Unknown");
- break;
-
- case POST_ERROR:
- sprintf(error_log, "POST_ERROR");
- if ((ed[0] & 0x0F) == 0x0)
- strcat(error_log, ": System Firmware Error");
- else
- strcat(error_log, ": Unknown");
- if (((ed[0] >> 6) & 0x03) == 0x3) {
- // TODO: Need to implement IPMI spec based Post Code
- strcat(error_log, ": IPMI Post Code");
- } else if (((ed[0] >> 6) & 0x03) == 0x2) {
- sprintf(temp_log, "OEM Post Code: 0x%X 0x%X", ed[2], ed[1]);
- strcat(error_log, temp_log);
- }
- break;
-
- case MACHINE_CHK_ERR:
- sprintf(error_log, "MACHINE_CHK_ERR");
- if ((ed[0] & 0x0F) == 0x0B) {
- strcat(error_log, ": Uncorrectable");
- } else if ((ed[0] & 0x0F) == 0x0C) {
- strcat(error_log, ": Correctable");
- } else {
- strcat(error_log, ": Unknown");
- }
-
- sprintf(temp_log, "Machine Check bank Number - %d ", ed[1]);
- strcat(error_log, temp_log);
- sprintf(temp_log, "CPU - %d, Core - %d ", ed[2] >> 5, ed[2] & 0x1F);
- strcat(error_log, temp_log);
-
- break;
-
- case PCIE_ERR:
- sprintf(error_log, "PCIE_ERR");
- if ((ed[0] & 0xF) == 0x4)
- strcat(error_log, ": PCI PERR");
- else if ((ed[0] & 0xF) == 0x5)
- strcat(error_log, ": PCI SERR");
- else if ((ed[0] & 0xF) == 0x7)
- strcat(error_log, ": Correctable");
- else if ((ed[0] & 0xF) == 0x8)
- strcat(error_log, ": Uncorrectable");
- else if ((ed[0] & 0xF) == 0xA)
- strcat(error_log, ": Bus Fatal");
- else
- strcat(error_log, ": Unknown");
- break;
-
- case IIO_ERR:
- sprintf(error_log, "IIO_ERR");
- if ((ed[0] & 0xF) == 0) {
-
- sprintf(temp_log, ": CPU - %d, Error ID - 0x%X", (ed[2] & 0xE0) >> 5,
- ed[1]);
- strcat(error_log, temp_log);
-
- temp = ed[2] & 0x7;
- if (temp == 0x0)
- strcat(error_log, ": IRP0");
- else if (temp == 0x1)
- strcat(error_log, ": IRP1");
- else if (temp == 0x2)
- strcat(error_log, ": IIO-Core");
- else if (temp == 0x3)
- strcat(error_log, ": VT-d");
- else if (temp == 0x4)
- strcat(error_log, ": Intel Quick Data");
- else if (temp == 0x5)
- strcat(error_log, ": Misc");
- else
- strcat(error_log, ": Reserved");
- }
- break;
-
- case MEMORY_ECC_ERR:
- sprintf(error_log, "MEMORY_ECC_ERR");
- if ((ed[0] & 0x0F) == 0x0)
- strcat(error_log, ": Correctable");
- else if ((ed[0] & 0x0F) == 0x1)
- strcat(error_log, ": Uncorrectable");
- else if ((ed[0] & 0x0F) == 0x5)
- strcat(error_log, ": Correctable ECC error Logging Limit Reached");
- else
- strcat(error_log, ": Unknown");
-
- if (((ed[1] & 0xC) >> 2) == 0x0) {
- /* All Info Valid */
- sprintf(temp_log, ": CPU# - %d, CHN# - %d, DIMM# - %d ",
- (ed[2] & 0xE0) >> 5, (ed[2] & 0x18) >> 3, ed[2] & 0x7);
- } else if (((ed[1] & 0xC) >> 2) == 0x1) {
- /* DIMM info not valid */
- sprintf(temp_log, ": CPU# - %d, CHN# - %d",
- (ed[2] & 0xE0) >> 5, (ed[2] & 0x18) >> 3);
- } else if (((ed[1] & 0xC) >> 2) == 0x2) {
- /* CHN info not valid */
- sprintf(temp_log, ": CPU# - %d, DIMM# - %d ",
- (ed[2] & 0xE0) >> 5, ed[2] & 0x7);
- } else if (((ed[1] & 0xC) >> 2) == 0x3) {
- /* CPU info not valid */
- sprintf(temp_log, ": CHN# - %d, DIMM# - %d ",
- (ed[2] & 0x18) >> 3, ed[2] & 0x7);
- }
- strcat(error_log, temp_log);
-
- break;
-
- case PROCHOT_EXT:
- sprintf(error_log, "PROCHOT_EXT");
- if ((ed[0] & 0xF) == 0xA)
- strcat(error_log, ": Processor Thermal Throttling Offset");
- else
- strcat(error_log, ": Unknown");
- break;
-
- if ((ed[1] & 0x3) == 0x1)
- strcat(error_log, ": External (VR)");
- else if ((ed[1] & 0x3) == 0x0)
- strcat(error_log, ": Native");
- break;
-
- sprintf(temp_log, ": SOC ID - %d", (ed[2] & 0xE0) >> 5);
- strcat(error_log, temp_log);
-
- case PWR_ERR:
- sprintf(error_log, "PWR_ERR");
- if (ed[0] == 0x2)
- strcat(error_log, ": PCH_PWROK failure");
- else
- strcat(error_log, ": Unknown");
- break;
-
- case CATERR:
- sprintf(error_log, "CATERR");
- if (ed[0] == 0x0)
- strcat(error_log, ": IERR");
- else if (ed[0] == 0xB)
- strcat(error_log, ": MCERR");
- else
- strcat(error_log, ": Unknown");
- break;
-
- default:
- sprintf(error_log, "unknown");
- break;
- }
-
- return 0;
-}
diff --git a/meta-facebook/meta-yosemite/recipes-yosemite/fblibs/files/pal/pal.h b/meta-facebook/meta-yosemite/recipes-yosemite/fblibs/files/pal/pal.h
deleted file mode 100644
index b3f542a..0000000
--- a/meta-facebook/meta-yosemite/recipes-yosemite/fblibs/files/pal/pal.h
+++ /dev/null
@@ -1,149 +0,0 @@
-/*
- *
- * Copyright 2015-present Facebook. All Rights Reserved.
- *
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-
-#ifndef __PAL_H__
-#define __PAL_H__
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <facebook/bic.h>
-#include <facebook/yosemite_common.h>
-#include <facebook/yosemite_fruid.h>
-#include <facebook/yosemite_sensor.h>
-
-#define MAX_KEY_LEN 64
-#define MAX_VALUE_LEN 64
-
-#define KV_STORE "/mnt/data/kv_store/%s"
-#define KV_STORE_PATH "/mnt/data/kv_store"
-
-#define SETBIT(x, y) (x | (1 << y))
-#define GETBIT(x, y) ((x & (1 << y)) > y)
-#define CLEARBIT(x, y) (x & (~(1 << y)))
-#define GETMASK(y) (1 << y)
-
-extern char * key_list[];
-extern const char pal_fru_list[];
-extern const char pal_server_list[];
-
-enum {
- LED_STATE_OFF,
- LED_STATE_ON,
-};
-
-enum {
- USB_MUX_OFF,
- USB_MUX_ON,
-};
-
-enum {
- SERVER_POWER_OFF,
- SERVER_POWER_ON,
- SERVER_POWER_CYCLE,
- SERVER_GRACEFUL_SHUTDOWN,
- SERVER_12V_OFF,
- SERVER_12V_ON,
- SERVER_12V_CYCLE,
-};
-
-enum {
- HAND_SW_SERVER1 = 1,
- HAND_SW_SERVER2,
- HAND_SW_SERVER3,
- HAND_SW_SERVER4,
- HAND_SW_BMC
-};
-
-enum {
- SYSTEM_EVENT = 0xE9,
- THERM_THRESH_EVT = 0x7D,
- BUTTON = 0xAA,
- POWER_STATE = 0xAB,
- CRITICAL_IRQ = 0xEA,
- POST_ERROR = 0x2B,
- MACHINE_CHK_ERR = 0x40,
- PCIE_ERR = 0x41,
- IIO_ERR = 0x43,
- MEMORY_ECC_ERR = 0X63,
- PROCHOT_EXT = 0X51,
- PWR_ERR = 0X56,
- CATERR= 0xEB,
-};
-
-int pal_get_platform_name(char *name);
-int pal_get_num_slots(uint8_t *num);
-int pal_is_server_prsnt(uint8_t slot_id, uint8_t *status);
-int pal_get_server_power(uint8_t slot_id, uint8_t *status);
-int pal_set_server_power(uint8_t slot_id, uint8_t cmd);
-int pal_sled_cycle(void);
-int pal_is_debug_card_prsnt(uint8_t *status);
-int pal_get_hand_sw(uint8_t *pos);
-int pal_switch_usb_mux(uint8_t slot);
-int pal_switch_uart_mux(uint8_t slot);
-int pal_post_enable(uint8_t slot);
-int pal_post_disable(uint8_t slot);
-int pal_post_get_last(uint8_t slot, uint8_t *post);
-int pal_post_handle(uint8_t slot, uint8_t status);
-int pal_get_pwr_btn(uint8_t *status);
-int pal_get_rst_btn(uint8_t *status);
-int pal_set_rst_btn(uint8_t slot, uint8_t status);
-int pal_set_led(uint8_t slot, uint8_t status);
-int pal_set_hb_led(uint8_t status);
-int pal_set_id_led(uint8_t slot, uint8_t status);
-int pal_get_fru_id(char *fru_str, uint8_t *fru);
-int pal_get_fru_name(uint8_t fru, char *name);
-int pal_get_fruid_path(uint8_t fru, char *path);
-int pal_get_fruid_eeprom_path(uint8_t fru, char *path);
-int pal_get_fruid_name(uint8_t fru, char *name);
-int pal_get_fru_sdr_path(uint8_t fru, char *path);
-int pal_get_sensor_units(uint8_t fru, uint8_t sensor_num, char *units);
-int pal_get_fru_sensor_list(uint8_t fru, uint8_t **sensor_list, int *cnt);
-int pal_get_fru_discrete_list(uint8_t fru, uint8_t **sensor_list, int *cnt);
-int pal_sensor_sdr_init(uint8_t fru, sensor_info_t *sinfo);
-int pal_sensor_read(uint8_t fru, uint8_t sensor_num, void *value);
-int pal_get_sensor_name(uint8_t fru, uint8_t sensor_num, char *name);
-int pal_get_sensor_threshold(uint8_t fru, uint8_t sensor_num, uint8_t thresh,
- void *value);
-int pal_get_key_value(char *key, char *value);
-int pal_set_key_value(char *key, char *value);
-int pal_set_def_key_value();
-void pal_dump_key_value(void);
-int pal_get_fru_devtty(uint8_t fru, char *devtty);
-int pal_get_last_pwr_state(uint8_t fru, char *state);
-int pal_set_last_pwr_state(uint8_t fru, char *state);
-int pal_get_sys_guid(uint8_t slot, char *guid);
-int pal_set_sysfw_ver(uint8_t slot, uint8_t *ver);
-int pal_get_sysfw_ver(uint8_t slot, uint8_t *ver);
-int pal_fruid_write(uint8_t slot, char *path);
-int pal_is_bmc_por(void);
-int pal_sensor_discrete_check(uint8_t fru, uint8_t snr_num, char *snr_name,
- uint8_t o_val, uint8_t n_val);
-int pal_get_event_sensor_name(uint8_t fru, uint8_t snr_num, char *name);
-int pal_parse_sel(uint8_t fru, uint8_t snr_num, uint8_t *event_data,
- char *error_log);
-int pal_sel_handler(uint8_t fru, uint8_t snr_num);
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
-
-#endif /* __PAL_H__ */
diff --git a/meta-facebook/meta-yosemite/recipes-yosemite/fblibs/files/yosemite_common/Makefile b/meta-facebook/meta-yosemite/recipes-yosemite/fblibs/files/yosemite_common/Makefile
deleted file mode 100644
index 40ea2a8..0000000
--- a/meta-facebook/meta-yosemite/recipes-yosemite/fblibs/files/yosemite_common/Makefile
+++ /dev/null
@@ -1,11 +0,0 @@
-# Copyright 2015-present Facebook. All Rights Reserved.
-lib: libyosemite_common.so
-
-libyosemite_common.so: yosemite_common.c
- $(CC) $(CFLAGS) -fPIC -pthread -c -o yosemite_common.o yosemite_common.c
- $(CC) -lpthread -shared -o libyosemite_common.so yosemite_common.o -lc
-
-.PHONY: clean
-
-clean:
- rm -rf *.o libyosemite_common.so
diff --git a/meta-facebook/meta-yosemite/recipes-yosemite/fblibs/files/yosemite_common/yosemite_common.c b/meta-facebook/meta-yosemite/recipes-yosemite/fblibs/files/yosemite_common/yosemite_common.c
deleted file mode 100644
index c638809..0000000
--- a/meta-facebook/meta-yosemite/recipes-yosemite/fblibs/files/yosemite_common/yosemite_common.c
+++ /dev/null
@@ -1,150 +0,0 @@
-/*
- *
- * Copyright 2015-present Facebook. All Rights Reserved.
- *
- * This file contains code to support IPMI2.0 Specificaton available @
- * http://www.intel.com/content/www/us/en/servers/ipmi/ipmi-specifications.html
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-#include <stdio.h>
-#include <stdlib.h>
-#include <stdint.h>
-#include <stdbool.h>
-#include <math.h>
-#include <fcntl.h>
-#include <errno.h>
-#include <syslog.h>
-#include <pthread.h>
-#include <string.h>
-#include "yosemite_common.h"
-
-#define CRASHDUMP_BIN "/usr/local/bin/dump.sh"
-#define CRASHDUMP_FILE "/mnt/data/crashdump_"
-
-int
-yosemite_common_fru_name(uint8_t fru, char *str) {
-
- switch(fru) {
- case FRU_SLOT1:
- sprintf(str, "slot1");
- break;
-
- case FRU_SLOT2:
- sprintf(str, "slot2");
- break;
-
- case FRU_SLOT3:
- sprintf(str, "slot3");
- break;
-
- case FRU_SLOT4:
- sprintf(str, "slot4");
- break;
-
- case FRU_SPB:
- sprintf(str, "spb");
- break;
-
- case FRU_NIC:
- sprintf(str, "nic");
- break;
-
- default:
-#ifdef DEBUG
- syslog(LOG_WARNING, "yosemite_common_fru_id: Wrong fru id");
-#endif
- return -1;
- }
-
- return 0;
-}
-
-int
-yosemite_common_fru_id(char *str, uint8_t *fru) {
-
- if (!strcmp(str, "all")) {
- *fru = FRU_ALL;
- } else if (!strcmp(str, "slot1")) {
- *fru = FRU_SLOT1;
- } else if (!strcmp(str, "slot2")) {
- *fru = FRU_SLOT2;
- } else if (!strcmp(str, "slot3")) {
- *fru = FRU_SLOT3;
- } else if (!strcmp(str, "slot4")) {
- *fru = FRU_SLOT4;
- } else if (!strcmp(str, "spb")) {
- *fru = FRU_SPB;
- } else if (!strcmp(str, "nic")) {
- *fru = FRU_NIC;
- } else {
-#ifdef DEBUG
- syslog(LOG_WARNING, "yosemite_common_fru_id: Wrong fru id");
-#endif
- return -1;
- }
-
- return 0;
-}
-
-void *
-generate_dump(void *arg) {
-
- uint8_t fru = *(uint8_t *) arg;
- char cmd[128];
- char fruname[16];
-
- yosemite_common_fru_name(fru, fruname);
-
- // HEADER LINE for the dump
- memset(cmd, 0, 128);
- sprintf(cmd, "%s time > %s%s", CRASHDUMP_BIN, CRASHDUMP_FILE, fruname);
- system(cmd);
-
- // COREID dump
- memset(cmd, 0, 128);
- sprintf(cmd, "%s %s 48 coreid >> %s%s", CRASHDUMP_BIN, fruname,
- CRASHDUMP_FILE, fruname);
- system(cmd);
-
- // MSR dump
- memset(cmd, 0, 128);
- sprintf(cmd, "%s %s 48 msr >> %s%s", CRASHDUMP_BIN, fruname,
- CRASHDUMP_FILE, fruname);
- system(cmd);
-
- syslog(LOG_CRIT, "Crashdump for FRU: %d is generated.", fru);
-}
-
-int
-yosemite_common_crashdump(uint8_t fru) {
-
- if (access(CRASHDUMP_BIN, F_OK) == -1) {
- syslog(LOG_CRIT, "Crashdump for FRU: %d failed : "
- "crashdump binary is not preset", fru);
- return 0;
- }
-
- pthread_t t_dump;
-
- if (pthread_create(&t_dump, NULL, generate_dump, (void*) &fru) < 0) {
- syslog(LOG_WARNING, "pal_store_crashdump: pthread_create for"
- " FRU %d failed\n", fru);
- }
-
- syslog(LOG_INFO, "Crashdump for FRU: %d is being generated.", fru);
-
- return 0;
-}
diff --git a/meta-facebook/meta-yosemite/recipes-yosemite/fblibs/files/yosemite_common/yosemite_common.h b/meta-facebook/meta-yosemite/recipes-yosemite/fblibs/files/yosemite_common/yosemite_common.h
deleted file mode 100644
index f2128ef..0000000
--- a/meta-facebook/meta-yosemite/recipes-yosemite/fblibs/files/yosemite_common/yosemite_common.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- *
- * Copyright 2015-present Facebook. All Rights Reserved.
- *
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-
-#ifndef __YOSEMITE_COMMON_H__
-#define __YOSEMITE_COMMON_H__
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define MAX_NUM_FRUS 6
-enum {
- FRU_ALL = 0,
- FRU_SLOT1 = 1,
- FRU_SLOT2 = 2,
- FRU_SLOT3 = 3,
- FRU_SLOT4 = 4,
- FRU_SPB = 5,
- FRU_NIC = 6,
-};
-
-int yosemite_common_fru_name(uint8_t fru, char *str);
-int yosemite_common_fru_id(char *str, uint8_t *fru);
-int yosemite_common_crashdump(uint8_t fru);
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
-
-#endif /* __YOSEMITE_COMMON_H__ */
diff --git a/meta-facebook/meta-yosemite/recipes-yosemite/fblibs/files/yosemite_fruid/Makefile b/meta-facebook/meta-yosemite/recipes-yosemite/fblibs/files/yosemite_fruid/Makefile
deleted file mode 100644
index eda01dc..0000000
--- a/meta-facebook/meta-yosemite/recipes-yosemite/fblibs/files/yosemite_fruid/Makefile
+++ /dev/null
@@ -1,27 +0,0 @@
-# Copyright 2015-present Facebook. All Rights Reserved.
-#
-# This program file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program in a file named COPYING; if not, write to the
-# Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor,
-# Boston, MA 02110-1301 USA
-
-lib: libyosemite_fruid.so
-
-libyosemite_fruid.so: yosemite_fruid.c
- $(CC) $(CFLAGS) -fPIC -c -o yosemite_fruid.o yosemite_fruid.c
- $(CC) -lyosemite_common -shared -o libyosemite_fruid.so yosemite_fruid.o -lc
-
-.PHONY: clean
-
-clean:
- rm -rf *.o libyosemite_fruid.so
diff --git a/meta-facebook/meta-yosemite/recipes-yosemite/fblibs/files/yosemite_fruid/yosemite_fruid.c b/meta-facebook/meta-yosemite/recipes-yosemite/fblibs/files/yosemite_fruid/yosemite_fruid.c
deleted file mode 100644
index d431d34..0000000
--- a/meta-facebook/meta-yosemite/recipes-yosemite/fblibs/files/yosemite_fruid/yosemite_fruid.c
+++ /dev/null
@@ -1,117 +0,0 @@
-/* Copyright 2015-present Facebook. All Rights Reserved.
- *
- * This file contains code to support IPMI2.0 Specificaton available @
- * http://www.intel.com/content/www/us/en/servers/ipmi/ipmi-specifications.html
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-#include <stdio.h>
-#include <stdlib.h>
-#include <stdint.h>
-#include <syslog.h>
-#include "yosemite_fruid.h"
-
-/* Populate char path[] with the path to the fru's fruid binary dump */
-int
-yosemite_get_fruid_path(uint8_t fru, char *path) {
- char fname[16] = {0};
-
- switch(fru) {
- case FRU_SLOT1:
- sprintf(fname, "slot1");
- break;
- case FRU_SLOT2:
- sprintf(fname, "slot2");
- break;
- case FRU_SLOT3:
- sprintf(fname, "slot3");
- break;
- case FRU_SLOT4:
- sprintf(fname, "slot4");
- break;
- case FRU_SPB:
- sprintf(fname, "spb");
- break;
- case FRU_NIC:
- sprintf(fname, "nic");
- break;
- default:
-#ifdef DEBUG
- syslog(LOG_WARNING, "yosemite_get_fruid_path: wrong fruid");
-#endif
- return -1;
- }
-
- sprintf(path, YOSEMITE_FRU_PATH, fname);
- return 0;
-}
-
-int
-yosemite_get_fruid_eeprom_path(uint8_t fru, char *path) {
- char fname[16] = {0};
-
- switch(fru) {
- case FRU_SLOT1:
- case FRU_SLOT2:
- case FRU_SLOT3:
- case FRU_SLOT4:
- return -1;
- case FRU_SPB:
- sprintf(path, "/sys/class/i2c-adapter/i2c-8/8-0051/eeprom");
- break;
- case FRU_NIC:
- sprintf(path, "/sys/class/i2c-adapter/i2c-12/12-0051/eeprom");
- break;
- default:
-#ifdef DEBUG
- syslog(LOG_WARNING, "yosemite_get_fruid_eeprom_path: wrong fruid");
-#endif
- return -1;
- }
-
- return 0;
-}
-
-/* Populate char name[] with the path to the fru's name */
-int
-yosemite_get_fruid_name(uint8_t fru, char *name) {
-
- switch(fru) {
- case FRU_SLOT1:
- sprintf(name, "MonoLake Board 1");
- break;
- case FRU_SLOT2:
- sprintf(name, "MonoLake Board 2");
- break;
- case FRU_SLOT3:
- sprintf(name, "MonoLake Board 3");
- break;
- case FRU_SLOT4:
- sprintf(name, "MonoLake Board 4");
- break;
- case FRU_SPB:
- sprintf(name, "Side Plane Board");
- break;
- case FRU_NIC:
- sprintf(name, "CX4 NIC");
- break;
- default:
-#ifdef DEBUG
- syslog(LOG_WARNING, "yosemite_get_fruid_name: wrong fruid");
-#endif
- return -1;
- }
- return 0;
-}
diff --git a/meta-facebook/meta-yosemite/recipes-yosemite/fblibs/files/yosemite_fruid/yosemite_fruid.h b/meta-facebook/meta-yosemite/recipes-yosemite/fblibs/files/yosemite_fruid/yosemite_fruid.h
deleted file mode 100644
index 78cdbe4..0000000
--- a/meta-facebook/meta-yosemite/recipes-yosemite/fblibs/files/yosemite_fruid/yosemite_fruid.h
+++ /dev/null
@@ -1,38 +0,0 @@
-/* Copyright 2015-present Facebook. All Rights Reserved.
- *
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-
-#ifndef __YOSEMITE_FRUID_H__
-#define __YOSEMITE_FRUID_H__
-
-#include <facebook/yosemite_common.h>
-
-#define YOSEMITE_FRU_PATH "/tmp/fruid_%s.bin"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-int yosemite_get_fruid_path(uint8_t fru, char *path);
-int yosemite_get_fruid_eeprom_path(uint8_t fru, char *path);
-int yosemite_get_fruid_name(uint8_t fru, char *name);
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
-
-#endif /* __YOSEMITE_FRUID_H__ */
diff --git a/meta-facebook/meta-yosemite/recipes-yosemite/fblibs/files/yosemite_gpio/Makefile b/meta-facebook/meta-yosemite/recipes-yosemite/fblibs/files/yosemite_gpio/Makefile
deleted file mode 100644
index 66c0005..0000000
--- a/meta-facebook/meta-yosemite/recipes-yosemite/fblibs/files/yosemite_gpio/Makefile
+++ /dev/null
@@ -1,27 +0,0 @@
-# Copyright 2015-present Facebook. All Rights Reserved.
-#
-# This program file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program in a file named COPYING; if not, write to the
-# Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor,
-# Boston, MA 02110-1301 USA
-
-lib: libyosemite_gpio.so
-
-libyosemite_gpio.so: yosemite_gpio.c
- $(CC) $(CFLAGS) -fPIC -c -o yosemite_gpio.o yosemite_gpio.c
- $(CC) -shared -o libyosemite_gpio.so yosemite_gpio.o -lc
-
-.PHONY: clean
-
-clean:
- rm -rf *.o libyosemite_gpio.so
diff --git a/meta-facebook/meta-yosemite/recipes-yosemite/fblibs/files/yosemite_gpio/yosemite_gpio.c b/meta-facebook/meta-yosemite/recipes-yosemite/fblibs/files/yosemite_gpio/yosemite_gpio.c
deleted file mode 100644
index 4f22500..0000000
--- a/meta-facebook/meta-yosemite/recipes-yosemite/fblibs/files/yosemite_gpio/yosemite_gpio.c
+++ /dev/null
@@ -1,120 +0,0 @@
-/* Copyright 2015-present Facebook. All Rights Reserved.
- *
- * This file contains code to support IPMI2.0 Specificaton available @
- * http://www.intel.com/content/www/us/en/servers/ipmi/ipmi-specifications.html
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-#include <stdio.h>
-#include <stdlib.h>
-#include <stdint.h>
-#include <syslog.h>
-#include "yosemite_gpio.h"
-
-// List of GPIO pins to be monitored
-const uint8_t gpio_pin_list[] = {
- PWRGOOD_CPU,
- PWRGD_PCH_PWROK,
- PVDDR_VRHOT_N,
- PVCCIN_VRHOT_N,
- FM_FAST_PROCHOT_N,
- PCHHOT_CPU_N,
- FM_CPLD_CPU_DIMM_EVENT_CO_N,
- FM_CPLD_BDXDE_THERMTRIP_N,
- THERMTRIP_PCH_N,
- FM_CPLD_FIVR_FAULT,
- FM_BDXDE_CATERR_LVT3_N,
- FM_BDXDE_ERR2_LVT3_N,
- FM_BDXDE_ERR1_LVT3_N,
- FM_BDXDE_ERR0_LVT3_N,
- //SLP_S4_N,
- FM_NMI_EVENT_BMC_N,
- FM_SMI_BMC_N,
- RST_PLTRST_BMC_N,
- FP_RST_BTN_BUF_N,
- BMC_RST_BTN_OUT_N,
- FM_BDE_POST_CMPLT_N,
- //FM_BDXDE_SLP3_N,
- //FM_PWR_LED_N,
- PWRGD_PVCCIN,
- //SVR_ID0,
- //SVR_ID1,
- //SVR_ID2,
- //SVR_ID3,
- //BMC_READY_N,
- //RESERVED_29,
- //RESERVED_30,
- //RESERVED_31,
-};
-
-size_t gpio_pin_cnt = sizeof(gpio_pin_list)/sizeof(uint8_t);
-const uint32_t gpio_ass_val = 0x0 | (1 << FM_CPLD_FIVR_FAULT);
-
-const char *gpio_pin_name[] = {
- "PWRGOOD_CPU",
- "PWRGD_PCH_PWROK",
- "PVDDR_VRHOT_N",
- "PVCCIN_VRHOT_N",
- "FM_FAST_PROCHOT_N",
- "PCHHOT_CPU_N",
- "FM_CPLD_CPU_DIMM_EVENT_CO_N",
- "FM_CPLD_BDXDE_THERMTRIP_N",
- "THERMTRIP_PCH_N",
- "FM_CPLD_FIVR_FAULT",
- "FM_BDXDE_CATERR_LVT3_N",
- "FM_BDXDE_ERR2_LVT3_N",
- "FM_BDXDE_ERR1_LVT3_N",
- "FM_BDXDE_ERR0_LVT3_N",
- "SLP_S4_N",
- "FM_NMI_EVENT_BMC_N",
- "FM_SMI_BMC_N",
- "RST_PLTRST_BMC_N",
- "FP_RST_BTN_BUF_N",
- "BMC_RST_BTN_OUT_N",
- "FM_BDE_POST_CMPLT_N",
- "FM_BDXDE_SLP3_N",
- "FM_PWR_LED_N",
- "PWRGD_PVCCIN",
- "SVR_ID0",
- "SVR_ID1",
- "SVR_ID2",
- "SVR_ID3",
- "BMC_READY_N",
- "RESERVED_29",
- "RESERVED_30",
- "RESERVED_31"
-};
-
-int
-yosemite_get_gpio_name(uint8_t fru, uint8_t gpio, char *name) {
-
- //TODO: Add support for BMC GPIO pins
- if (fru < 1 || fru > 4) {
-#ifdef DEBUG
- syslog(LOG_WARNING, "yosemite_get_gpio_name: Wrong fru %u", fru);
-#endif
- return -1;
- }
-
- if (gpio < 0 || gpio > MAX_GPIO_PINS) {
-#ifdef DEBUG
- syslog(LOG_WARNING, "yosemite_get_gpio_name: Wrong gpio pin %u", gpio);
-#endif
- return -1;
- }
-
- sprintf(name, "%s", gpio_pin_name[gpio]);
- return 0;
-}
diff --git a/meta-facebook/meta-yosemite/recipes-yosemite/fblibs/files/yosemite_gpio/yosemite_gpio.h b/meta-facebook/meta-yosemite/recipes-yosemite/fblibs/files/yosemite_gpio/yosemite_gpio.h
deleted file mode 100644
index 77808a8..0000000
--- a/meta-facebook/meta-yosemite/recipes-yosemite/fblibs/files/yosemite_gpio/yosemite_gpio.h
+++ /dev/null
@@ -1,39 +0,0 @@
-/* Copyright 2015-present Facebook. All Rights Reserved.
- *
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-
-#ifndef __YOSEMITE_GPIO_H__
-#define __YOSEMITE_GPIO_H__
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <facebook/bic.h>
-
-extern const uint8_t gpio_pin_list[];
-extern const char *gpio_pin_name[];
-extern const uint32_t gpio_ass_val;
-extern size_t gpio_pin_cnt;
-
-int yosemite_get_gpio_name(uint8_t fru, uint8_t gpio, char *name);
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
-
-#endif /* __YOSEMITE_GPIO_H__ */
diff --git a/meta-facebook/meta-yosemite/recipes-yosemite/fblibs/files/yosemite_sensor/Makefile b/meta-facebook/meta-yosemite/recipes-yosemite/fblibs/files/yosemite_sensor/Makefile
deleted file mode 100644
index dd013a9..0000000
--- a/meta-facebook/meta-yosemite/recipes-yosemite/fblibs/files/yosemite_sensor/Makefile
+++ /dev/null
@@ -1,11 +0,0 @@
-# Copyright 2015-present Facebook. All Rights Reserved.
-lib: libyosemite_sensor.so
-
-libyosemite_sensor.so: yosemite_sensor.c
- $(CC) $(CFLAGS) -fPIC -c -o yosemite_sensor.o yosemite_sensor.c
- $(CC) -lm -lbic -lipmi -lipmb -lyosemite_common -shared -o libyosemite_sensor.so yosemite_sensor.o -lc
-
-.PHONY: clean
-
-clean:
- rm -rf *.o libyosemite_sensor.so
diff --git a/meta-facebook/meta-yosemite/recipes-yosemite/fblibs/files/yosemite_sensor/yosemite_sensor.c b/meta-facebook/meta-yosemite/recipes-yosemite/fblibs/files/yosemite_sensor/yosemite_sensor.c
deleted file mode 100644
index 9d075ce..0000000
--- a/meta-facebook/meta-yosemite/recipes-yosemite/fblibs/files/yosemite_sensor/yosemite_sensor.c
+++ /dev/null
@@ -1,883 +0,0 @@
-/*
- *
- * Copyright 2015-present Facebook. All Rights Reserved.
- *
- * This file contains code to support IPMI2.0 Specificaton available @
- * http://www.intel.com/content/www/us/en/servers/ipmi/ipmi-specifications.html
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-#include <stdio.h>
-#include <stdlib.h>
-#include <stdint.h>
-#include <stdbool.h>
-#include <math.h>
-#include <string.h>
-#include <fcntl.h>
-#include <errno.h>
-#include <syslog.h>
-#include "yosemite_sensor.h"
-
-#define LARGEST_DEVICE_NAME 120
-
-#define GPIO_VAL "/sys/class/gpio/gpio%d/value"
-
-#define I2C_BUS_9_DIR "/sys/class/i2c-adapter/i2c-9/"
-#define I2C_BUS_10_DIR "/sys/class/i2c-adapter/i2c-10/"
-
-#define TACH_DIR "/sys/devices/platform/ast_pwm_tacho.0"
-#define ADC_DIR "/sys/devices/platform/ast_adc.0"
-
-#define SP_INLET_TEMP_DEVICE I2C_BUS_9_DIR "9-004e"
-#define SP_OUTLET_TEMP_DEVICE I2C_BUS_9_DIR "9-004f"
-#define HSC_DEVICE I2C_BUS_10_DIR "10-0040"
-
-#define FAN_TACH_RPM "tacho%d_rpm"
-#define ADC_VALUE "adc%d_value"
-#define HSC_IN_VOLT "in1_input"
-#define HSC_OUT_CURR "curr1_input"
-#define HSC_TEMP "temp1_input"
-
-#define UNIT_DIV 1000
-
-#define MEZZ_SENSOR_I2CBUS "11"
-#define MEZZ_SENSOR_I2C_BUS_ADDR "0x1f"
-#define MEZZ_SENSOR_TEMP_REGISTER "0x01"
-
-#define BIC_SENSOR_READ_NA 0x20
-
-#define MAX_SENSOR_NUM 0xFF
-#define ALL_BYTES 0xFF
-#define LAST_REC_ID 0xFFFF
-
-#define YOSEMITE_SDR_PATH "/tmp/sdr_%s.bin"
-
-// List of BIC sensors to be monitored
-const uint8_t bic_sensor_list[] = {
- /* Threshold sensors */
- BIC_SENSOR_MB_OUTLET_TEMP,
- BIC_SENSOR_VCCIN_VR_TEMP,
- BIC_SENSOR_VCC_GBE_VR_TEMP,
- BIC_SENSOR_1V05PCH_VR_TEMP,
- BIC_SENSOR_SOC_TEMP,
- BIC_SENSOR_MB_INLET_TEMP,
- BIC_SENSOR_PCH_TEMP,
- BIC_SENSOR_SOC_THERM_MARGIN,
- BIC_SENSOR_VDDR_VR_TEMP,
- BIC_SENSOR_VCC_GBE_VR_CURR,
- BIC_SENSOR_1V05_PCH_VR_CURR,
- BIC_SENSOR_VCCIN_VR_POUT,
- BIC_SENSOR_VCCIN_VR_CURR,
- BIC_SENSOR_VCCIN_VR_VOL,
- BIC_SENSOR_INA230_POWER,
- BIC_SENSOR_INA230_VOL,
- BIC_SENSOR_SOC_PACKAGE_PWR,
- BIC_SENSOR_SOC_TJMAX,
- BIC_SENSOR_VDDR_VR_POUT,
- BIC_SENSOR_VDDR_VR_CURR,
- BIC_SENSOR_VDDR_VR_VOL,
- BIC_SENSOR_VCC_SCSUS_VR_CURR,
- BIC_SENSOR_VCC_SCSUS_VR_VOL,
- BIC_SENSOR_VCC_SCSUS_VR_TEMP,
- BIC_SENSOR_VCC_SCSUS_VR_POUT,
- BIC_SENSOR_VCC_GBE_VR_POUT,
- BIC_SENSOR_VCC_GBE_VR_VOL,
- BIC_SENSOR_1V05_PCH_VR_POUT,
- BIC_SENSOR_1V05_PCH_VR_VOL,
- BIC_SENSOR_SOC_DIMMA0_TEMP,
- BIC_SENSOR_SOC_DIMMA1_TEMP,
- BIC_SENSOR_SOC_DIMMB0_TEMP,
- BIC_SENSOR_SOC_DIMMB1_TEMP,
- BIC_SENSOR_P3V3_MB,
- BIC_SENSOR_P12V_MB,
- BIC_SENSOR_P1V05_PCH,
- BIC_SENSOR_P3V3_STBY_MB,
- BIC_SENSOR_P5V_STBY_MB,
- BIC_SENSOR_PV_BAT,
- BIC_SENSOR_PVDDR,
- BIC_SENSOR_PVCC_GBE,
-};
-
-const uint8_t bic_discrete_list[] = {
- /* Discrete sensors */
- BIC_SENSOR_SYSTEM_STATUS,
- BIC_SENSOR_VR_HOT,
- BIC_SENSOR_CPU_DIMM_HOT,
-};
-
-// List of SPB sensors to be monitored
-const uint8_t spb_sensor_list[] = {
- SP_SENSOR_INLET_TEMP,
- SP_SENSOR_OUTLET_TEMP,
- //SP_SENSOR_MEZZ_TEMP
- SP_SENSOR_FAN0_TACH,
- SP_SENSOR_FAN1_TACH,
- //SP_SENSOR_AIR_FLOW,
- SP_SENSOR_P5V,
- SP_SENSOR_P12V,
- SP_SENSOR_P3V3_STBY,
- SP_SENSOR_P12V_SLOT1,
- SP_SENSOR_P12V_SLOT2,
- SP_SENSOR_P12V_SLOT3,
- SP_SENSOR_P12V_SLOT4,
- SP_SENSOR_P3V3,
- SP_SENSOR_HSC_IN_VOLT,
- SP_SENSOR_HSC_OUT_CURR,
- SP_SENSOR_HSC_TEMP,
- SP_SENSOR_HSC_IN_POWER,
-};
-
-// List of NIC sensors to be monitored
-const uint8_t nic_sensor_list[] = {
- MEZZ_SENSOR_TEMP,
-};
-
-float spb_sensor_threshold[MAX_SENSOR_NUM][MAX_SENSOR_THRESHOLD + 1] = {0};
-float nic_sensor_threshold[MAX_SENSOR_NUM][MAX_SENSOR_THRESHOLD + 1] = {0};
-
-static void
-sensor_thresh_array_init() {
- static bool init_done = false;
-
- if (init_done)
- return;
-
- spb_sensor_threshold[SP_SENSOR_INLET_TEMP][UCR_THRESH] = 40;
- spb_sensor_threshold[SP_SENSOR_OUTLET_TEMP][UCR_THRESH] = 70;
- spb_sensor_threshold[SP_SENSOR_FAN0_TACH][UCR_THRESH] = 10000;
- spb_sensor_threshold[SP_SENSOR_FAN0_TACH][LCR_THRESH] = 500;
- spb_sensor_threshold[SP_SENSOR_FAN1_TACH][UCR_THRESH] = 10000;
- spb_sensor_threshold[SP_SENSOR_FAN1_TACH][LCR_THRESH] = 500;
- //spb_sensor_threshold[SP_SENSOR_AIR_FLOW][UCR_THRESH] = {75.0, 0, 0, 0, 0, 0, 0, 0};
- spb_sensor_threshold[SP_SENSOR_P5V][UCR_THRESH] = 5.493;
- spb_sensor_threshold[SP_SENSOR_P5V][LCR_THRESH] = 4.501;
- spb_sensor_threshold[SP_SENSOR_P12V][UCR_THRESH] = 13.216;
- spb_sensor_threshold[SP_SENSOR_P12V][LCR_THRESH] = 11.269;
- spb_sensor_threshold[SP_SENSOR_P3V3_STBY][UCR_THRESH] = 3.625;
- spb_sensor_threshold[SP_SENSOR_P3V3_STBY][LCR_THRESH] = 2.973;
- spb_sensor_threshold[SP_SENSOR_P12V_SLOT1][UCR_THRESH] = 13.216;
- spb_sensor_threshold[SP_SENSOR_P12V_SLOT1][LCR_THRESH] = 11.269;
- spb_sensor_threshold[SP_SENSOR_P12V_SLOT2][UCR_THRESH] = 13.216;
- spb_sensor_threshold[SP_SENSOR_P12V_SLOT2][LCR_THRESH] = 11.269;
- spb_sensor_threshold[SP_SENSOR_P12V_SLOT3][UCR_THRESH] = 13.216;
- spb_sensor_threshold[SP_SENSOR_P12V_SLOT3][LCR_THRESH] = 11.269;
- spb_sensor_threshold[SP_SENSOR_P12V_SLOT4][UCR_THRESH] = 13.216;
- spb_sensor_threshold[SP_SENSOR_P12V_SLOT4][LCR_THRESH] = 11.269;
- spb_sensor_threshold[SP_SENSOR_P3V3][UCR_THRESH] = 3.625;
- spb_sensor_threshold[SP_SENSOR_P3V3][LCR_THRESH] = 2.973;
- spb_sensor_threshold[SP_SENSOR_HSC_IN_VOLT][UCR_THRESH] = 13.2;
- spb_sensor_threshold[SP_SENSOR_HSC_IN_VOLT][LCR_THRESH] = 10.8;
- spb_sensor_threshold[SP_SENSOR_HSC_OUT_CURR][UCR_THRESH] = 47.705;
- spb_sensor_threshold[SP_SENSOR_HSC_TEMP][UCR_THRESH] = 120;
- spb_sensor_threshold[SP_SENSOR_HSC_IN_POWER][UCR_THRESH] = 525;
-
- nic_sensor_threshold[MEZZ_SENSOR_TEMP][UCR_THRESH] = 80;
-
- init_done = true;
-}
-
-size_t bic_sensor_cnt = sizeof(bic_sensor_list)/sizeof(uint8_t);
-
-size_t bic_discrete_cnt = sizeof(bic_discrete_list)/sizeof(uint8_t);
-
-size_t spb_sensor_cnt = sizeof(spb_sensor_list)/sizeof(uint8_t);
-
-size_t nic_sensor_cnt = sizeof(nic_sensor_list)/sizeof(uint8_t);
-
-enum {
- FAN0 = 0,
- FAN1,
-};
-
-enum {
- ADC_PIN0 = 0,
- ADC_PIN1,
- ADC_PIN2,
- ADC_PIN3,
- ADC_PIN4,
- ADC_PIN5,
- ADC_PIN6,
- ADC_PIN7,
-};
-
-static sensor_info_t g_sinfo[MAX_NUM_FRUS][MAX_SENSOR_NUM] = {0};
-
-static int
-read_device(const char *device, int *value) {
- FILE *fp;
- int rc;
-
- fp = fopen(device, "r");
- if (!fp) {
- int err = errno;
-
-#ifdef DEBUG
- syslog(LOG_INFO, "failed to open device %s", device);
-#endif
- return err;
- }
-
- rc = fscanf(fp, "%d", value);
- fclose(fp);
-
- if (rc != 1) {
-#ifdef DEBUG
- syslog(LOG_INFO, "failed to read device %s", device);
-#endif
- return ENOENT;
- } else {
- return 0;
- }
-}
-
-static int
-read_device_float(const char *device, float *value) {
- FILE *fp;
- int rc;
- char tmp[10];
-
- fp = fopen(device, "r");
- if (!fp) {
- int err = errno;
-#ifdef DEBUG
- syslog(LOG_INFO, "failed to open device %s", device);
-#endif
- return err;
- }
-
- rc = fscanf(fp, "%s", tmp);
- fclose(fp);
-
- if (rc != 1) {
-#ifdef DEBUG
- syslog(LOG_INFO, "failed to read device %s", device);
-#endif
- return ENOENT;
- }
-
- *value = atof(tmp);
-
- return 0;
-}
-
-static int
-read_temp(const char *device, float *value) {
- char full_name[LARGEST_DEVICE_NAME + 1];
- int tmp;
-
- snprintf(
- full_name, LARGEST_DEVICE_NAME, "%s/temp1_input", device);
- if (read_device(full_name, &tmp)) {
- return -1;
- }
-
- *value = ((float)tmp)/UNIT_DIV;
-
- return 0;
-}
-
-static int
-read_fan_value(const int fan, const char *device, float *value) {
- char device_name[LARGEST_DEVICE_NAME];
- char full_name[LARGEST_DEVICE_NAME];
-
- snprintf(device_name, LARGEST_DEVICE_NAME, device, fan);
- snprintf(full_name, LARGEST_DEVICE_NAME, "%s/%s", TACH_DIR, device_name);
- return read_device_float(full_name, value);
-}
-
-static int
-read_adc_value(const int pin, const char *device, float *value) {
- char device_name[LARGEST_DEVICE_NAME];
- char full_name[LARGEST_DEVICE_NAME];
-
- snprintf(device_name, LARGEST_DEVICE_NAME, device, pin);
- snprintf(full_name, LARGEST_DEVICE_NAME, "%s/%s", ADC_DIR, device_name);
- return read_device_float(full_name, value);
-}
-
-static int
-read_hsc_value(const char *device, float *value) {
- char full_name[LARGEST_DEVICE_NAME];
- int tmp;
-
- snprintf(full_name, LARGEST_DEVICE_NAME, "%s/%s", HSC_DEVICE, device);
- if(read_device(full_name, &tmp)) {
- return -1;
- }
-
- *value = ((float) tmp)/UNIT_DIV;
-
- return 0;
-}
-
-static int
-read_nic_temp(uint8_t snr_num, float *value) {
- char command[64];
- char tmp[8];
-
- if (snr_num == MEZZ_SENSOR_TEMP) {
- sprintf(command, "i2cget -y %s %s %s b", MEZZ_SENSOR_I2CBUS,
- MEZZ_SENSOR_I2C_BUS_ADDR, MEZZ_SENSOR_TEMP_REGISTER);
-
- FILE *fp = popen(command, "r");
- fscanf(fp, "%s", tmp);
- pclose(fp);
-
- *value = (float) strtol(tmp, NULL, 16);
- }
-
- return 0;
-}
-
-static int
-bic_read_sensor_wrapper(uint8_t fru, uint8_t sensor_num, bool discrete,
- void *value) {
-
- int ret;
- sdr_full_t *sdr;
- ipmi_sensor_reading_t sensor;
-
- ret = bic_read_sensor(fru, sensor_num, &sensor);
- if (ret) {
- return ret;
- }
-
- if (sensor.flags & BIC_SENSOR_READ_NA) {
-#ifdef DEBUG
- syslog(LOG_ERR, "bic_read_sensor_wrapper: Reading Not Available");
- syslog(LOG_ERR, "bic_read_sensor_wrapper: sensor_num: 0x%X, flag: 0x%X",
- sensor_num, sensor.flags);
-#endif
- return -1;
- }
-
- if (discrete) {
- *(float *) value = (float) sensor.status;
- return 0;
- }
-
- sdr = &g_sinfo[fru-1][sensor_num].sdr;
-
- // If the SDR is not type1, no need for conversion
- if (sdr->type !=1) {
- *(float *) value = sensor.value;
- return 0;
- }
-
- // y = (mx + b * 10^b_exp) * 10^r_exp
- uint8_t x;
- uint8_t m_lsb, m_msb, m;
- uint8_t b_lsb, b_msb, b;
- int8_t b_exp, r_exp;
-
- x = sensor.value;
-
- m_lsb = sdr->m_val;
- m_msb = sdr->m_tolerance >> 6;
- m = (m_msb << 8) | m_lsb;
-
- b_lsb = sdr->b_val;
- b_msb = sdr->b_accuracy >> 6;
- b = (b_msb << 8) | b_lsb;
-
- // exponents are 2's complement 4-bit number
- b_exp = sdr->rb_exp & 0xF;
- if (b_exp > 7) {
- b_exp = (~b_exp + 1) & 0xF;
- b_exp = -b_exp;
- }
- r_exp = (sdr->rb_exp >> 4) & 0xF;
- if (r_exp > 7) {
- r_exp = (~r_exp + 1) & 0xF;
- r_exp = -r_exp;
- }
-
- //printf("m:%d, x:%d, b:%d, b_exp:%d, r_exp:%d\n", m, x, b, b_exp, r_exp);
-
- * (float *) value = ((m * x) + (b * pow(10, b_exp))) * (pow(10, r_exp));
-
- if ((sensor_num == BIC_SENSOR_SOC_THERM_MARGIN) && (* (float *) value > 0)) {
- * (float *) value -= (float) THERMAL_CONSTANT;
- }
-
- return 0;
-}
-
-int
-yosemite_sensor_sdr_path(uint8_t fru, char *path) {
-
-char fru_name[16] = {0};
-
-switch(fru) {
- case FRU_SLOT1:
- sprintf(fru_name, "%s", "slot1");
- break;
- case FRU_SLOT2:
- sprintf(fru_name, "%s", "slot2");
- break;
- case FRU_SLOT3:
- sprintf(fru_name, "%s", "slot3");
- break;
- case FRU_SLOT4:
- sprintf(fru_name, "%s", "slot4");
- break;
- case FRU_SPB:
- sprintf(fru_name, "%s", "spb");
- break;
- case FRU_NIC:
- sprintf(fru_name, "%s", "nic");
- break;
- default:
-#ifdef DEBUG
- syslog(LOG_WARNING, "yosemite_sensor_sdr_path: Wrong Slot ID\n");
-#endif
- return -1;
-}
-
-sprintf(path, YOSEMITE_SDR_PATH, fru_name);
-
-if (access(path, F_OK) == -1) {
- return -1;
-}
-
-return 0;
-}
-
-/* Populates all sensor_info_t struct using the path to SDR dump */
-int
-sdr_init(char *path, sensor_info_t *sinfo) {
-int fd;
-uint8_t buf[MAX_SDR_LEN] = {0};
-uint8_t bytes_rd = 0;
-uint8_t snr_num = 0;
-sdr_full_t *sdr;
-
-while (access(path, F_OK) == -1) {
- sleep(5);
-}
-
-fd = open(path, O_RDONLY);
-if (fd < 0) {
- syslog(LOG_ERR, "sdr_init: open failed for %s\n", path);
- return -1;
-}
-
-while ((bytes_rd = read(fd, buf, sizeof(sdr_full_t))) > 0) {
- if (bytes_rd != sizeof(sdr_full_t)) {
- syslog(LOG_ERR, "sdr_init: read returns %d bytes\n", bytes_rd);
- return -1;
- }
-
- sdr = (sdr_full_t *) buf;
- snr_num = sdr->sensor_num;
- sinfo[snr_num].valid = true;
- memcpy(&sinfo[snr_num].sdr, sdr, sizeof(sdr_full_t));
-}
-
-return 0;
-}
-
-int
-yosemite_sensor_sdr_init(uint8_t fru, sensor_info_t *sinfo) {
- int fd;
- uint8_t buf[MAX_SDR_LEN] = {0};
- uint8_t bytes_rd = 0;
- uint8_t sn = 0;
- char path[64] = {0};
-
- switch(fru) {
- case FRU_SLOT1:
- case FRU_SLOT2:
- case FRU_SLOT3:
- case FRU_SLOT4:
- if (yosemite_sensor_sdr_path(fru, path) < 0) {
-#ifdef DEBUG
- syslog(LOG_WARNING, "yosemite_sensor_sdr_init: get_fru_sdr_path failed\n");
-#endif
- return ERR_NOT_READY;
- }
-
- if (sdr_init(path, sinfo) < 0) {
-#ifdef DEBUG
- syslog(LOG_ERR, "yosemite_sensor_sdr_init: sdr_init failed for FRU %d", fru);
-#endif
- }
- break;
-
- case FRU_SPB:
- case FRU_NIC:
- return -1;
- break;
- }
-
- return 0;
-}
-
-static int
-yosemite_sdr_init(uint8_t fru) {
-
- static bool init_done[MAX_NUM_FRUS] = {false};
-
- if (!init_done[fru - 1]) {
-
- sensor_info_t *sinfo = g_sinfo[fru-1];
-
- if (yosemite_sensor_sdr_init(fru, sinfo) < 0)
- return ERR_NOT_READY;
-
- init_done[fru - 1] = true;
- }
-
- return 0;
-}
-
-static bool
-is_server_prsnt(uint8_t fru) {
- uint8_t gpio;
- int val;
- char path[64] = {0};
-
- switch(fru) {
- case 1:
- gpio = 61;
- break;
- case 2:
- gpio = 60;
- break;
- case 3:
- gpio = 63;
- break;
- case 4:
- gpio = 62;
- break;
- default:
- return 0;
- }
-
- sprintf(path, GPIO_VAL, gpio);
-
- if (read_device(path, &val)) {
- return -1;
- }
-
- if (val == 0x0) {
- return 1;
- } else {
- return 0;
- }
-}
-
-/* Get the units for the sensor */
-int
-yosemite_sensor_units(uint8_t fru, uint8_t sensor_num, char *units) {
- uint8_t op, modifier;
- sensor_info_t *sinfo;
-
- if (is_server_prsnt(fru) && (yosemite_sdr_init(fru) != 0)) {
- return -1;
- }
-
- switch(fru) {
- case FRU_SLOT1:
- case FRU_SLOT2:
- case FRU_SLOT3:
- case FRU_SLOT4:
- sprintf(units, "");
- break;
-
- case FRU_SPB:
- switch(sensor_num) {
- case SP_SENSOR_INLET_TEMP:
- sprintf(units, "C");
- break;
- case SP_SENSOR_OUTLET_TEMP:
- sprintf(units, "C");
- break;
- case SP_SENSOR_MEZZ_TEMP:
- sprintf(units, "C");
- break;
- case SP_SENSOR_FAN0_TACH:
- sprintf(units, "RPM");
- break;
- case SP_SENSOR_FAN1_TACH:
- sprintf(units, "RPM");
- break;
- case SP_SENSOR_AIR_FLOW:
- sprintf(units, "");
- break;
- case SP_SENSOR_P5V:
- sprintf(units, "Volts");
- break;
- case SP_SENSOR_P12V:
- sprintf(units, "Volts");
- break;
- case SP_SENSOR_P3V3_STBY:
- sprintf(units, "Volts");
- break;
- case SP_SENSOR_P12V_SLOT1:
- case SP_SENSOR_P12V_SLOT2:
- case SP_SENSOR_P12V_SLOT3:
- case SP_SENSOR_P12V_SLOT4:
- sprintf(units, "Volts");
- break;
- case SP_SENSOR_P3V3:
- sprintf(units, "Volts");
- break;
- case SP_SENSOR_HSC_IN_VOLT:
- sprintf(units, "Volts");
- break;
- case SP_SENSOR_HSC_OUT_CURR:
- sprintf(units, "Amps");
- break;
- case SP_SENSOR_HSC_TEMP:
- sprintf(units, "C");
- break;
- case SP_SENSOR_HSC_IN_POWER:
- sprintf(units, "Watts");
- break;
- }
- break;
- case FRU_NIC:
- switch(sensor_num) {
- case MEZZ_SENSOR_TEMP:
- sprintf(units, "C");
- break;
- }
- break;
- }
- return 0;
-}
-
-int
-yosemite_sensor_threshold(uint8_t fru, uint8_t sensor_num, uint8_t thresh, float *value) {
-
- sensor_thresh_array_init();
-
- switch(fru) {
- case FRU_SLOT1:
- case FRU_SLOT2:
- case FRU_SLOT3:
- case FRU_SLOT4:
- break;
- case FRU_SPB:
- *value = spb_sensor_threshold[sensor_num][thresh];
- break;
- case FRU_NIC:
- *value = nic_sensor_threshold[sensor_num][thresh];
- break;
- }
- return 0;
-}
-
-/* Get the name for the sensor */
-int
-yosemite_sensor_name(uint8_t fru, uint8_t sensor_num, char *name) {
-
- switch(fru) {
- case FRU_SLOT1:
- case FRU_SLOT2:
- case FRU_SLOT3:
- case FRU_SLOT4:
- switch(sensor_num) {
- case BIC_SENSOR_SYSTEM_STATUS:
- sprintf(name, "SYSTEM_STATUS");
- break;
- case BIC_SENSOR_SYS_BOOT_STAT:
- sprintf(name, "SYS_BOOT_STAT");
- break;
- case BIC_SENSOR_CPU_DIMM_HOT:
- sprintf(name, "CPU_DIMM_HOT");
- break;
- case BIC_SENSOR_PROC_FAIL:
- sprintf(name, "PROC_FAIL");
- break;
- case BIC_SENSOR_VR_HOT:
- sprintf(name, "VR_HOT");
- break;
- default:
- sprintf(name, "");
- break;
- }
- break;
-
- case FRU_SPB:
- switch(sensor_num) {
- case SP_SENSOR_INLET_TEMP:
- sprintf(name, "SP_INLET_TEMP");
- break;
- case SP_SENSOR_OUTLET_TEMP:
- sprintf(name, "SP_OUTLET_TEMP");
- break;
- case SP_SENSOR_MEZZ_TEMP:
- sprintf(name, "SP_MEZZ_TEMP");
- break;
- case SP_SENSOR_FAN0_TACH:
- sprintf(name, "SP_FAN0_TACH");
- break;
- case SP_SENSOR_FAN1_TACH:
- sprintf(name, "SP_FAN1_TACH");
- break;
- case SP_SENSOR_AIR_FLOW:
- sprintf(name, "SP_AIR_FLOW");
- break;
- case SP_SENSOR_P5V:
- sprintf(name, "SP_P5V");
- break;
- case SP_SENSOR_P12V:
- sprintf(name, "SP_P12V");
- break;
- case SP_SENSOR_P3V3_STBY:
- sprintf(name, "SP_P3V3_STBY");
- break;
- case SP_SENSOR_P12V_SLOT1:
- sprintf(name, "SP_P12V_SLOT1");
- break;
- case SP_SENSOR_P12V_SLOT2:
- sprintf(name, "SP_P12V_SLOT2");
- break;
- case SP_SENSOR_P12V_SLOT3:
- sprintf(name, "SP_P12V_SLOT3");
- break;
- case SP_SENSOR_P12V_SLOT4:
- sprintf(name, "SP_P12V_SLOT4");
- break;
- case SP_SENSOR_P3V3:
- sprintf(name, "SP_P3V3");
- break;
- case SP_SENSOR_HSC_IN_VOLT:
- sprintf(name, "SP_HSC_IN_VOLT");
- break;
- case SP_SENSOR_HSC_OUT_CURR:
- sprintf(name, "SP_HSC_OUT_CURR");
- break;
- case SP_SENSOR_HSC_TEMP:
- sprintf(name, "SP_HSC_TEMP");
- break;
- case SP_SENSOR_HSC_IN_POWER:
- sprintf(name, "SP_HSC_IN_POWER");
- break;
- }
- break;
- case FRU_NIC:
- switch(sensor_num) {
- case MEZZ_SENSOR_TEMP:
- sprintf(name, "MEZZ_SENSOR_TEMP");
- break;
- }
- break;
- }
- return 0;
-}
-
-
-int
-yosemite_sensor_read(uint8_t fru, uint8_t sensor_num, void *value) {
-
- float volt;
- float curr;
- int ret;
- bool discrete;
- int i;
-
- switch (fru) {
- case FRU_SLOT1:
- case FRU_SLOT2:
- case FRU_SLOT3:
- case FRU_SLOT4:
-
- if (!(is_server_prsnt(fru))) {
- return -1;
- }
-
- ret = yosemite_sdr_init(fru);
- if (ret < 0) {
- return ret;
- }
-
- discrete = false;
-
- i = 0;
- while (i < bic_discrete_cnt) {
- if (sensor_num == bic_discrete_list[i++]) {
- discrete = true;
- break;
- }
- }
-
- return bic_read_sensor_wrapper(fru, sensor_num, discrete, value);
-
- case FRU_SPB:
- switch(sensor_num) {
-
- // Inlet, Outlet Temp
- case SP_SENSOR_INLET_TEMP:
- return read_temp(SP_INLET_TEMP_DEVICE, (float*) value);
- case SP_SENSOR_OUTLET_TEMP:
- return read_temp(SP_OUTLET_TEMP_DEVICE, (float*) value);
-
- // Fan Tach Values
- case SP_SENSOR_FAN0_TACH:
- return read_fan_value(FAN0, FAN_TACH_RPM, (float*) value);
- case SP_SENSOR_FAN1_TACH:
- return read_fan_value(FAN1, FAN_TACH_RPM, (float*) value);
-
- // Various Voltages
- case SP_SENSOR_P5V:
- return read_adc_value(ADC_PIN0, ADC_VALUE, (float*) value);
- case SP_SENSOR_P12V:
- return read_adc_value(ADC_PIN1, ADC_VALUE, (float*) value);
- case SP_SENSOR_P3V3_STBY:
- return read_adc_value(ADC_PIN2, ADC_VALUE, (float*) value);
- case SP_SENSOR_P12V_SLOT1:
- return read_adc_value(ADC_PIN4, ADC_VALUE, (float*) value);
- case SP_SENSOR_P12V_SLOT2:
- return read_adc_value(ADC_PIN3, ADC_VALUE, (float*) value);
- case SP_SENSOR_P12V_SLOT3:
- return read_adc_value(ADC_PIN6, ADC_VALUE, (float*) value);
- case SP_SENSOR_P12V_SLOT4:
- return read_adc_value(ADC_PIN5, ADC_VALUE, (float*) value);
- case SP_SENSOR_P3V3:
- return read_adc_value(ADC_PIN7, ADC_VALUE, (float*) value);
-
- // Hot Swap Controller
- case SP_SENSOR_HSC_IN_VOLT:
- return read_hsc_value(HSC_IN_VOLT, (float*) value);
- case SP_SENSOR_HSC_OUT_CURR:
- return read_hsc_value(HSC_OUT_CURR, (float*) value);
- case SP_SENSOR_HSC_TEMP:
- return read_hsc_value(HSC_TEMP, (float*) value);
- case SP_SENSOR_HSC_IN_POWER:
- if (read_hsc_value(HSC_IN_VOLT, &volt)) {
- return -1;
- }
- if (read_hsc_value(HSC_OUT_CURR, &curr)) {
- return -1;
- }
- * (float*) value = volt * curr;
- return 0;
- }
- break;
-
- case FRU_NIC:
- switch(sensor_num) {
- // Mezz Temp
- case MEZZ_SENSOR_TEMP:
- return read_nic_temp(MEZZ_SENSOR_TEMP, (float*) value);
- }
- break;
- }
-}
-
diff --git a/meta-facebook/meta-yosemite/recipes-yosemite/fblibs/files/yosemite_sensor/yosemite_sensor.h b/meta-facebook/meta-yosemite/recipes-yosemite/fblibs/files/yosemite_sensor/yosemite_sensor.h
deleted file mode 100644
index 8775f15..0000000
--- a/meta-facebook/meta-yosemite/recipes-yosemite/fblibs/files/yosemite_sensor/yosemite_sensor.h
+++ /dev/null
@@ -1,175 +0,0 @@
-/*
- *
- * Copyright 2015-present Facebook. All Rights Reserved.
- *
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-
-#ifndef __YOSEMITE_SENSOR_H__
-#define __YOSEMITE_SENSOR_H__
-
-#include <stdbool.h>
-#include <openbmc/ipmi.h>
-#include <openbmc/ipmb.h>
-#include <facebook/bic.h>
-#include <facebook/yosemite_common.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define MAX_SDR_LEN 64
-#define MAX_SENSOR_NUM 0xFF
-#define MAX_SENSOR_THRESHOLD 8
-#define MAX_RETRIES_SDR_INIT 30
-#define THERMAL_CONSTANT 255
-#define ERR_NOT_READY -2
-
-typedef struct _sensor_info_t {
- bool valid;
- sdr_full_t sdr;
-} sensor_info_t;
-
-/* Enum for type of Upper and Lower threshold values */
-enum {
- UCR_THRESH = 0x01,
- UNC_THRESH,
- UNR_THRESH,
- LCR_THRESH,
- LNC_THRESH,
- LNR_THRESH,
- POS_HYST,
- NEG_HYST,
-};
-
-// Sensors under Bridge IC
-enum {
- BIC_SENSOR_MB_OUTLET_TEMP = 0x01,
- BIC_SENSOR_VCCIN_VR_TEMP = 0x02,
- BIC_SENSOR_VCC_GBE_VR_TEMP = 0x03,
- BIC_SENSOR_1V05PCH_VR_TEMP = 0x04,
- BIC_SENSOR_SOC_TEMP = 0x05,
- BIC_SENSOR_MB_INLET_TEMP = 0x07,
- BIC_SENSOR_PCH_TEMP = 0x08,
- BIC_SENSOR_SOC_THERM_MARGIN = 0x09,
- BIC_SENSOR_VDDR_VR_TEMP = 0x0B,
- BIC_SENSOR_SYSTEM_STATUS = 0x10, //Discrete
- BIC_SENSOR_SPS_FW_HLTH = 0x17, //Event-only
- BIC_SENSOR_VCC_GBE_VR_CURR = 0x20,
- BIC_SENSOR_1V05_PCH_VR_CURR = 0x21,
- BIC_SENSOR_VCCIN_VR_POUT = 0x22,
- BIC_SENSOR_VCCIN_VR_CURR = 0x23,
- BIC_SENSOR_VCCIN_VR_VOL = 0x24,
- BIC_SENSOR_INA230_POWER = 0x29,
- BIC_SENSOR_INA230_VOL = 0x2A,
- BIC_SENSOR_POST_ERR = 0x2B, //Event-only
- BIC_SENSOR_SOC_PACKAGE_PWR = 0x2C,
- BIC_SENSOR_SOC_TJMAX = 0x30,
- BIC_SENSOR_VDDR_VR_POUT = 0x32,
- BIC_SENSOR_VDDR_VR_CURR = 0x33,
- BIC_SENSOR_VDDR_VR_VOL = 0x34,
- BIC_SENSOR_VCC_SCSUS_VR_CURR = 0x35,
- BIC_SENSOR_VCC_SCSUS_VR_VOL = 0x36,
- BIC_SENSOR_VCC_SCSUS_VR_TEMP = 0x37,
- BIC_SENSOR_VCC_SCSUS_VR_POUT = 0x38,
- BIC_SENSOR_VCC_GBE_VR_POUT = 0x39,
- BIC_SENSOR_POWER_THRESH_EVENT = 0x3B, //Event-only
- BIC_SENSOR_MACHINE_CHK_ERR = 0x40, //Event-only
- BIC_SENSOR_PCIE_ERR = 0x41, //Event-only
- BIC_SENSOR_1V05_PCH_VR_POUT = 0x42,
- BIC_SENSOR_OTHER_IIO_ERR = 0x43, //Event-only
- BIC_SENSOR_PROC_HOT_EXT = 0x51, //Event-only
- BIC_SENSOR_VCC_GBE_VR_VOL = 0x54,
- BIC_SENSOR_1V05_PCH_VR_VOL = 0x55,
- BIC_SENSOR_POWER_ERR = 0x56, //Event-only
- BIC_SENSOR_MEM_ECC_ERR = 0x63, //Event-only
- BIC_SENSOR_PROC_FAIL = 0x65, //Discrete
- BIC_SENSOR_SYS_BOOT_STAT = 0x7E, //Discrete
- BIC_SENSOR_VR_HOT = 0xB2, //Discrete
- BIC_SENSOR_CPU_DIMM_HOT = 0xB3, //Discrete
- BIC_SENSOR_SOC_DIMMA0_TEMP = 0xB4,
- BIC_SENSOR_SOC_DIMMA1_TEMP = 0xB5,
- BIC_SENSOR_SOC_DIMMB0_TEMP = 0xB6,
- BIC_SENSOR_SOC_DIMMB1_TEMP = 0xB7,
- BIC_SENSOR_P3V3_MB = 0xD0,
- BIC_SENSOR_P12V_MB = 0xD2,
- BIC_SENSOR_P1V05_PCH = 0xD3,
- BIC_SENSOR_P3V3_STBY_MB = 0xD5,
- BIC_SENSOR_P5V_STBY_MB = 0xD6,
- BIC_SENSOR_PV_BAT = 0xD7,
- BIC_SENSOR_PVDDR = 0xD8,
- BIC_SENSOR_PVCC_GBE = 0xD9,
- BIC_SENSOR_CAT_ERR = 0xEB, //Event-only
-};
-
-// Sensors Under Side Plane
-enum {
- SP_SENSOR_INLET_TEMP = 0x81,
- SP_SENSOR_OUTLET_TEMP = 0x80,
- SP_SENSOR_MEZZ_TEMP = 0x82,
- SP_SENSOR_FAN0_TACH = 0x46,
- SP_SENSOR_FAN1_TACH = 0x47,
- SP_SENSOR_AIR_FLOW = 0x4A,
- SP_SENSOR_P5V = 0xE0,
- SP_SENSOR_P12V = 0xE1,
- SP_SENSOR_P3V3_STBY = 0xE2,
- SP_SENSOR_P12V_SLOT1 = 0xE3,
- SP_SENSOR_P12V_SLOT2 = 0xE4,
- SP_SENSOR_P12V_SLOT3 = 0xE5,
- SP_SENSOR_P12V_SLOT4 = 0xE6,
- SP_SENSOR_P3V3 = 0xE7,
- SP_SENSOR_HSC_IN_VOLT = 0xC0,
- SP_SENSOR_HSC_OUT_CURR = 0xC1,
- SP_SENSOR_HSC_TEMP = 0xC2,
- SP_SENSOR_HSC_IN_POWER = 0xC3,
-};
-
-enum{
- MEZZ_SENSOR_TEMP = 0x01,
-};
-extern const uint8_t bic_sensor_list[];
-
-extern const uint8_t bic_discrete_list[];
-
-extern const uint8_t spb_sensor_list[];
-
-extern const uint8_t nic_sensor_list[];
-
-//extern float spb_sensor_threshold[MAX_SENSOR_NUM][MAX_SENSOR_THRESHOLD + 1];
-
-//extern float nic_sensor_threshold[MAX_SENSOR_NUM][MAX_SENSOR_THRESHOLD + 1];
-
-extern size_t bic_sensor_cnt;
-
-extern size_t bic_discrete_cnt;
-
-extern size_t spb_sensor_cnt;
-
-extern size_t nic_sensor_cnt;
-
-int yosemite_sensor_read(uint8_t fru, uint8_t sensor_num, void *value);
-int yosemite_sensor_name(uint8_t fru, uint8_t sensor_num, char *name);
-int yosemite_sensor_units(uint8_t fru, uint8_t sensor_num, char *units);
-int yosemite_sensor_sdr_path(uint8_t fru, char *path);
-int yosemite_sensor_threshold(uint8_t fru, uint8_t sensor_num, uint8_t thresh, float *value);
-int yosemite_sensor_sdr_init(uint8_t fru, sensor_info_t *sinfo);
-
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
-
-#endif /* __YOSEMITE_SENSOR_H__ */
diff --git a/meta-facebook/meta-yosemite/recipes-yosemite/fblibs/libbic_0.1.bb b/meta-facebook/meta-yosemite/recipes-yosemite/fblibs/libbic_0.1.bb
deleted file mode 100644
index 6b22366..0000000
--- a/meta-facebook/meta-yosemite/recipes-yosemite/fblibs/libbic_0.1.bb
+++ /dev/null
@@ -1,25 +0,0 @@
-# Copyright 2015-present Facebook. All Rights Reserved.
-SUMMARY = "Bridge IC Library"
-DESCRIPTION = "library for communicating with Bridge IC"
-SECTION = "base"
-PR = "r1"
-LICENSE = "GPLv2"
-LIC_FILES_CHKSUM = "file://bic.c;beginline=8;endline=20;md5=da35978751a9d71b73679307c4d296ec"
-
-
-SRC_URI = "file://bic \
- "
-DEPENDS += "libipmi libipmb"
-
-S = "${WORKDIR}/bic"
-
-do_install() {
- install -d ${D}${libdir}
- install -m 0644 libbic.so ${D}${libdir}/libbic.so
-
- install -d ${D}${includedir}/facebook
- install -m 0644 bic.h ${D}${includedir}/facebook/bic.h
-}
-
-FILES_${PN} = "${libdir}/libbic.so"
-FILES_${PN}-dev = "${includedir}/facebook/bic.h"
diff --git a/meta-facebook/meta-yosemite/recipes-yosemite/fblibs/libpal_0.1.bb b/meta-facebook/meta-yosemite/recipes-yosemite/fblibs/libpal_0.1.bb
deleted file mode 100644
index bcdd420..0000000
--- a/meta-facebook/meta-yosemite/recipes-yosemite/fblibs/libpal_0.1.bb
+++ /dev/null
@@ -1,28 +0,0 @@
-# Copyright 2015-present Facebook. All Rights Reserved.
-SUMMARY = "Platform Abstraction Library"
-DESCRIPTION = "library for communicating with Platform"
-SECTION = "base"
-PR = "r1"
-LICENSE = "GPLv2"
-LIC_FILES_CHKSUM = "file://pal.c;beginline=8;endline=20;md5=da35978751a9d71b73679307c4d296ec"
-
-
-SRC_URI = "file://pal \
- "
-
-DEPENDS += "libbic libyosemite-common libyosemite-fruid libyosemite-sensor "
-
-S = "${WORKDIR}/pal"
-
-do_install() {
- install -d ${D}${libdir}
- install -m 0644 libpal.so ${D}${libdir}/libpal.so
-
- install -d ${D}${includedir}/openbmc
- install -m 0644 pal.h ${D}${includedir}/openbmc/pal.h
-}
-
-FILES_${PN} = "${libdir}/libpal.so"
-FILES_${PN}-dev = "${includedir}/openbmc/pal.h"
-
-RDEPENDS_${PN} += " libyosemite-common"
diff --git a/meta-facebook/meta-yosemite/recipes-yosemite/fblibs/libyosemite-common_0.1.bb b/meta-facebook/meta-yosemite/recipes-yosemite/fblibs/libyosemite-common_0.1.bb
deleted file mode 100644
index bdf8192..0000000
--- a/meta-facebook/meta-yosemite/recipes-yosemite/fblibs/libyosemite-common_0.1.bb
+++ /dev/null
@@ -1,25 +0,0 @@
-# Copyright 2015-present Facebook. All Rights Reserved.
-SUMMARY = "Yosemite Common Library"
-DESCRIPTION = "library for common Yosemite information"
-SECTION = "base"
-PR = "r1"
-LICENSE = "GPLv2"
-LIC_FILES_CHKSUM = "file://yosemite_common.c;beginline=8;endline=20;md5=da35978751a9d71b73679307c4d296ec"
-
-
-SRC_URI = "file://yosemite_common \
- "
-
-S = "${WORKDIR}/yosemite_common"
-
-do_install() {
- install -d ${D}${libdir}
- install -m 0644 libyosemite_common.so ${D}${libdir}/libyosemite_common.so
-
- install -d ${D}${includedir}
- install -d ${D}${includedir}/facebook
- install -m 0644 yosemite_common.h ${D}${includedir}/facebook/yosemite_common.h
-}
-
-FILES_${PN} = "${libdir}/libyosemite_common.so"
-FILES_${PN}-dev = "${includedir}/facebook/yosemite_common.h"
diff --git a/meta-facebook/meta-yosemite/recipes-yosemite/fblibs/libyosemite-fruid_0.1.bb b/meta-facebook/meta-yosemite/recipes-yosemite/fblibs/libyosemite-fruid_0.1.bb
deleted file mode 100644
index ce9fe7f..0000000
--- a/meta-facebook/meta-yosemite/recipes-yosemite/fblibs/libyosemite-fruid_0.1.bb
+++ /dev/null
@@ -1,43 +0,0 @@
-# Copyright 2015-present Facebook. All Rights Reserved.
-#
-# This program file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program in a file named COPYING; if not, write to the
-# Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor,
-# Boston, MA 02110-1301 USA
-
-SUMMARY = "Yosemite Fruid Library"
-DESCRIPTION = "library for reading all yosemite fruids"
-SECTION = "base"
-PR = "r1"
-LICENSE = "GPLv2"
-LIC_FILES_CHKSUM = "file://yosemite_fruid.c;beginline=6;endline=18;md5=da35978751a9d71b73679307c4d296ec"
-
-
-SRC_URI = "file://yosemite_fruid \
- "
-
-DEPENDS += " libyosemite-common "
-
-S = "${WORKDIR}/yosemite_fruid"
-
-do_install() {
- install -d ${D}${libdir}
- install -m 0644 libyosemite_fruid.so ${D}${libdir}/libyosemite_fruid.so
-
- install -d ${D}${includedir}
- install -d ${D}${includedir}/facebook
- install -m 0644 yosemite_fruid.h ${D}${includedir}/facebook/yosemite_fruid.h
-}
-
-FILES_${PN} = "${libdir}/libyosemite_fruid.so"
-FILES_${PN}-dev = "${includedir}/facebook/yosemite_fruid.h"
diff --git a/meta-facebook/meta-yosemite/recipes-yosemite/fblibs/libyosemite-gpio_0.1.bb b/meta-facebook/meta-yosemite/recipes-yosemite/fblibs/libyosemite-gpio_0.1.bb
deleted file mode 100644
index 39993d0..0000000
--- a/meta-facebook/meta-yosemite/recipes-yosemite/fblibs/libyosemite-gpio_0.1.bb
+++ /dev/null
@@ -1,43 +0,0 @@
-# Copyright 2015-present Facebook. All Rights Reserved.
-#
-# This program file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program in a file named COPYING; if not, write to the
-# Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor,
-# Boston, MA 02110-1301 USA
-
-SUMMARY = "Yosemite GPIO Pin Library"
-DESCRIPTION = "library for all gpio pins in yosemite"
-SECTION = "base"
-PR = "r1"
-LICENSE = "GPLv2"
-LIC_FILES_CHKSUM = "file://yosemite_gpio.c;beginline=6;endline=18;md5=da35978751a9d71b73679307c4d296ec"
-
-
-SRC_URI = "file://yosemite_gpio \
- "
-
-DEPENDS += "libbic "
-
-S = "${WORKDIR}/yosemite_gpio"
-
-do_install() {
- install -d ${D}${libdir}
- install -m 0644 libyosemite_gpio.so ${D}${libdir}/libyosemite_gpio.so
-
- install -d ${D}${includedir}
- install -d ${D}${includedir}/facebook
- install -m 0644 yosemite_gpio.h ${D}${includedir}/facebook/yosemite_gpio.h
-}
-
-FILES_${PN} = "${libdir}/libyosemite_gpio.so"
-FILES_${PN}-dev = "${includedir}/facebook/yosemite_gpio.h"
diff --git a/meta-facebook/meta-yosemite/recipes-yosemite/fblibs/libyosemite-sensor_0.1.bb b/meta-facebook/meta-yosemite/recipes-yosemite/fblibs/libyosemite-sensor_0.1.bb
deleted file mode 100644
index 4bbeef1..0000000
--- a/meta-facebook/meta-yosemite/recipes-yosemite/fblibs/libyosemite-sensor_0.1.bb
+++ /dev/null
@@ -1,25 +0,0 @@
-# Copyright 2015-present Facebook. All Rights Reserved.
-SUMMARY = "Yosemite Sensor Library"
-DESCRIPTION = "library for reading various sensors"
-SECTION = "base"
-PR = "r1"
-LICENSE = "GPLv2"
-LIC_FILES_CHKSUM = "file://yosemite_sensor.c;beginline=8;endline=20;md5=da35978751a9d71b73679307c4d296ec"
-
-
-SRC_URI = "file://yosemite_sensor \
- "
-DEPENDS =+ " libipmi libipmb libbic libyosemite-common "
-
-S = "${WORKDIR}/yosemite_sensor"
-
-do_install() {
- install -d ${D}${libdir}
- install -m 0644 libyosemite_sensor.so ${D}${libdir}/libyosemite_sensor.so
-
- install -d ${D}${includedir}/facebook
- install -m 0644 yosemite_sensor.h ${D}${includedir}/facebook/yosemite_sensor.h
-}
-
-FILES_${PN} = "${libdir}/libyosemite_sensor.so"
-FILES_${PN}-dev = "${includedir}/facebook/yosemite_sensor.h"
diff --git a/meta-facebook/meta-yosemite/recipes-yosemite/fbutils/bic-util_0.1.bb b/meta-facebook/meta-yosemite/recipes-yosemite/fbutils/bic-util_0.1.bb
deleted file mode 100644
index 86679d6..0000000
--- a/meta-facebook/meta-yosemite/recipes-yosemite/fbutils/bic-util_0.1.bb
+++ /dev/null
@@ -1,21 +0,0 @@
-# Copyright 2015-present Facebook. All Rights Reserved.
-SUMMARY = "Bridge IC Utility"
-DESCRIPTION = "Util for checking with Bridge IC on Yosemite"
-SECTION = "base"
-PR = "r1"
-LICENSE = "GPLv2"
-LIC_FILES_CHKSUM = "file://bic-util.c;beginline=4;endline=16;md5=b395943ba8a0717a83e62ca123a8d238"
-
-SRC_URI = "file://bic-util \
- "
-
-S = "${WORKDIR}/bic-util"
-
-do_install() {
- install -d ${D}${bindir}
- install -m 0755 bic-util ${D}${bindir}/bic-util
-}
-
-DEPENDS += "libbic"
-
-FILES_${PN} = "${bindir}"
diff --git a/meta-facebook/meta-yosemite/recipes-yosemite/fbutils/fbutils_0.1.bb b/meta-facebook/meta-yosemite/recipes-yosemite/fbutils/fbutils_0.1.bb
deleted file mode 100644
index e00f558..0000000
--- a/meta-facebook/meta-yosemite/recipes-yosemite/fbutils/fbutils_0.1.bb
+++ /dev/null
@@ -1,102 +0,0 @@
-# Copyright 2014-present Facebook. All Rights Reserved.
-#
-# This program file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program in a file named COPYING; if not, write to the
-# Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor,
-# Boston, MA 02110-1301 USA
-SUMMARY = "Utilities"
-DESCRIPTION = "Various utilities"
-SECTION = "base"
-PR = "r1"
-LICENSE = "GPLv2"
-LIC_FILES_CHKSUM = "file://COPYING;md5=eb723b61539feef013de476e68b5c50a"
-
-SRC_URI = "file://ast-functions \
- file://us_console.sh \
- file://sol-util \
- file://power_led.sh \
- file://power_util.py \
- file://post_led.sh \
- file://reset_usb.sh \
- file://setup-gpio.sh \
- file://setup_rov.sh \
- file://mdio.py \
- file://bcm5396.py \
- file://bcm5396_util.py \
- file://mount_data0.sh \
- file://eth0_mac_fixup.sh \
- file://yosemite_power.sh \
- file://power-on.sh \
- file://wedge_us_mac.sh \
- file://setup_switch.py \
- file://create_vlan_intf \
- file://watch-fc.sh \
- file://fcswitcher.sh \
- file://rc.early \
- file://rc.local \
- file://src \
- file://COPYING \
- "
-
-pkgdir = "utils"
-
-S = "${WORKDIR}"
-
-binfiles = "us_console.sh sol-util power_led.sh post_led.sh \
- reset_usb.sh mdio.py setup_rov.sh yosemite_power.sh wedge_us_mac.sh \
- bcm5396.py bcm5396_util.py setup_switch.py watch-fc.sh power_util.py"
-
-DEPENDS_append = "update-rc.d-native"
-
-do_install() {
- dst="${D}/usr/local/fbpackages/${pkgdir}"
- install -d $dst
- install -m 644 ast-functions ${dst}/ast-functions
- localbindir="${D}/usr/local/bin"
- install -d ${localbindir}
- for f in ${binfiles}; do
- install -m 755 $f ${dst}/${f}
- ln -s ../fbpackages/${pkgdir}/${f} ${localbindir}/${f}
- done
-
- # common lib and include files
- install -d ${D}${includedir}/facebook
- install -m 0644 src/include/log.h ${D}${includedir}/facebook/log.h
- install -m 0644 src/include/i2c-dev.h ${D}${includedir}/facebook/i2c-dev.h
-
- # init
- install -d ${D}${sysconfdir}/init.d
- install -d ${D}${sysconfdir}/rcS.d
- # the script to mount /mnt/data
- install -m 0755 ${WORKDIR}/mount_data0.sh ${D}${sysconfdir}/init.d/mount_data0.sh
- update-rc.d -r ${D} mount_data0.sh start 03 S .
- install -m 0755 ${WORKDIR}/rc.early ${D}${sysconfdir}/init.d/rc.early
- update-rc.d -r ${D} rc.early start 04 S .
- install -m 755 setup-gpio.sh ${D}${sysconfdir}/init.d/setup-gpio.sh
- update-rc.d -r ${D} setup-gpio.sh start 59 5 .
- # create VLAN intf automatically
- #install -d ${D}/${sysconfdir}/network/if-up.d
- #install -m 755 create_vlan_intf ${D}${sysconfdir}/network/if-up.d/create_vlan_intf
- # networking is done after rcS, any start level within rcS
- # for mac fixup should work
- #install -m 755 eth0_mac_fixup.sh ${D}${sysconfdir}/init.d/eth0_mac_fixup.sh
- #update-rc.d -r ${D} eth0_mac_fixup.sh start 70 S .
- install -m 755 power-on.sh ${D}${sysconfdir}/init.d/power-on.sh
- update-rc.d -r ${D} power-on.sh start 85 5 .
- #install -m 755 fcswitcher.sh ${D}${sysconfdir}/init.d/fcswitcher.sh
- #update-rc.d -r ${D} fcswitcher.sh start 90 S .
- install -m 0755 ${WORKDIR}/rc.local ${D}${sysconfdir}/init.d/rc.local
- update-rc.d -r ${D} rc.local start 99 2 3 4 5 .
-}
-
-FILES_${PN} += "/usr/local ${sysconfdir}"
diff --git a/meta-facebook/meta-yosemite/recipes-yosemite/fbutils/files/COPYING b/meta-facebook/meta-yosemite/recipes-yosemite/fbutils/files/COPYING
deleted file mode 100644
index 3912109..0000000
--- a/meta-facebook/meta-yosemite/recipes-yosemite/fbutils/files/COPYING
+++ /dev/null
@@ -1,340 +0,0 @@
- GNU GENERAL PUBLIC LICENSE
- Version 2, June 1991
-
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.
- 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
- Preamble
-
- The licenses for most software are designed to take away your
-freedom to share and change it. By contrast, the GNU General Public
-License is intended to guarantee your freedom to share and change free
-software--to make sure the software is free for all its users. This
-General Public License applies to most of the Free Software
-Foundation's software and to any other program whose authors commit to
-using it. (Some other Free Software Foundation software is covered by
-the GNU Library General Public License instead.) You can apply it to
-your programs, too.
-
- When we speak of free software, we are referring to freedom, not
-price. Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-this service if you wish), that you receive source code or can get it
-if you want it, that you can change the software or use pieces of it
-in new free programs; and that you know you can do these things.
-
- To protect your rights, we need to make restrictions that forbid
-anyone to deny you these rights or to ask you to surrender the rights.
-These restrictions translate to certain responsibilities for you if you
-distribute copies of the software, or if you modify it.
-
- For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must give the recipients all the rights that
-you have. You must make sure that they, too, receive or can get the
-source code. And you must show them these terms so they know their
-rights.
-
- We protect your rights with two steps: (1) copyright the software, and
-(2) offer you this license which gives you legal permission to copy,
-distribute and/or modify the software.
-
- Also, for each author's protection and ours, we want to make certain
-that everyone understands that there is no warranty for this free
-software. If the software is modified by someone else and passed on, we
-want its recipients to know that what they have is not the original, so
-that any problems introduced by others will not reflect on the original
-authors' reputations.
-
- Finally, any free program is threatened constantly by software
-patents. We wish to avoid the danger that redistributors of a free
-program will individually obtain patent licenses, in effect making the
-program proprietary. To prevent this, we have made it clear that any
-patent must be licensed for everyone's free use or not licensed at all.
-
- The precise terms and conditions for copying, distribution and
-modification follow.
-
- GNU GENERAL PUBLIC LICENSE
- TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
- 0. This License applies to any program or other work which contains
-a notice placed by the copyright holder saying it may be distributed
-under the terms of this General Public License. The "Program", below,
-refers to any such program or work, and a "work based on the Program"
-means either the Program or any derivative work under copyright law:
-that is to say, a work containing the Program or a portion of it,
-either verbatim or with modifications and/or translated into another
-language. (Hereinafter, translation is included without limitation in
-the term "modification".) Each licensee is addressed as "you".
-
-Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope. The act of
-running the Program is not restricted, and the output from the Program
-is covered only if its contents constitute a work based on the
-Program (independent of having been made by running the Program).
-Whether that is true depends on what the Program does.
-
- 1. You may copy and distribute verbatim copies of the Program's
-source code as you receive it, in any medium, provided that you
-conspicuously and appropriately publish on each copy an appropriate
-copyright notice and disclaimer of warranty; keep intact all the
-notices that refer to this License and to the absence of any warranty;
-and give any other recipients of the Program a copy of this License
-along with the Program.
-
-You may charge a fee for the physical act of transferring a copy, and
-you may at your option offer warranty protection in exchange for a fee.
-
- 2. You may modify your copy or copies of the Program or any portion
-of it, thus forming a work based on the Program, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
- a) You must cause the modified files to carry prominent notices
- stating that you changed the files and the date of any change.
-
- b) You must cause any work that you distribute or publish, that in
- whole or in part contains or is derived from the Program or any
- part thereof, to be licensed as a whole at no charge to all third
- parties under the terms of this License.
-
- c) If the modified program normally reads commands interactively
- when run, you must cause it, when started running for such
- interactive use in the most ordinary way, to print or display an
- announcement including an appropriate copyright notice and a
- notice that there is no warranty (or else, saying that you provide
- a warranty) and that users may redistribute the program under
- these conditions, and telling the user how to view a copy of this
- License. (Exception: if the Program itself is interactive but
- does not normally print such an announcement, your work based on
- the Program is not required to print an announcement.)
-
-These requirements apply to the modified work as a whole. If
-identifiable sections of that work are not derived from the Program,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works. But when you
-distribute the same sections as part of a whole which is a work based
-on the Program, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Program.
-
-In addition, mere aggregation of another work not based on the Program
-with the Program (or with a work based on the Program) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
- 3. You may copy and distribute the Program (or a work based on it,
-under Section 2) in object code or executable form under the terms of
-Sections 1 and 2 above provided that you also do one of the following:
-
- a) Accompany it with the complete corresponding machine-readable
- source code, which must be distributed under the terms of Sections
- 1 and 2 above on a medium customarily used for software interchange; or,
-
- b) Accompany it with a written offer, valid for at least three
- years, to give any third party, for a charge no more than your
- cost of physically performing source distribution, a complete
- machine-readable copy of the corresponding source code, to be
- distributed under the terms of Sections 1 and 2 above on a medium
- customarily used for software interchange; or,
-
- c) Accompany it with the information you received as to the offer
- to distribute corresponding source code. (This alternative is
- allowed only for noncommercial distribution and only if you
- received the program in object code or executable form with such
- an offer, in accord with Subsection b above.)
-
-The source code for a work means the preferred form of the work for
-making modifications to it. For an executable work, complete source
-code means all the source code for all modules it contains, plus any
-associated interface definition files, plus the scripts used to
-control compilation and installation of the executable. However, as a
-special exception, the source code distributed need not include
-anything that is normally distributed (in either source or binary
-form) with the major components (compiler, kernel, and so on) of the
-operating system on which the executable runs, unless that component
-itself accompanies the executable.
-
-If distribution of executable or object code is made by offering
-access to copy from a designated place, then offering equivalent
-access to copy the source code from the same place counts as
-distribution of the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
- 4. You may not copy, modify, sublicense, or distribute the Program
-except as expressly provided under this License. Any attempt
-otherwise to copy, modify, sublicense or distribute the Program is
-void, and will automatically terminate your rights under this License.
-However, parties who have received copies, or rights, from you under
-this License will not have their licenses terminated so long as such
-parties remain in full compliance.
-
- 5. You are not required to accept this License, since you have not
-signed it. However, nothing else grants you permission to modify or
-distribute the Program or its derivative works. These actions are
-prohibited by law if you do not accept this License. Therefore, by
-modifying or distributing the Program (or any work based on the
-Program), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Program or works based on it.
-
- 6. Each time you redistribute the Program (or any work based on the
-Program), the recipient automatically receives a license from the
-original licensor to copy, distribute or modify the Program subject to
-these terms and conditions. You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties to
-this License.
-
- 7. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License. If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Program at all. For example, if a patent
-license would not permit royalty-free redistribution of the Program by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Program.
-
-If any portion of this section is held invalid or unenforceable under
-any particular circumstance, the balance of the section is intended to
-apply and the section as a whole is intended to apply in other
-circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system, which is
-implemented by public license practices. Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
- 8. If the distribution and/or use of the Program is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Program under this License
-may add an explicit geographical distribution limitation excluding
-those countries, so that distribution is permitted only in or among
-countries not thus excluded. In such case, this License incorporates
-the limitation as if written in the body of this License.
-
- 9. The Free Software Foundation may publish revised and/or new versions
-of the General Public License from time to time. Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
-Each version is given a distinguishing version number. If the Program
-specifies a version number of this License which applies to it and "any
-later version", you have the option of following the terms and conditions
-either of that version or of any later version published by the Free
-Software Foundation. If the Program does not specify a version number of
-this License, you may choose any version ever published by the Free Software
-Foundation.
-
- 10. If you wish to incorporate parts of the Program into other free
-programs whose distribution conditions are different, write to the author
-to ask for permission. For software which is copyrighted by the Free
-Software Foundation, write to the Free Software Foundation; we sometimes
-make exceptions for this. Our decision will be guided by the two goals
-of preserving the free status of all derivatives of our free software and
-of promoting the sharing and reuse of software generally.
-
- NO WARRANTY
-
- 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
-FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
-OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
-PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
-OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
-TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
-PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
-REPAIR OR CORRECTION.
-
- 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
-REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
-INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
-OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
-TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
-YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
-PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGES.
-
- END OF TERMS AND CONDITIONS
-
- How to Apply These Terms to Your New Programs
-
- If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
- To do so, attach the following notices to the program. It is safest
-to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least
-the "copyright" line and a pointer to where the full notice is found.
-
- <one line to give the program's name and a brief idea of what it does.>
- Copyright (C) <year> <name of author>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
-
-Also add information on how to contact you by electronic and paper mail.
-
-If the program is interactive, make it output a short notice like this
-when it starts in an interactive mode:
-
- Gnomovision version 69, Copyright (C) year name of author
- Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
- This is free software, and you are welcome to redistribute it
- under certain conditions; type `show c' for details.
-
-The hypothetical commands `show w' and `show c' should show the appropriate
-parts of the General Public License. Of course, the commands you use may
-be called something other than `show w' and `show c'; they could even be
-mouse-clicks or menu items--whatever suits your program.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the program, if
-necessary. Here is a sample; alter the names:
-
- Yoyodyne, Inc., hereby disclaims all copyright interest in the program
- `Gnomovision' (which makes passes at compilers) written by James Hacker.
-
- <signature of Ty Coon>, 1 April 1989
- Ty Coon, President of Vice
-
-This General Public License does not permit incorporating your program into
-proprietary programs. If your program is a subroutine library, you may
-consider it more useful to permit linking proprietary applications with the
-library. If this is what you want to do, use the GNU Library General
-Public License instead of this License.
diff --git a/meta-facebook/meta-yosemite/recipes-yosemite/fbutils/files/ast-functions b/meta-facebook/meta-yosemite/recipes-yosemite/fbutils/files/ast-functions
deleted file mode 100644
index f29514f..0000000
--- a/meta-facebook/meta-yosemite/recipes-yosemite/fbutils/files/ast-functions
+++ /dev/null
@@ -1,147 +0,0 @@
-# Copyright 2014-present Facebook. All Rights Reserved.
-DEVMEM=/sbin/devmem
-
-devmem_set_bit() {
- local addr
- local val
- addr=$1
- val=$($DEVMEM $addr)
- val=$((val | (0x1 << $2)))
- $DEVMEM $addr 32 $val
-}
-
-devmem_clear_bit() {
- local addr
- local val
- addr=$1
- val=$($DEVMEM $addr)
- val=$((val & ~(0x1 << $2)))
- $DEVMEM $addr 32 $val
-}
-
-scu_addr() {
- echo $((0x1E6E2000 + 0x$1))
-}
-
-GPIODIR="/sys/class/gpio"
-GPIOEXPORT="$GPIODIR/export"
-
-gpio_dir() {
- echo "$GPIODIR/gpio$1"
-}
-
-gpio_name2value() {
- local first remaining base val
- remaining=$1
- val=0
- while [ -n "$remaining" ]; do
- first=${remaining:0:1}
- case "$first" in
- [[:lower:]])
- base=$(printf "%d" "'$first'")
- base=$((base - 96))
- val=$((val * 26 + base))
- ;;
- [[:upper:]])
- base=$(printf "%d" "'$first'")
- base=$((base - 64))
- val=$((val * 26 + base))
- ;;
- *)
- if [ $val -gt 0 ]; then
- val=$((val-1))
- fi
- val=$((val * 8 + $remaining))
- break
- ;;
- esac
- remaining=${remaining:1}
- done
- echo "$val"
-}
-
-gpio_export() {
- local gpio
- gpio=$(gpio_name2value $1)
- dir=$(gpio_dir $gpio)
- if [ ! -d ${dir} ]; then
- echo $gpio > $GPIOEXPORT
- fi
-}
-
-gpio_set() {
- local gpio
- local val
- gpio=$(gpio_name2value $1)
- val=$2
- dir=$(gpio_dir $gpio)
- if [ ! -d ${dir} ]; then
- echo $gpio > $GPIOEXPORT
- fi
- echo out > ${dir}/direction
- echo $val > ${dir}/value
-}
-
-gpio_get() {
- local gpio
- local val
- gpio=$(gpio_name2value $1)
- dir=$(gpio_dir $gpio)
- if [ ! -d ${dir} ]; then
- echo $gpio > $GPIOEXPORT
- fi
- echo in > ${dir}/direction
- cat ${dir}/value
-}
-
-# Check to see if BMC power-on-reset
-is_bmc_por() {
- local val
- # Read the Watch Dog Counter
- val=$(devmem 0x1e785010 2>/dev/null)
- if [ "$((val & 0xff00))" == "0" ]; then
- # Power ON Reset
- echo 1
- else
- echo 0
- fi
-}
-
-# Check to see if server is present in given slot or not
-is_server_prsnt() {
- local prsnt
-
- case $1 in
- 1)
- prsnt=$(gpio_get H5)
- ;;
- 2)
- prsnt=$(gpio_get H4)
- ;;
- 3)
- prsnt=$(gpio_get H7)
- ;;
- 4)
- prsnt=$(gpio_get H6)
- ;;
- *)
- prsnt=$(gpio_get H4)
- ;;
- esac
-
- if [ $prsnt == "0" ]; then
- echo 1
- else
- echo 0
- fi
-}
-
-yosemite_is_server_on() {
- local curr_pwr_cpu
- curr_pwr_cpu=$(python -c 'import sys; sys.path.append("/usr/local/fbpackages/utils"); import power_util; print power_util.get_pwr_cpu()')
- if [ $curr_pwr_cpu == "1" ]; then
- echo 1
- else
- echo 0
- fi
-}
diff --git a/meta-facebook/meta-yosemite/recipes-yosemite/fbutils/files/at93c46.py b/meta-facebook/meta-yosemite/recipes-yosemite/fbutils/files/at93c46.py
deleted file mode 100644
index 9fa9f05..0000000
--- a/meta-facebook/meta-yosemite/recipes-yosemite/fbutils/files/at93c46.py
+++ /dev/null
@@ -1,276 +0,0 @@
-# Copyright 2004-present Facebook. All rights reserved.
-#
-# This program file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program in a file named COPYING; if not, write to the
-# Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor,
-# Boston, MA 02110-1301 USA
-#
-
-import subprocess
-import struct
-import sys
-
-class VerboseLogger:
- def __init__(self, verbose=False):
- self.verbose = verbose
-
- def _verbose_print(self, caption, bytestream=None):
- '''
- Print a bytestream to stdout if verbose is enabled.
- '''
- if self.verbose:
- if bytestream is not None:
- sys.stderr.write("{}: {}\n".format(caption, " ".join(['{:02X}'.format(ord(x)) for x in bytestream])))
- else:
- sys.stderr.write("{}\n".format(caption))
-
-class AT93C46SPI(VerboseLogger):
- '''The class to access AT93C46 through SPI intf'''
- SPI_CMD = 'spi-bb'
-
- def __init__(self, bus_width, gpio_cs, gpio_ck, gpio_do, gpio_di,
- verbose=False):
- if bus_width != 8 and bus_width != 16:
- raise Exception("Invalid bus width for AT93C46!")
-
- self.bus_width = bus_width
- self.gpio_cs = gpio_cs
- self.gpio_ck = gpio_ck
- self.gpio_do = gpio_do
- self.gpio_di = gpio_di
- self.verbose = verbose
-
- self.addr_bits = 6 if self.bus_width == 16 else 7
- self.addr_mask = 0x3F if self.bus_width == 16 else 0x7F
-
- def __shift(self, bytestream, value):
- '''
- Shift an entire byte stream by value bits.
- '''
- binary = "".join(['{:08b}'.format(ord(x)) for x in bytestream])
- if value > 0:
- binary = binary[value:] + '0' * value
- else:
- binary = '0' * (-value) + binary[:value]
- return "".join([chr(int(binary[x:x+8],2)) for x in range(0, len(binary), 8)])
-
- def __io(self, op, addr, data=None):
- '''
- Perform an IO operation against the EEPROM
- '''
- write_bits = self.addr_bits + 3
- if data is not None:
- # If giving data, we are doing a write command so
- # no need to read any data.
- write_bits = write_bits + self.bus_width
- read_bits = 0
- else:
- # If not giving data, we are doing either a read
- # command or a set command, so read the result.
- # We pad with an extra bit due to a dummy bit introduced
- # by a delay for address decoding on chip.
- read_bits = self.addr_bits + 4 + self.bus_width
-
- # Format the command itself
- cmd_loc = 6 if self.bus_width == 16 else 7
- instruction = addr & self.addr_mask
- instruction = instruction | ((0x4 | (op & 0x3)) << cmd_loc)
- if data is not None:
- if self.bus_width == 16:
- write_data = struct.pack(">HH", instruction, data & 0xFFFF)
- else:
- write_data = struct.pack(">HB", instruction, data & 0xFF)
- else:
- write_data = struct.pack(">H", instruction)
- write_data = self.__shift(write_data, 16 - (cmd_loc + 3))
-
- self._verbose_print("Write data", write_data)
-
- # Run the command with the bitbang driver
- if read_bits > 0:
- data_portion = "-r {} -w {}".format(read_bits, write_bits)
- else:
- data_portion = "-w {}".format(write_bits)
-
- cmd = "{} -s {} -c {} -o {} -i {} -b {}".format(
- self.SPI_CMD, self.gpio_cs, self.gpio_ck, self.gpio_do,
- self.gpio_di, data_portion
- )
-
- self._verbose_print("Command: {}".format(cmd))
-
- out = subprocess.Popen(cmd.split(),
- stdout=subprocess.PIPE,
- stdin = subprocess.PIPE)\
- .communicate(input=write_data)
-
- # Format the response
- read_data = self.__shift(out[0], cmd_loc + 4)
- if self.bus_width == 16:
- read_data = read_data[:2]
- self._verbose_print("Read data", read_data)
- return struct.unpack(">H", read_data)[0]
- else:
- read_data = read_data[:1]
- self._verbose_print("Read data", read_data)
- return struct.unpack(">B", read_data)[0]
-
- def read(self, addr):
- return self.__io(0x2, addr)
-
- def ewen(self):
- self.__io(0x0, 0x3 << (self.addr_bits - 2))
-
- def erase(self, addr):
- self.__io(0x3, addr)
-
- def write(self, addr, data):
- self.__io(0x1, addr, data)
-
- def eral(self):
- self.__io(0x0, 0x2 << (self.addr_bits - 2))
-
- def wral(self, data):
- self.__io(0x0, 0x1 << (self.addr_bits - 2), data)
-
- def ewds(self):
- self.__io(0x0, 0x0)
-
-class AT93C46(VerboseLogger):
- '''
- The class which handles accessing memory on the AT93C46 chip.
- '''
- AT93C46_MEMORY_SIZE = 128
-
- def __init__(self, bus_width, gpio_cs, gpio_ck, gpio_do, gpio_di,
- byte_swap, verbose=False):
- self.bus_width = bus_width
- self.verbose = verbose
- self.byte_swap = byte_swap
-
- self.spi = AT93C46SPI(bus_width=bus_width, gpio_cs=gpio_cs,
- gpio_ck=gpio_ck, gpio_do=gpio_do,
- gpio_di=gpio_di, verbose=verbose)
-
- def __swap(self, value):
- '''
- Swap bytes for a 16-bit integer if instructed to do so.
- '''
- if self.bus_width == 16:
- if self.byte_swap:
- return ((value >> 8) & 0xFF) | ((value << 8) & 0xFF00)
- else:
- return value
- else:
- return value
-
- def erase(self, offset=None, limit=None):
- '''
- Erase the chip.
- '''
- if offset is None:
- offset = 0
- if limit is None:
- limit = self.AT93C46_MEMORY_SIZE
-
- if offset < 0 or offset + limit > self.AT93C46_MEMORY_SIZE:
- raise Exception("Erase would be out of bounds!")
- if self.bus_width == 16 and \
- ((offset & 1) != 0 or ((offset + limit) & 1) != 0):
- raise Exception("Erase can't start or end on odd boundary in 16-bit mode!")
-
- if offset == 0 and limit == self.AT93C46_MEMORY_SIZE:
- # Special case when we are erasing the entire chip
- self.spi.ewen()
- self.spi.eral()
- self.spi.ewds()
-
- self._verbose_print("Erased entire chip")
- else:
- # Regular case
- if self.bus_width == 16:
- real_offset = offset / 2
- real_limit = limit / 2
- else:
- real_offset = offset
- real_limit = limit
-
- self.spi.ewen()
- for addr in range(real_offset, real_offset + real_limit):
- self.spi.erase(addr)
- self.spi.ewds()
-
- self._verbose_print("Erased {} bytes from offset {}".format(limit, offset))
-
- def read(self, offset=None, limit=None):
- '''
- Read the chip into a memory buffer.
- '''
- if offset is None:
- offset = 0
- if limit is None:
- limit = self.AT93C46_MEMORY_SIZE
-
- if offset < 0 or offset + limit > self.AT93C46_MEMORY_SIZE:
- raise Exception("Read would be out of bounds!")
- if self.bus_width == 16 and \
- ((offset & 1) != 0 or ((offset + limit) & 1) != 0):
- raise Exception("Read can't start or end on odd boundary in 16-bit mode!")
-
- output = ""
- if self.bus_width == 16:
- real_offset = offset / 2
- real_limit = limit / 2
- pack_instruction = "=H"
- else:
- real_offset = offset
- real_offset
- pack_instruction = "=B"
-
- for addr in range(real_offset, real_offset + real_limit):
- output = output + struct.pack(pack_instruction, self.__swap(self.spi.read(addr)))
-
- self._verbose_print("Read {} bytes from offset {}".format(limit, offset), output)
-
- return output
-
- def write(self, data, offset=None):
- '''
- Write a memory buffer to the chip.
- '''
- if offset is None:
- offset = 0
-
- if offset < 0 or offset + len(data) > self.AT93C46_MEMORY_SIZE:
- raise Exception("Write would be out of bounds!")
- if self.bus_width == 16 and \
- ((offset & 1) != 0 or ((offset + len(data)) & 1) != 0):
- raise Exception("Write can't start or end on odd boundary in 16-bit mode!")
-
- if self.bus_width == 16:
- offset_divisor = 2
- pack_instruction = "=H"
- else:
- offset_divisor = 1
- pack_instruction = "=B"
-
- self.spi.ewen()
- for addr in range(offset, offset + len(data), offset_divisor):
- actual_addr = addr / offset_divisor
- value = self.__swap(struct.unpack(pack_instruction, data[(addr - offset):(addr - offset) + offset_divisor])[0])
-
- self.spi.erase(actual_addr)
- self.spi.write(actual_addr, value)
- self.spi.ewds()
-
- self._verbose_print("Wrote {} bytes from offset {}".format(len(data), offset), data)
diff --git a/meta-facebook/meta-yosemite/recipes-yosemite/fbutils/files/at93c46_util.py b/meta-facebook/meta-yosemite/recipes-yosemite/fbutils/files/at93c46_util.py
deleted file mode 100755
index c10f879..0000000
--- a/meta-facebook/meta-yosemite/recipes-yosemite/fbutils/files/at93c46_util.py
+++ /dev/null
@@ -1,194 +0,0 @@
-#!/usr/bin/python -S
-# Copyright 2004-present Facebook. All rights reserved.
-#
-# This program file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program in a file named COPYING; if not, write to the
-# Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor,
-# Boston, MA 02110-1301 USA
-#
-
-from argparse import ArgumentParser
-from at93c46 import AT93C46, AT93C46SPI
-import sys
-
-def get_raw(args):
- return AT93C46SPI(args.bus_width, args.cs, args.clk, args.mosi, args.miso,
- args.verbose)
-
-def get_chip(args):
- return AT93C46(args.bus_width, args.cs, args.clk, args.mosi, args.miso,
- args.byte_swap, args.verbose)
-
-def access_parser(ap):
- # Default, based on currenct HW configuration
- SPI_CS_DEFAULT = 68
- SPI_CLK_DEFAULT = 69
- SPI_MOSI_DEFAULT = 70
- SPI_MISO_DEFAULT = 71
-
- spi_group = ap.add_argument_group('SPI Access')
- spi_group.add_argument('--cs', type=int, default=SPI_CS_DEFAULT,
- help='The GPIO number for SPI CS pin (default: %s)'
- % SPI_CS_DEFAULT)
- spi_group.add_argument('--clk', type=int, default=SPI_CLK_DEFAULT,
- help='The GPIO number for SPI CLK pin (default: %s)'
- % SPI_CLK_DEFAULT)
- spi_group.add_argument('--mosi', type=int, default=SPI_MOSI_DEFAULT,
- help='The GPIO number for SPI MOSI pin (default: %s)'
- % SPI_MOSI_DEFAULT)
- spi_group.add_argument('--miso', type=int, default=SPI_MISO_DEFAULT,
- help='The GPIO number for SPI MISO pin (default: %s)'
- % SPI_MISO_DEFAULT)
-
-def bus_width_parser(ap):
- # Default, based on currenct HW configuration
- AT83C46_BUS_WIDTH = 16
-
- bus_group = ap.add_argument_group('Bus Width')
- bus_group.add_argument('--bus-width', type=int, default=AT83C46_BUS_WIDTH,
- help='The configured bus width (default: %s)'
- % AT83C46_BUS_WIDTH)
-
-def read_raw(args):
- raw = get_raw(args)
- val = raw.read(args.address)
-
- if args.int:
- print "{}".format(val)
- else:
- if args.bus_width == 16:
- print "0x{:04X}".format(val)
- else:
- print "0x{:02X}".format(val)
-
-def write_raw(args):
- if args.value[:2] == "0x":
- value = int(args.value, 16)
- else:
- value = int(args.value)
-
- raw = get_raw(args)
- raw.ewen()
- raw.erase(args.address)
- raw.write(args.address, value)
- raw.ewds()
-
-def erase_raw(args):
- raw = get_raw(args)
- raw.ewen()
- raw.erase(args.address)
- raw.ewds()
-
-def raw_subparser(subparsers):
- raw_parser = subparsers.add_parser('raw', help='Raw memory access')
- raw_sub = raw_parser.add_subparsers()
-
- read_parser = raw_sub.add_parser('read', help='Read a single memory address')
- read_parser.add_argument('address', type=int, help='The memory address')
- read_parser.add_argument('--int', action='store_true',
- help='Display output as an integer')
- read_parser.set_defaults(func=read_raw)
-
- write_parser = raw_sub.add_parser('write', help='Write a single memory address')
- write_parser.add_argument('address', type=int, help='The memory address')
- write_parser.add_argument('value', type=str, help='The value to write, either integer or hex')
- write_parser.set_defaults(func=write_raw)
-
- erase_parser = raw_sub.add_parser('erase', help='Erase a single memory address')
- erase_parser.add_argument('address', type=int, help='The memory address')
- erase_parser.set_defaults(func=erase_raw)
-
-def read_chip(args):
- chip = get_chip(args)
- data = chip.read(args.start, args.length)
-
- if args.file is None:
- sys.stdout.write(data)
- else:
- fp = open(args.file, "wb")
- fp.write(data)
-
-def write_chip(args):
- chip = get_chip(args)
-
- # Either way, limit reads to the size of the chip
- if args.file is None:
- data = sys.stdin.read(AT93C46.AT93C46_MEMORY_SIZE)
- else:
- fp = open(args.file, "rb")
- data = fp.read(AT93C46.AT93C46_MEMORY_SIZE)
-
- if args.length is not None:
- # Make sure length is correct
- if len(data) < args.length:
- data = data + '\x00' * (args.length - len(data))
- if len(data) > args.length:
- data = data[:args.length]
-
- chip.write(data, args.start)
-
-def erase_chip(args):
- chip = get_chip(args)
- chip.erase(args.start, args.length)
-
-def chip_subparser(subparsers):
- chip_parser = subparsers.add_parser('chip', help='Chip-level access')
- chip_sub = chip_parser.add_subparsers()
-
- read_parser = chip_sub.add_parser('read', help='Read from the chip')
- read_parser.add_argument('--start', type=int,
- help='The memory address to start at (default: 0)')
- read_parser.add_argument('--length', type=int,
- help='The number of bytes to read (default: whole chip)')
- read_parser.add_argument('--file', type=str,
- help='File to operate on (default: stdout)')
- read_parser.add_argument('--byte-swap', action='store_true',
- help='Byte swap values for 16-bit reads/writes')
- read_parser.set_defaults(func=read_chip)
-
- write_parser = chip_sub.add_parser('write', help='Write to the chip')
- write_parser.add_argument('--start', type=int,
- help='The memory address to start at (default: 0)')
- write_parser.add_argument('--length', type=int,
- help='The number of bytes to write (default: file length)')
- write_parser.add_argument('--file', type=str,
- help='File to operate on (default: stdin)')
- write_parser.add_argument('--byte-swap', action='store_true',
- help='Byte swap values for 16-bit reads/writes')
- write_parser.set_defaults(func=write_chip)
-
- erase_parser = chip_sub.add_parser('erase', help='Erase the chip')
- erase_parser.add_argument('--start', type=int,
- help='The memory address to start at (default: 0)')
- erase_parser.add_argument('--length', type=int,
- help='The number of bytes to erase (default: whole chip)')
- erase_parser.set_defaults(func=erase_chip)
-
-if __name__ == "__main__":
- # General arguments
- ap = ArgumentParser()
- ap.add_argument('--verbose', action='store_true',
- help='Print verbose debugging information')
-
- # SPI and bus width arguments
- access_parser(ap)
- bus_width_parser(ap)
-
- # Functionality
- subparsers = ap.add_subparsers()
- raw_subparser(subparsers)
- chip_subparser(subparsers)
-
- # Command runner
- args = ap.parse_args()
- args.func(args)
diff --git a/meta-facebook/meta-yosemite/recipes-yosemite/fbutils/files/bcm5396.py b/meta-facebook/meta-yosemite/recipes-yosemite/fbutils/files/bcm5396.py
deleted file mode 100644
index e1aba47..0000000
--- a/meta-facebook/meta-yosemite/recipes-yosemite/fbutils/files/bcm5396.py
+++ /dev/null
@@ -1,452 +0,0 @@
-#
-# Copyright 2004-present Facebook. All rights reserved.
-#
-# This program file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program in a file named COPYING; if not, write to the
-# Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor,
-# Boston, MA 02110-1301 USA
-#
-
-import subprocess
-import time
-
-class Bcm5396MDIO:
- '''The class to access BCM5396 through MDIO intf'''
- MDIO_CMD = 'mdio-bb'
-
- PHYADDR = 0x1E
-
- ACCESS_CTRL_REG = 16
- IO_CTRL_REG = 17
- STATUS_REG = 18
- DATA0_REG = 24
- DATA1_REG = 25
- DATA2_REG = 26
- DATA3_REG = 27
-
- def __init__(self, mdc, mdio):
- self.mdc = mdc
- self.mdio = mdio
- self.page = -1
-
- def __io(self, op, reg, val=0):
- cmd = '%s -p -c %s -d %s %s %s %s' \
- % (self.MDIO_CMD, self.mdc, self.mdio, op, str(self.PHYADDR),
- str(reg))
- if op == 'write':
- cmd += ' %s' % val
- out = subprocess.Popen(cmd.split(), stdout=subprocess.PIPE)\
- .communicate()[0]
- if op == 'write':
- return val
- # need to parse the result for read
- rc = 0
- for line in out.split('\n'):
- if not line.startswith('Read:'):
- continue
- rc = int(line.split(':')[1], 0)
- return rc
-
- def __read_mdio(self, reg):
- return self.__io('read', reg)
-
- def __write_mdio(self, reg, val):
- return self.__io('write', reg, val)
-
- def __set_page(self, page):
- if self.page == page:
- return
- # Write MII register ACCESS_CTRL_REG:
- # set bit 0 as "1" to enable MDIO access
- # set "page number to bit 15:8
- val = 0x1 | ((page & 0xff) << 8)
- self.__write_mdio(self.ACCESS_CTRL_REG, val)
- self.page = page
-
- def __wait_for_done(self):
- # Read MII register IO_CTRL_REG:
- # Check op_code = "00"
- while (self.__read_mdio(self.IO_CTRL_REG) & 0x3):
- time.sleep(0.010) # 10ms
-
- def read(self, page, reg, n_bytes):
- self.__set_page(page)
- # Write MII register IO_CTRL_REG:
- # set "Operation Code as "00"
- # set "Register Address" to bit 15:8
- val = 0x00 | ((reg & 0xff) << 8)
- self.__write_mdio(self.IO_CTRL_REG, val)
- # Write MII register IO_CTRL_REG:
- # set "Operation Code as "10"
- # set "Register Address" to bit 15:8
- val = 0x2 | ((reg & 0xff) << 8)
- self.__write_mdio(self.IO_CTRL_REG, val)
- self.__wait_for_done()
- # Read MII register DATA0_REG for bit 15:0
- val = long(self.__read_mdio(self.DATA0_REG))
- # Read MII register DATA1_REG for bit 31:16
- val |= self.__read_mdio(self.DATA1_REG) << 16
- # Read MII register DATA2_REG for bit 47:32
- val |= self.__read_mdio(self.DATA2_REG) << 32
- # Read MII register DATA3_REG for bit 63:48
- val |= self.__read_mdio(self.DATA3_REG) << 48
- return val
-
- def write(self, page, reg, val, n_bytes):
- self.__set_page(page)
- # Write MII register DATA0_REG for bit 15:0
- self.__write_mdio(self.DATA0_REG, val & 0xFFFF)
- # Write MII register DATA1_REG for bit 31:16
- self.__write_mdio(self.DATA1_REG, (val >> 16) & 0xFFFF)
- # Write MII register DATA2_REG for bit 47:32
- self.__write_mdio(self.DATA2_REG, (val >> 32) & 0xFFFF)
- # Write MII register DATA3_REG for bit 63:48
- self.__write_mdio(self.DATA3_REG, (val >> 48) & 0xFFFF)
- # Write MII register IO_CTRL_REG:
- # set "Operation Code as "00"
- # set "Register Address" to bit 15:8
- val = 0x00 | ((reg & 0xff) << 8)
- self.__write_mdio(self.IO_CTRL_REG, val)
- # Write MII register IO_CTRL_REG:
- # set "Operation Code as "01"
- # set "Register Address" to bit 15:8
- val = 0x1 | ((reg & 0xff) << 8)
- self.__write_mdio(self.IO_CTRL_REG, val)
- self.__wait_for_done()
-
-
-class Bcm5396SPI:
- '''The class to access BCM5396 through SPI interface'''
- SPI_CMD = 'spi-bb'
-
- READ_CMD = 0x60
- WRITE_CMD = 0x61
-
- SPI_STS_DIO = 0xF0
- SPI_STS_REG = 0xFE
- SPI_STS_REG_RACK = 0x1 << 5
- SPI_STS_REG_SPIF = 0x1 << 7
- PAGE_REG = 0xFF
-
- def __init__(self, cs, clk, mosi, miso):
- self.cs = cs
- self.clk = clk
- self.mosi = mosi
- self.miso = miso
- self.page = -1
-
- def __bytes2val(self, values):
- # LSB first, MSB last
- pos = 0
- result = 0L
- for byte in values:
- if type(byte) is str:
- byte = int(byte, 16)
- if byte > 255:
- raise Exception('%s is not a byte in the list %s'\
- % (byte, values))
- result |= byte << pos
- pos += 8
- return result
-
- def __val2bytes(self, value, n):
- result = []
- for _ in range(n):
- result.append(value & 0xFF)
- value >>= 8
- if value > 0:
- raise Exception('Value, %s, is too large for %s bytes'
- % (value, n))
- return result
-
- def __io(self, bytes_to_write, to_read=0):
- # TODO: check parameters
- cmd = '%s -s %s -S low -c %s -o %s -i %s '\
- % (self.SPI_CMD, self.cs, self.clk, self.mosi, self.miso)
- if len(bytes_to_write):
- write_cmd = '-w %s %s '\
- % (len(bytes_to_write) * 8,
- ' '.join([str(byte) for byte in bytes_to_write]))
- else:
- write_cmd = ''
- if to_read:
- # spi-bb will first return the exact number of bits used for
- # writing. So, total number of bits to read should also include
- # the number of bits written.
- cmd += '-r %s ' % str((len(bytes_to_write) + to_read) * 8)
- cmd += write_cmd
- rc = 0L
- out = subprocess.Popen(cmd.split(), stdout=subprocess.PIPE)\
- .communicate()[0]
- if to_read:
- # need to parse the result
- for line in out.split('\n'):
- if not line.startswith('Read'):
- continue
- res = line.split(':')[1]
- rc = self.__bytes2val(res.split()[len(bytes_to_write):])
- break
- return rc
-
- def __set_page(self, page):
- page &= 0xff
- if self.page == page:
- return
- self.__io([self.WRITE_CMD, self.PAGE_REG, page])
- self.page = page
-
- def __read_spi_reg(self, reg):
- reg &= 0xFF
- return self.__io([self.READ_CMD, reg], 1)
-
- def __read_spi_sts(self):
- return self.__read_spi_reg(self.SPI_STS_REG)
-
- def __read_spi_dio(self):
- return self.__read_spi_reg(self.SPI_STS_DIO)
-
- def read(self, page, reg, n_bytes):
- '''Read a register value from a page.'''
- if n_bytes > 8:
- print('TODO to support reading more than 8 bytes')
- return 0
- if page > 0xff or reg > 0xff:
- print('Page and register must be <= 255')
- return 0
- try:
- self.__set_page(page)
- self.__io([self.READ_CMD, reg], 1)
- while True:
- # check sts
- sts = self.__read_spi_sts()
- if sts & self.SPI_STS_REG_RACK:
- break
- bytes = []
- for _ in range(n_bytes):
- bytes.append(self.__read_spi_dio())
- except Exception as e:
- print(e)
- return self.__bytes2val(bytes)
-
- def write(self, page, reg, val, n_bytes):
- '''Write a value as n bytes to a register on a page.'''
- if page > 0xff or reg > 0xff:
- print('Page and register must be <= 255')
- return
- bytes = self.__val2bytes(val, n_bytes)
- if len(bytes) > 8:
- print('TODO to support writing more than 8 bytes')
- return
- bytes = [self.WRITE_CMD, reg] + bytes
- try:
- self.__set_page(page)
- self.__io(bytes)
- except Exception as e:
- print(e)
-
-class Bcm5396:
- '''The class for BCM5396 Switch'''
-
- MDIO_ACCESS = 0
- SPI_ACCESS = 1
-
- def __init__(self, access, **kwargs):
- if access == self.MDIO_ACCESS:
- self.access = Bcm5396MDIO(**kwargs)
- else:
- self.access = Bcm5396SPI(**kwargs)
-
- def write(self, page, reg, value, n_bytes):
- return self.access.write(page, reg, value, n_bytes)
-
- def read(self, page, reg, n_bytes):
- return self.access.read(page, reg, n_bytes)
-
- def __add_remove_vlan(self, add, vid, untag, fwd, spt):
- VLAN_PAGE = 0x5
- CTRL_ADDR = 0x60
- CTRL_START_DONE = (0x1 << 7)
- VID_ADDR = 0x61
- ENTRY_ADDR = 0x63
-
- fwd_map = self.__ports2portmap(fwd)
- untag_map = self.__ports2portmap(untag)
-
- # mark it as write and stop the previous action
- ctrl = 0
- self.write(VLAN_PAGE, CTRL_ADDR, ctrl, 1)
- # write entry
- if (add):
- entry = 0x1L | ((spt & 0x1F) << 1) \
- | (fwd_map << 6) | (untag_map << 23)
- else:
- entry = 0x0L
- self.write(VLAN_PAGE, ENTRY_ADDR, entry, 8)
- # write vid as the index
- self.write(VLAN_PAGE, VID_ADDR, vid & 0xFFF, 2)
- # start the write
- ctrl = CTRL_START_DONE
- self.write(VLAN_PAGE, CTRL_ADDR, ctrl, 1)
- while True:
- ctrl = self.read(VLAN_PAGE, CTRL_ADDR, 1)
- if not (ctrl & CTRL_START_DONE):
- # done
- break
- time.sleep(0.010) # 10ms
-
- def add_vlan(self, vid, untag, fwd, spt=0):
- return self.__add_remove_vlan(True, vid, untag, fwd, spt)
-
- def remove_vlan(self, vid):
- return self.__add_remove_vlan(False, vid, [], [], 0)
-
- def get_vlan(self, vid):
- VLAN_PAGE = 0x5
- CTRL_ADDR = 0x60
- CTRL_START_DONE = (0x1 << 7)
- CTRL_READ = 0x1
- VID_ADDR = 0x61
- ENTRY_ADDR = 0x63
-
- # mark it as read and stop the previous action
- ctrl = CTRL_READ
- self.write(VLAN_PAGE, CTRL_ADDR, ctrl, 1)
- # write the vid as the index
- self.write(VLAN_PAGE, VID_ADDR, vid & 0xFFF, 2)
- # start the read
- ctrl = CTRL_READ|CTRL_START_DONE
- self.write(VLAN_PAGE, CTRL_ADDR, ctrl, 1)
- while True:
- ctrl = self.read(VLAN_PAGE, CTRL_ADDR, 1)
- if not (ctrl & CTRL_START_DONE):
- # done
- break
- time.sleep(0.010) # 10ms
- entry = self.read(VLAN_PAGE, ENTRY_ADDR, 8)
- res = {}
- res['valid'] = True if entry & 0x1 else False
- res['spt'] = (entry >> 1) & 0x1f
- res['fwd'] = self.__portmap2ports((entry >> 6) & 0x1ffff)
- res['untag'] = self.__portmap2ports((entry >> 23) & 0x1ffff)
- return res
-
- def __portmap2ports(self, port_map):
- return list(set([port if port_map & (0x1 << port) else None
- for port in range (0, 17)])
- - set([None]))
-
- def __ports2portmap(self, ports):
- port_map = 0
- for port in ports:
- port_map |= (0x1 << port)
- return port_map & 0x1FFFF
-
- def __parse_arl_result(self, vid, result):
- is_bitset = lambda bit: True if result & (0x1 << bit) else False
- if not is_bitset(3):
- return None
- res = {}
- # parse vid first
- res['vid'] = (vid >> 48) & 0xfff
- mac_val = vid & 0xffffffffffffL
- mac_list = []
- for pos in range(5, -1, -1):
- mac_list.append('{:02x}'.format((mac_val >> (pos * 8)) & 0xff))
- res['mac'] = ':'.join(mac_list)
- if mac_val & (0x1 << 40):
- res['ports'] = self.__portmap2ports((result >> 6) & 0xffff)
- else:
- res['ports'] = [(result >> 6) & 0xf]
- res['static'] = is_bitset(5)
- res['age'] = is_bitset(4)
- res['valid'] = is_bitset(3)
- res['priority'] = result & 0x7
- return res
-
- def get_all_arls(self):
- ARL_PAGE = 0x5
- SEARCH_CTRL_ADDR = 0x30
- SEARCH_CTRL_START_DONE = (0x1 << 7)
- SEARCH_CTRL_SR_VALID = (0x1)
-
- VID0_ADDR = 0x33
- RESULT0_ADDR = 0x3B
- VID1_ADDR = 0x40
- RESULT1_ADDR = 0x48
-
- all = []
- # write START to search control
- ctrl = SEARCH_CTRL_START_DONE
- self.write(ARL_PAGE, SEARCH_CTRL_ADDR, ctrl, 1)
- while True:
- ctrl = self.read(ARL_PAGE, SEARCH_CTRL_ADDR, 1)
- if not (ctrl & SEARCH_CTRL_START_DONE):
- # Done
- break
- if not (ctrl & SEARCH_CTRL_SR_VALID):
- # result is not ready, sleep and retry
- time.sleep(0.010) # 10ms
- continue
- for vid_addr, result_addr in [[VID1_ADDR, RESULT1_ADDR],
- [VID0_ADDR, RESULT0_ADDR]]:
- vid = self.read(ARL_PAGE, vid_addr, 8)
- result = self.read(ARL_PAGE, result_addr, 4)
- one = self.__parse_arl_result(vid, result)
- if one:
- all.append(one)
- return all
-
- def vlan_ctrl(self, enable):
- VLAN_CTRL_PAGE = 0x34
- VLAN_CTRL0_REG = 0x0
- VLAN_CTRL0_B_EN_1QVLAN = 0x1 << 7
-
- ctrl = self.read(VLAN_CTRL_PAGE, VLAN_CTRL0_REG, 1)
- need_write = False
- if enable:
- if not ctrl & VLAN_CTRL0_B_EN_1QVLAN:
- need_write = True;
- ctrl |= VLAN_CTRL0_B_EN_1QVLAN
- else:
- if ctrl & VLAN_CTRL0_B_EN_1QVLAN:
- need_write = True;
- ctrl &= (~VLAN_CTRL0_B_EN_1QVLAN) & 0xFF
- if need_write:
- self.write(VLAN_CTRL_PAGE, VLAN_CTRL0_REG, ctrl, 1)
-
- def vlan_set_port_default(self, port, vid, pri=0):
- VLAN_PORT_PAGE = 0x34
- VLAN_PORT_REG_BASE = 0x10
-
- if port < 0 or port > 16:
- raise Exception('Invalid port number %s' % port)
- if pri < 0 or pri > 7:
- raise Exception('Invalid priority %s' % pri)
- if vid < 0 or vid > 0xFFF:
- raise Exception('Invalid VLAN %s' % vid)
- reg = VLAN_PORT_REG_BASE + port * 2
- ctrl = (pri << 13) | vid
- self.write(VLAN_PORT_PAGE, reg, ctrl, 2)
-
- def vlan_get_port_default(self, port):
- VLAN_PORT_PAGE = 0x34
- VLAN_PORT_REG_BASE = 0x10
-
- if port < 0 or port > 16:
- raise Exception('Invalid port number %s' % port)
- reg = VLAN_PORT_REG_BASE + port * 2
- val = self.read(VLAN_PORT_PAGE, reg, 2)
- res = {}
- res['priority'] = (val >> 13) & 0x7
- res['vid'] = val & 0xFFF
- return res
diff --git a/meta-facebook/meta-yosemite/recipes-yosemite/fbutils/files/bcm5396_util.py b/meta-facebook/meta-yosemite/recipes-yosemite/fbutils/files/bcm5396_util.py
deleted file mode 100644
index 1496412..0000000
--- a/meta-facebook/meta-yosemite/recipes-yosemite/fbutils/files/bcm5396_util.py
+++ /dev/null
@@ -1,260 +0,0 @@
-#!/usr/bin/python
-# Copyright 2004-present Facebook. All rights reserved.
-#
-# This program file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program in a file named COPYING; if not, write to the
-# Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor,
-# Boston, MA 02110-1301 USA
-#
-
-from argparse import ArgumentParser
-from bcm5396 import Bcm5396
-
-def auto_long(x):
- return long(x, 0)
-
-def auto_int(x):
- return int(x, 0)
-
-def get_bcm(args):
- if args.spi:
- return Bcm5396(Bcm5396.SPI_ACCESS, cs=args.cs, clk=args.clk,
- mosi=args.mosi, miso=args.miso)
- else:
- return Bcm5396(Bcm5396.MDIO_ACCESS, mdc=args.mdc, mdio=args.mdio)
-
-
-def read_register(args):
- bcm = get_bcm(args)
- val = bcm.read(args.page, args.register, args.size)
- print('Read from BCM5396 ({}:{}.{}): {}'
- .format(hex(args.page), hex(args.register), args.size, hex(val)))
-
-def write_register(args):
- bcm = get_bcm(args)
- val = bcm.write(args.page, args.register, args.value, args.size)
- print('Write to BCM5396 ({}.{}): {}'
- .format(hex(args.page), hex(args.register), hex(args.value)))
-
-def register_parser(subparser):
- reg_parser = subparser.add_parser('register', help='Register IO')
- reg_sub = reg_parser.add_subparsers()
-
- read_parser = reg_sub.add_parser('read', help='read switch register')
- read_parser.set_defaults(func=read_register)
- read_parser.add_argument('page', type=auto_int,
- help='The page of the register')
- read_parser.add_argument('register', type=auto_int,
- help='The register to read from')
- read_parser.add_argument('size', type=auto_int,
- help='Number of bytes',
- choices=range(1, 9))
-
- write_parser = reg_sub.add_parser('write', help='write switch register')
- write_parser.set_defaults(func=write_register)
- write_parser.add_argument('page', type=auto_int,
- help='The page oof the register')
- write_parser.add_argument('register', type=auto_int,
- help='The register to write to')
- write_parser.add_argument('value', type=auto_long,
- help='The value to write')
- write_parser.add_argument('size', type=auto_int,
- help='Number of bytes',
- choices=range(1, 9))
-
-
-def dump_arl(args):
- bcm = get_bcm(args)
- arls = bcm.get_all_arls()
- print('All ARLs are:')
- for entry in arls:
- print(entry)
-
-def arl_parser(subparser):
- dump_parser = subparser.add_parser('arl', help='dump all ARL entries')
- dump_parser.set_defaults(func=dump_arl)
-
-
-def __parse_port_list(parm):
- '''Parse the port numbers to a list'''
- if len(parm) == 0:
- return []
- ports=[]
- for port in parm.split(','):
- idx = port.find('-')
- if idx == -1:
- p = int(port)
- if p < 0 or p > 15:
- raise Exception('Invalid port number %s' % p)
- # just one port
- ports.append(p)
- else:
- start = int(port[:idx])
- end = int(port[idx+1:])
- if start > end or start < 0 or end > 15:
- raise Exception('Invalid port range %s-%s' % (start, end))
- ports.extend(range(start, end + 1))
- return ports
-
-def enable_vlan(args):
- bcm = get_bcm(args)
- bcm.vlan_ctrl(True)
- print('VLAN function is enabled.')
-
-def disable_vlan(args):
- bcm = get_bcm(args)
- bcm.vlan_ctrl(False)
- print('VLAN function is disabled.')
-
-def add_vlan(args):
- bcm = get_bcm(args)
- vid = args.vid
- fwd = sorted(__parse_port_list(args.fwd))
- untag = sorted(__parse_port_list(args.untag))
- spt = args.spt
- # make sure untag is subset of fwd
- if not set(untag).issubset(set(fwd)):
- raise Exception('Some untagged ports, %s, are not part of forward ports'
- % (set(untag) - set(fwd)))
- bcm.add_vlan(vid, untag, fwd, spt)
- print('Added VLAN: %s' % vid)
- print('Ports in VLAN: %s' % sorted(fwd))
- print('Ports without VLAN tag: %s' % sorted(untag))
-
-def remove_vlan(args):
- bcm = get_bcm(args)
- vid = args.vid
- bcm.remove_vlan(vid)
- print('Removed VLAN: %s' % vid)
-
-def show_vlan(args):
- bcm = get_bcm(args)
- vid = args.vid
- vlan = bcm.get_vlan(vid)
- if not vlan['valid']:
- print('VLAN %s does not exist' % vid)
- else:
- print('VLAN: %s' % vid)
- print('Spanning tree index: %s' % vlan['spt'])
- print('Ports in VLAN: %s' % sorted(vlan['fwd']))
- print('Untagged ports in VLAN: %s' % sorted(vlan['untag']))
-
-def set_port_vlan(args):
- bcm = get_bcm(args)
- bcm.vlan_set_port_default(args.port, args.vid, args.pri)
- print('Set VLAN default for port: %s' % args.port)
- print('Default VLAN: %s' % args.vid)
- print('Default priority %s' % args.pri)
-
-def get_port_vlan(args):
- bcm = get_bcm(args)
- port = bcm.vlan_get_port_default(args.port)
- print('Get VLAN default for port: %s' % args.port)
- print('Default VLAN: %s' % port['vid'])
- print('Default priority: %s' % port['priority'])
-
-def vlan_parser(subparser):
- UNTAG_DEFAULT = ''
- SPT_DEFAULT = 0
- PRI_DEFAULT = 0
-
- vlan_parser = subparser.add_parser('vlan', help='Manage vlan function')
- vlan_sub = vlan_parser.add_subparsers()
-
- add_parser = vlan_sub.add_parser('add', help='Add or modify a VLAN entry')
- add_parser.add_argument('vid', type=int, help='The VLAN ID')
- add_parser.add_argument('fwd', type=str,
- help='Ports belonging to this VLAN. i.e. 1,4,5-8')
- add_parser.add_argument('untag', type=str, default=UNTAG_DEFAULT, nargs='?',
- help='Ports that do not add VLAN tag. i.e. 1,4,5-8'
- ' (default: all ports are tagged)')
- add_parser.add_argument('spt', type=int, default=SPT_DEFAULT, nargs='?',
- help='Spanning tree index (default: %s)'
- % SPT_DEFAULT)
- add_parser.set_defaults(func=add_vlan)
-
- remove_parser = vlan_sub.add_parser('remove', help='Remove a VLAN entry')
- remove_parser.add_argument('vid', type=int, help='The VLAN ID')
- remove_parser.set_defaults(func=remove_vlan)
-
- show_parser = vlan_sub.add_parser('show', help='Show a VLAN entry')
- show_parser.add_argument('vid', type=int, help='The VLAN ID')
- show_parser.set_defaults(func=show_vlan)
-
- enable_parser = vlan_sub.add_parser('enable', help='Enable VLAN function')
- enable_parser.set_defaults(func=enable_vlan)
-
- disable_parser = vlan_sub.add_parser('disable', help='Enable VLAN function')
- disable_parser.set_defaults(func=disable_vlan)
-
- port_parser = vlan_sub.add_parser('port',
- help='Set/Get VLAN default for a port')
- port_sub = port_parser.add_subparsers()
- set_port = port_sub.add_parser('set', help='Set VLAN default for a port')
- set_port.add_argument('port', type=int, help='The port number (0..16)')
- set_port.add_argument('vid', type=int,
- help='The default VLAN for this port')
- set_port.add_argument('pri', type=int, default=PRI_DEFAULT, nargs='?',
- help='The default priority for this port '
- '(default: %s)' % PRI_DEFAULT)
- set_port.set_defaults(func=set_port_vlan)
-
- get_port = port_sub.add_parser('get', help='Get VLAN default for a port')
- get_port.add_argument('port', type=int, help='The port number (0..16)')
- get_port.set_defaults(func=get_port_vlan)
-
-def access_parser(ap):
- SPI_CS_DEFAULT = 68
- SPI_CLK_DEFAULT = 69
- SPI_MOSI_DEFAULT = 70
- SPI_MISO_DEFAULT = 71
-
- MDIO_MDC_DEFAULT = 6
- MDIO_MDIO_DEFAULT = 7
-
- spi_group = ap.add_argument_group('SPI Access')
- spi_group.add_argument('--spi', action='store_true',
- help='Access through SPI.')
- spi_group.add_argument('--cs', type=int, default=SPI_CS_DEFAULT,
- help='The GPIO number for SPI CS pin (default: %s)'
- % SPI_CS_DEFAULT)
- spi_group.add_argument('--clk', type=int, default=SPI_CLK_DEFAULT,
- help='The GPIO number for SPI CLK pin (default: %s)'
- % SPI_CLK_DEFAULT)
- spi_group.add_argument('--mosi', type=int, default=SPI_MOSI_DEFAULT,
- help='The GPIO number for SPI MOSI pin (default: %s)'
- % SPI_MOSI_DEFAULT)
- spi_group.add_argument('--miso', type=int, default=SPI_MISO_DEFAULT,
- help='The GPIO number for SPI MISO pin (default: %s)'
- % SPI_MISO_DEFAULT)
- mdio_group = ap.add_argument_group('MDIO Access (default)')
- mdio_group.add_argument('--mdc', type=int, default=MDIO_MDC_DEFAULT,
- help='The GPIO number for MDC pin (default: %s)'
- % MDIO_MDC_DEFAULT)
- mdio_group.add_argument('--mdio', type=int, default=MDIO_MDIO_DEFAULT,
- help='The GPIO number for MDIO pin (default: %s)'
- % MDIO_MDIO_DEFAULT)
- return ap
-
-
-if __name__ == '__main__':
- ap = ArgumentParser()
- access_parser(ap)
-
- subparsers = ap.add_subparsers()
- register_parser(subparsers)
- arl_parser(subparsers)
- vlan_parser(subparsers)
- args = ap.parse_args()
-
- args.func(args)
diff --git a/meta-facebook/meta-yosemite/recipes-yosemite/fbutils/files/bic-util/Makefile b/meta-facebook/meta-yosemite/recipes-yosemite/fbutils/files/bic-util/Makefile
deleted file mode 100644
index 9c046be..0000000
--- a/meta-facebook/meta-yosemite/recipes-yosemite/fbutils/files/bic-util/Makefile
+++ /dev/null
@@ -1,10 +0,0 @@
-# Copyright 2015-present Facebook. All Rights Reserved.
-all: bic-util
-
-bic-util: bic-util.c
- $(CC) -pthread -lipmi -lipmb -lbic -std=c99 -o $@ $^ $(LDFLAGS)
-
-.PHONY: clean
-
-clean:
- rm -rf *.o bic-util
diff --git a/meta-facebook/meta-yosemite/recipes-yosemite/fbutils/files/bic-util/bic-util.c b/meta-facebook/meta-yosemite/recipes-yosemite/fbutils/files/bic-util/bic-util.c
deleted file mode 100644
index 3ebc3f1..0000000
--- a/meta-facebook/meta-yosemite/recipes-yosemite/fbutils/files/bic-util/bic-util.c
+++ /dev/null
@@ -1,401 +0,0 @@
-/*
- * bic-util
- *
- * Copyright 2015-present Facebook. All Rights Reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <errno.h>
-#include <syslog.h>
-#include <stdint.h>
-#include <pthread.h>
-#include <facebook/bic.h>
-#include <openbmc/ipmi.h>
-
-#define LAST_RECORD_ID 0xFFFF
-#define MAX_SENSOR_NUM 0xFF
-#define BYTES_ENTIRE_RECORD 0xFF
-
-// Test to Get device ID
-static void
-util_get_device_id(uint8_t slot_id) {
- int ret;
- ipmi_dev_id_t id = {0};
-
- ret = bic_get_dev_id(slot_id, &id);
- if (ret) {
- printf("util_get_device_id: bic_get_dev_id returns %d\n", ret);
- return;
- }
-
- // Print response
- printf("Device ID: 0x%X\n", id.dev_id);
- printf("Device Revision: 0x%X\n", id.dev_rev);
- printf("Firmware Revision: 0x%X:0x%X\n", id.fw_rev1, id.fw_rev2);
- printf("IPMI Version: 0x%X\n", id.ipmi_ver);
- printf("Device Support: 0x%X\n", id.dev_support);
- printf("Manufacturer ID: 0x%X:0x%X:0x%X\n", id.mfg_id[2], id.mfg_id[1], id.mfg_id[0]);
- printf("Product ID: 0x%X:0x%X\n", id.prod_id[1], id.prod_id[0]);
- printf("Aux. FW Rev: 0x%X:0x%X:0x%X:0x%X\n", id.aux_fw_rev[0], id.aux_fw_rev[1],id.aux_fw_rev[2],id.aux_fw_rev[3]);
-}
-
-static void
-util_get_fw_ver(uint8_t slot_id) {
- int i, j, ret;
- uint8_t buf[16] = {0};
- for (i = 1; i <= 8; i++) {
- ret = bic_get_fw_ver(slot_id, i, buf);
- printf("version of comp: %d is", i);
- for (j = 0; j < 10; j++)
- printf("%02X:", buf[j]);
- printf("\n");
- }
-}
-
-// Tests for reading GPIO values and configuration
-static void
-util_get_gpio(uint8_t slot_id) {
- int ret;
- bic_gpio_t gpio = {0};
-
- ret = bic_get_gpio(slot_id, &gpio);
- if (ret) {
- printf("util_get_gpio: bic_get_gpio returns %d\n", ret);
- return;
- }
-
- bic_gpio_u *t = (bic_gpio_u*) &gpio;
-
- // Print response
- printf("PWRGOOD_CPU: %d\n", t->bits.pwrgood_cpu);
- printf("PWRGOOD_PCH_PWROK: %d\n", t->bits.pwrgd_pch_pwrok);
- printf("PVDDR_VRHOT_N: %d\n", t->bits.pvddr_vrhot_n);
- printf("PVCCIN_VRHOT_N: %d\n", t->bits.pvccin_vrhot_n);
- printf("FM_FAST_PROCHOT_N: %d\n", t->bits.fm_fast_prochot_n);
- printf("PCHHOT_CPU_N: %d\n", t->bits.pchhot_cpu_n);
- printf("FM_CPLD_CPU_DIMM_EVENT_C0_N: %d\n", t->bits.fm_cpld_cpu_dimm_event_c0_n);
- printf("FM_CPLD_BDXDE_THERMTRIP_N: %d\n", t->bits.fm_cpld_bdxde_thermtrip_n);
- printf("THERMTRIP_PCH_N: %d\n", t->bits.thermtrip_pch_n);
- printf("FM_CPLD_FIVR_FAULT: %d\n", t->bits.fm_cpld_fivr_fault);
- printf("FM_BDXDE_CATERR_LVT3_N: %d\n", t->bits.fm_bdxde_caterr_lvt3_n);
- printf("FM_BDXDE_ERR_LVT3_N: %d\n", t->bits.fm_bdxde_err_lvt3_n);
- printf("SLP_S4_N: %d\n", t->bits.slp_s4_n);
- printf("FM_NMI_EVENT_BMC_N: %d\n", t->bits.fm_nmi_event_bmc_n);
- printf("FM_SMI_BMC_N: %d\n", t->bits.fm_smi_bmc_n);
- printf("RST_PLTRST_BMC_N: %d\n", t->bits.rst_pltrst_bmc_n);
- printf("FP_RST_BTN_BUF_N: %d\n", t->bits.fp_rst_btn_buf_n);
- printf("BMC_RST_BTN_OUT_N: %d\n", t->bits.bmc_rst_btn_out_n);
- printf("FM_BDE_POST_CMPLT_N: %d\n", t->bits.fm_bde_post_cmplt_n);
- printf("FM_BDXDE_SLP3_N: %d\n", t->bits.fm_bdxde_slp3_n);
- printf("FM_PWR_LED_N: %d\n", t->bits.fm_pwr_led_n);
- printf("PWRGD_PVCCIN: %d\n", t->bits.pwrgd_pvccin);
- printf("SVR_ID: %d\n", t->bits.svr_id);
- printf("BMC_READY_N: %d\n", t->bits.bmc_ready_n);
- printf("BMC_COM_SW_N: %d\n", t->bits.bmc_com_sw_n);
- printf("rsvd: %d\n", t->bits.rsvd);
-}
-
-static void
-util_get_gpio_config(uint8_t slot_id) {
- int ret;
- int i;
- bic_gpio_config_t gpio_config = {0};
- bic_gpio_config_u *t = (bic_gpio_config_u *) &gpio_config;
-
- // Read configuration of all bits
- for (i = 0; i < MAX_GPIO_PINS; i++) {
- ret = bic_get_gpio_config(slot_id, i, &gpio_config);
- if (ret == -1) {
- continue;
- }
-
- printf("gpio_config for pin#%d:\n", i);
- printf("Direction: %s", t->bits.dir?"Output":"Input");
- printf("Interrupt Enabled?: %s", t->bits.ie?"Enabled":"Disabled");
- printf("Trigger Type: %s", t->bits.edge?"Level":"Edge");
- if (t->bits.trig == 0x0) {
- printf("Trigger Edge: %s\n", "Falling Edge");
- } else if (t->bits.trig == 0x1) {
- printf("Trigger Edge: %s\n", "Falling Edge");
- } else if (t->bits.trig == 0x2) {
- printf("Trigger Edge: %s\n", "Both Edges");
- } else {
- printf("Trigger Edge: %s\n", "Reserved");
- }
- }
-}
-
-static void
-util_get_config(uint8_t slot_id) {
- int ret;
- int i;
- bic_config_t config = {0};
- bic_config_u *t = (bic_config_u *) &config;
-
- ret = bic_get_config(slot_id, &config);
- if (ret) {
- printf("util_get_config: bic_get_config failed\n");
- return;
- }
-
- printf("SoL Enabled?: %s", t->bits.sol? "Enabled" : "Disabled");
- printf("POST Enabled?: %s", t->bits.post? "Enabled" : "Disabled");
- printf("KCS Enabled?: %s", t->bits.kcs? "Enabled" : "Disabled");
- printf("IPMB Enabled?: %s", t->bits.ipmb? "Enabled" : "Disabled");
-}
-
-static void
-util_set_config(uint8_t slot_id, uint8_t status) {
-
-}
-
-// Test to get the POST buffer
-static void
-util_get_post_buf(uint8_t slot_id) {
- int ret;
- uint8_t buf[MAX_IPMB_RES_LEN] = {0x0};
- uint8_t len;
- int i;
-
- ret = bic_get_post_buf(slot_id, buf, &len);
- if (ret) {
- printf("util_get_post_buf: bic_get_post_buf returns %d\n", ret);
- return;
- }
-
- printf("util_get_post_buf: returns %d bytes\n", len);
- for (i = 0; i < len; i++) {
- printf("0x%X:", buf[i]);
- }
- printf("\n");
-}
-
-// Tests to read FRUID of Monolake Server
-static void
-util_get_fruid_info(uint8_t slot_id) {
- int ret;
- int i;
-
- ipmi_fruid_info_t info = {0};
-
- ret = bic_get_fruid_info(slot_id, 0, &info);
- if (ret) {
- printf("util_get_fruid_info: bic_get_fruid_info returns %d\n", ret);
- return;
- }
-
- printf("FRUID info for 1S Slot..\n");
-
- printf("FRUID Size: %d\n", (info.size_msb << 8) + (info.size_lsb));
- printf("Accessed as : %s\n", (info.bytes_words)?"Words":"Bytes");
-}
-
-static void
-util_read_fruid(uint8_t slot_id) {
- int ret;
- int i;
-
- char path[64] = {0};
- sprintf(path, "/tmp/fruid_slot%d.bin", slot_id);
-
- ret = bic_read_fruid(slot_id, 0, path);
- if (ret) {
- printf("util_read_fruid: bic_read_fruid returns %d\n", ret);
- return;
- }
-}
-
-// Tests to read SEL from Monolake Server
-static void
-util_get_sel_info(uint8_t slot_id) {
- int ret;
-
- ipmi_sel_sdr_info_t info;
-
- ret = bic_get_sel_info(slot_id, &info);
- if (ret) {
- printf("util_get_sel_info:bic_get_sel_info returns %d\n", ret);
- return;
- }
-
- printf("SEL info for 1S Slot is..\n");
-
- printf("version: 0x%X\n", info.ver);
- printf("Record Count: 0x%X\n", info.rec_count);
- printf("Free Space: 0x%X\n", info.free_space);
- printf("Recent Add TS: 0x%X:0x%X:0x%X:0x%X\n", info.add_ts[3], info.add_ts[2], info.add_ts[1], info.add_ts[0]);
- printf("Recent Erase TS: 0x%X:0x%X:0x%X:0x%X\n", info.erase_ts[3], info.erase_ts[2], info.erase_ts[1], info.erase_ts[0]);
- printf("Operation Support: 0x%X\n", info.oper);
-}
-
-static void
-util_get_sel(uint8_t slot_id) {
- int ret;
- int i;
- uint16_t rsv;
- uint8_t rlen;
- uint8_t rbuf[MAX_IPMB_RES_LEN] = {0};
-
- ipmi_sel_sdr_req_t req;
- ipmi_sel_sdr_res_t *res = (ipmi_sel_sdr_res_t *) rbuf;
-
- req.rsv_id = 0;
- req.rec_id = 0;
- req.offset = 0;
- req.nbytes = BYTES_ENTIRE_RECORD;
-
- while (1) {
- ret = bic_get_sel(slot_id, &req, res, &rlen);
- if (ret) {
- printf("util_get_sel:bic_get_sel returns %d\n", ret);
- continue;
- }
-
- printf("SEL for rec_id %d\n", req.rec_id);
- printf("Next Record ID is %d\n", res->next_rec_id);
- printf("Record contents are..\n");
- for (i = 0; i < rlen-2; i++) { // First 2 bytes are next_rec_id
- printf("0x%X:", res->data[i]);
- }
- printf("\n");
-
- req.rec_id = res->next_rec_id;
- if (req.rec_id == LAST_RECORD_ID) {
- printf("This record is LAST record\n");
- break;
- }
- }
-}
-
-// Tests to read SDR records from Monolake Servers
-static void
-util_get_sdr_info(uint8_t slot_id) {
- int ret;
-
- ipmi_sel_sdr_info_t info;
-
- ret = bic_get_sdr_info(slot_id, &info);
- if (ret) {
- printf("util_get_sdr_info:bic_get_sdr_info returns %d\n", ret);
- return;
- }
-
- printf("SDR info for 1S Slot is..\n");
-
- printf("version: 0x%X\n", info.ver);
- printf("Record Count: 0x%X\n", info.rec_count);
- printf("Free Space: 0x%X\n", info.free_space);
- printf("Recent Add TS: 0x%X:0x%X:0x%X:0x%X\n", info.add_ts[3], info.add_ts[2], info.add_ts[1], info.add_ts[0]);
- printf("Recent Erase TS: 0x%X:0x%X:0x%X:0x%X\n", info.erase_ts[3], info.erase_ts[2], info.erase_ts[1], info.erase_ts[0]);
- printf("Operation Support: 0x%X\n", info.oper);
-}
-
-static void
-util_get_sdr(uint8_t slot_id) {
- int ret;
- int i;
- uint16_t rsv;
- uint8_t rlen;
- uint8_t rbuf[MAX_IPMB_RES_LEN] = {0};
-
- ipmi_sel_sdr_req_t req;
- ipmi_sel_sdr_res_t *res = (ipmi_sel_sdr_res_t *) rbuf;
-
- req.rsv_id = 0;
- req.rec_id = 0;
- req.offset = 0;
- req.nbytes = BYTES_ENTIRE_RECORD;
-
- while (1) {
- ret = bic_get_sdr(slot_id, &req, res, &rlen);
- if (ret) {
- printf("util_get_sdr:bic_get_sdr returns %d\n", ret);
- continue;
- }
-
- sdr_full_t *sdr = res->data;
-
- printf("type: %d, ", sdr->type);
- printf("sensor_num: %d, ", sdr->sensor_num);
- printf("sensor_type: %d, ", sdr->sensor_type);
- printf("evt_read_type: %d, ", sdr->evt_read_type);
- printf("m_val: %d, ", sdr->m_val);
- printf("m_tolerance: %d, ", sdr->m_tolerance);
- printf("b_val: %d, ", sdr->b_val);
- printf("b_accuracy: %d, ", sdr->b_accuracy);
- printf("accuracy_dir: %d, ", sdr->accuracy_dir);
- printf("rb_exp: %d,\n", sdr->rb_exp);
-
- req.rec_id = res->next_rec_id;
- if (req.rec_id == LAST_RECORD_ID) {
- printf("This record is LAST record\n");
- break;
- }
- }
-}
-
-// Test to read all Sensors from Monolake Server
-static void
-util_read_sensor(uint8_t slot_id) {
- int ret;
- int i;
- ipmi_sensor_reading_t sensor;
-
- for (i = 0; i < MAX_SENSOR_NUM; i++) {
- ret = bic_read_sensor(slot_id, i, &sensor);
- if (ret) {
- continue;
- }
-
- printf("sensor#%d: value: 0x%X, flags: 0x%X, status: 0x%X, ext_status: 0x%X\n",
- i, sensor.value, sensor.flags, sensor.status, sensor.ext_status);
- }
-}
-
-// TODO: Make it as User selectable tests to run
-int
-main(int argc, char **argv) {
-
- uint8_t slot_id;
-
- slot_id = atoi(argv[1]);
-
- util_get_fw_ver(slot_id);
-
-#if 0
- util_get_device_id(slot_id);
-
- util_get_gpio(slot_id);
- util_get_gpio_config(slot_id);
-
- util_get_config(slot_id);
-
- util_get_post_buf(slot_id);
-
- util_get_fruid_info(slot_id);
- util_read_fruid(slot_id);
-
- util_get_sel_info(slot_id);
- util_get_sel(slot_id);
-
- util_get_sdr_info(slot_id);
- util_get_sdr(slot_id);
- util_read_sensor(slot_id);
-#endif
-}
diff --git a/meta-facebook/meta-yosemite/recipes-yosemite/fbutils/files/create_vlan_intf b/meta-facebook/meta-yosemite/recipes-yosemite/fbutils/files/create_vlan_intf
deleted file mode 100644
index 2cf7a9a..0000000
--- a/meta-facebook/meta-yosemite/recipes-yosemite/fbutils/files/create_vlan_intf
+++ /dev/null
@@ -1,37 +0,0 @@
-#!/bin/bash
-#
-# Copyright 2014-present Facebook. All Rights Reserved.
-#
-# This program file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program in a file named COPYING; if not, write to the
-# Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor,
-# Boston, MA 02110-1301 USA
-#
-
-# only care about 'eth0' and 'oob' intf
-[ "$IFACE" != "eth0" ] && [ "$IFACE" != "oob" ] && exit 0
-
-. /usr/local/fbpackages/utils/ast-functions
-
-board=$(wedge_board_type)
-
-[ "$board" = "WEDGE" ] && exit 0
-
-vlan=4088
-intf="${IFACE}.${vlan}"
-slot=$(wedge_slot_id $board)
-
-vconfig add $IFACE $vlan
-ifconfig $intf up "fe80::$(printf "%x" $slot):1/64"
-
-exit 0
diff --git a/meta-facebook/meta-yosemite/recipes-yosemite/fbutils/files/eth0_mac_fixup.sh b/meta-facebook/meta-yosemite/recipes-yosemite/fbutils/files/eth0_mac_fixup.sh
deleted file mode 100644
index 1cdbcb6..0000000
--- a/meta-facebook/meta-yosemite/recipes-yosemite/fbutils/files/eth0_mac_fixup.sh
+++ /dev/null
@@ -1,41 +0,0 @@
-#!/bin/bash
-#
-# Copyright 2014-present Facebook. All Rights Reserved.
-#
-# This program file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program in a file named COPYING; if not, write to the
-# Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor,
-# Boston, MA 02110-1301 USA
-#
-
-### BEGIN INIT INFO
-# Provides: eth0_mac_fixup.sh
-# Required-Start:
-# Required-Stop:
-# Default-Start: S
-# Default-Stop:
-# Short-Description: Fixup the MAC address for eth0 based on wedge EEPROM
-### END INIT INFO
-
-PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin
-
-mac=$(weutil 2>/dev/null | grep '^Local MAC' 2>/dev/null | cut -d' ' -f3 2>/dev/null)
-
-if [ -n "$mac" ]; then
- ifconfig eth0 hw ether $mac
- # compare the 'ethaddr' from u-boot env
- ethaddr=$(fw_printenv ethaddr 2>/dev/null | cut -d'=' -f2 2>/dev/null)
- if [ "$ethaddr" != "$mac" ]; then
- fw_setenv "ethaddr" "$mac"
- fi
-fi
diff --git a/meta-facebook/meta-yosemite/recipes-yosemite/fbutils/files/fcswitcher.sh b/meta-facebook/meta-yosemite/recipes-yosemite/fbutils/files/fcswitcher.sh
deleted file mode 100755
index 53e24f3..0000000
--- a/meta-facebook/meta-yosemite/recipes-yosemite/fbutils/files/fcswitcher.sh
+++ /dev/null
@@ -1,83 +0,0 @@
-#! /bin/sh
-#
-# Copyright 2014-present Facebook. All Rights Reserved.
-#
-# This program file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program in a file named COPYING; if not, write to the
-# Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor,
-# Boston, MA 02110-1301 USA
-#
-
-### BEGIN INIT INFO
-# Provides: usbcons
-# Required-Start:
-# Required-Stop:
-# Default-Start: S
-# Default-Stop: 0 6
-# Short-Description: Creates a virtual USB serial device and starts a console
-# on it.
-#
-### END INIT INFO
-
-PATH=/sbin:/bin:/usr/sbin:/usr/bin
-NAME="FC Switcher"
-DESC="FC Failover Daemon"
-
-# source function library
-. /etc/init.d/functions
-
-. /usr/local/fbpackages/utils/ast-functions
-
-STOPPER=
-ACTION="$1"
-
-case "$ACTION" in
- start)
- if [ "$(wedge_board_type)" = "LC" ]; then
- # Ability to prevent this from starting by editing cmdline in u-boot.
- # Keeping this here until I get gadget switching working properly. (t4906522)
- /usr/local/bin/watch-fc.sh > /dev/null 2>&1 &
- echo "$NAME."
- else
- echo 'skipping watch-fc.sh: only necessary on six-pack line cards.'
- fi
- ;;
- stop)
- echo -n "Stopping $DESC: "
- killall watch-fc.sh
- echo "$NAME."
- ;;
- restart|force-reload)
- echo -n "Restarting $DESC: "
- killall watch-fc.sh
- if [ "$(wedge_board_type)" = "LC" ]; then
- sleep 1
- /usr/local/bin/watch-fc.sh > /dev/null 2>&1 &
- echo "$NAME."
- else
- echo 'skipping watch-fc.sh: only necessary on six-pack line cards.'
- fi
- ;;
- status)
- status watch-fc.sh
- exit $?
- ;;
- *)
- N=${0##*/}
- N=${N#[SK]??}
- echo "Usage: $N {start|stop|status|restart|force-reload}" >&2
- exit 1
- ;;
-esac
-
-exit 0
diff --git a/meta-facebook/meta-yosemite/recipes-yosemite/fbutils/files/fpc-util/Makefile b/meta-facebook/meta-yosemite/recipes-yosemite/fbutils/files/fpc-util/Makefile
deleted file mode 100644
index cb90045..0000000
--- a/meta-facebook/meta-yosemite/recipes-yosemite/fbutils/files/fpc-util/Makefile
+++ /dev/null
@@ -1,10 +0,0 @@
-# Copyright 2015-present Facebook. All Rights Reserved.
-all: fpc-util
-
-fpc-util: fpc-util.c
- $(CC) -pthread -lipmi -lipmb -lbic -lpal -std=c99 -o $@ $^ $(LDFLAGS)
-
-.PHONY: clean
-
-clean:
- rm -rf *.o fpc-util
diff --git a/meta-facebook/meta-yosemite/recipes-yosemite/fbutils/files/fpc-util/fpc-util.c b/meta-facebook/meta-yosemite/recipes-yosemite/fbutils/files/fpc-util/fpc-util.c
deleted file mode 100644
index 93c1166..0000000
--- a/meta-facebook/meta-yosemite/recipes-yosemite/fbutils/files/fpc-util/fpc-util.c
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * fpc-util
- *
- * Copyright 2015-present Facebook. All Rights Reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <errno.h>
-#include <syslog.h>
-#include <stdint.h>
-#include <pthread.h>
-#include <facebook/bic.h>
-#include <openbmc/pal.h>
-#include <openbmc/ipmi.h>
-
-static void
-print_usage_help(void) {
- printf("Usage: fpc-util <slot1|slot2|slot3|slot4> --usb\n");
- printf(" fpc-util <slot1|slot2|slot3|slot4|all> --identify <on/off>\n");
-}
-
-int
-main(int argc, char **argv) {
-
- uint8_t slot_id;
- char tstr[64] = {0};
-
- if (argc < 3) {
- goto err_exit;
- }
-
- if (!strcmp(argv[1], "slot1")) {
- slot_id = 1;
- } else if (!strcmp(argv[1] , "slot2")) {
- slot_id = 2;
- } else if (!strcmp(argv[1] , "slot3")) {
- slot_id = 3;
- } else if (!strcmp(argv[1] , "slot4")) {
- slot_id = 4;
- } else if (!strcmp(argv[1] , "all")) {
- slot_id = 0;
- } else {
- goto err_exit;
- }
-
- if (!strcmp(argv[2], "--usb")) {
- printf("fpc-util: switching USB channel to slot%d\n", slot_id);
- return pal_switch_usb_mux(slot_id);
- } else if (!strcmp(argv[2], "--identify")) {
- if (argc != 4) {
- goto err_exit;
- }
- printf("fpc-util: identication for %s is %s\n", argv[1], argv[3]);
- if (slot_id == 0) {
- sprintf(tstr, "identify_sled");
- } else {
- sprintf(tstr, "identify_slot%d", slot_id);
- }
-
- return pal_set_key_value(tstr, argv[3]);
- } else {
- goto err_exit;
- }
-
- return 0;
-err_exit:
- print_usage_help();
- return -1;
-}
diff --git a/meta-facebook/meta-yosemite/recipes-yosemite/fbutils/files/fw-util/Makefile b/meta-facebook/meta-yosemite/recipes-yosemite/fbutils/files/fw-util/Makefile
deleted file mode 100644
index b56fca9..0000000
--- a/meta-facebook/meta-yosemite/recipes-yosemite/fbutils/files/fw-util/Makefile
+++ /dev/null
@@ -1,10 +0,0 @@
-# Copyright 2015-present Facebook. All Rights Reserved.
-all: fw-util
-
-fw-util: fw-util.c
- $(CC) -pthread -lipmi -lipmb -lbic -lpal -std=c99 -o $@ $^ $(LDFLAGS)
-
-.PHONY: clean
-
-clean:
- rm -rf *.o fw-util
diff --git a/meta-facebook/meta-yosemite/recipes-yosemite/fbutils/files/fw-util/fw-util.c b/meta-facebook/meta-yosemite/recipes-yosemite/fbutils/files/fw-util/fw-util.c
deleted file mode 100644
index 2b472b3..0000000
--- a/meta-facebook/meta-yosemite/recipes-yosemite/fbutils/files/fw-util/fw-util.c
+++ /dev/null
@@ -1,161 +0,0 @@
-/*
- * fw-util
- *
- * Copyright 2015-present Facebook. All Rights Reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <errno.h>
-#include <syslog.h>
-#include <stdint.h>
-#include <pthread.h>
-#include <facebook/bic.h>
-#include <openbmc/pal.h>
-#include <openbmc/ipmi.h>
-
-static void
-print_usage_help(void) {
- printf("Usage: fw_util <slot1|slot2|slot3|slot4> <--version>\n");
- printf(" fw_util <slot1|slot2|slot3|slot4> <--update> <--cpld> <path>\n");
-}
-
-// TODO: Need to confirm the interpretation of firmware version for print
-// Right now using decimal to print the versions
-static void
-print_fw_ver(uint8_t slot_id) {
- int i;
- uint8_t ver[32] = {0};
-
- // Print CPLD Version
- if (bic_get_fw_ver(slot_id, FW_CPLD, ver)) {
- return;
- }
-
- printf("CPLD Version: 0x%02x%02x%02x%02x\n", ver[0], ver[1], ver[2], ver[3]);
-
- // Print Bridge-IC Version
- if (bic_get_fw_ver(slot_id, FW_BIC, ver)) {
- return;
- }
-
- printf("Bridge-IC Version: v%x.%x\n", ver[0], ver[1]);
-
- // Print ME Version
- if (bic_get_fw_ver(slot_id, FW_ME, ver)){
- return;
- }
-
- printf("ME Version: %x.%x.%x.%x%x\n", ver[0], ver[1], ver[2], ver[3], ver[4]);
-
- // Print PVCCIN VR Version
- if (bic_get_fw_ver(slot_id, FW_PVCCIN_VR, ver)){
- return;
- }
-
- printf("PVCCIN VR Version: 0x%02x%02x, 0x%02x%02x\n", ver[0], ver[1], ver[2], ver[3]);
-
- // Print DDRAB VR Version
- if (bic_get_fw_ver(slot_id, FW_DDRAB_VR, ver)){
- return;
- }
-
- printf("DDRAB VR Version: 0x%02x%02x, 0x%02x%02x\n", ver[0], ver[1], ver[2], ver[3]);
-
- // Print P1V05 VR Version
- if (bic_get_fw_ver(slot_id, FW_P1V05_VR, ver)){
- return;
- }
-
- printf("P1V05 VR Version: 0x%02x%02x, 0x%02x%02x\n", ver[0], ver[1], ver[2], ver[3]);
-
- // Print PVCCGBE VR Version
- if (bic_get_fw_ver(slot_id, FW_PVCCGBE_VR, ver)){
- return;
- }
-
- printf("PVCCGBE VR Version: 0x%02x%02x, 0x%02x%02x\n", ver[0], ver[1], ver[2], ver[3]);
-
- // Print PVCCSCSUS VR Version
- if (bic_get_fw_ver(slot_id, FW_PVCCSCSUS_VR, ver)){
- return;
- }
-
- printf("PVCCSCSUS VR Version: 0x%02x%02x, 0x%02x%02x\n", ver[0], ver[1], ver[2], ver[3]);
-
- // Print BIOS version
- if (pal_get_sysfw_ver(slot_id, ver)) {
- return;
- }
-
- // BIOS version response contains the length at offset 2 followed by ascii string
- printf("BIOS Version: ");
- for (i = 3; i < 3+ver[2]; i++) {
- printf("%c", ver[i]);
- }
- printf("\n");
-}
-
-int
-main(int argc, char **argv) {
-
- uint8_t slot_id;
-
- // Check for border conditions
- if ((argc != 3) && (argc != 5)) {
- goto err_exit;
- }
-
- // Derive slot_id from first parameter
- if (!strcmp(argv[1], "slot1")) {
- slot_id = 1;
- } else if (!strcmp(argv[1] , "slot2")) {
- slot_id =2;
- } else if (!strcmp(argv[1] , "slot3")) {
- slot_id =3;
- } else if (!strcmp(argv[1] , "slot4")) {
- slot_id =4;
- } else {
- goto err_exit;
- }
-
- // check operation to perform
- if (!strcmp(argv[2], "--version")) {
- // handle printing versions of f/w components
- print_fw_ver(slot_id);
- } else if (!strcmp(argv[2], "--update")) {
- // handle firmware update
- if (argc != 5) {
- goto err_exit;
- }
-
- if (!strcmp(argv[3], "--cpld")) {
- return bic_update_fw(slot_id, UPDATE_CPLD, argv[4]);
- } else {
- goto err_exit;
- }
- } else {
- goto err_exit;
- }
-
- return 0;
-
-err_exit:
- print_usage_help();
- return -1;
-}
diff --git a/meta-facebook/meta-yosemite/recipes-yosemite/fbutils/files/mdio.py b/meta-facebook/meta-yosemite/recipes-yosemite/fbutils/files/mdio.py
deleted file mode 100755
index aa7d4bf..0000000
--- a/meta-facebook/meta-yosemite/recipes-yosemite/fbutils/files/mdio.py
+++ /dev/null
@@ -1,124 +0,0 @@
-#!/usr/bin/python
-#
-# Copyright 2014-present Facebook. All Rights Reserved.
-#
-# This program file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program in a file named COPYING; if not, write to the
-# Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor,
-# Boston, MA 02110-1301 USA
-#
-
-from argparse import ArgumentParser
-import subprocess
-import time
-
-IO_BASE = [ 0x1e660000, 0x1e680000 ]
-PHYCR_REG_OFFSET = 0x60
-PHYCR_READ_BIT = 0x1 << 26
-PHYCR_WRITE_BIT = 0x1 << 27
-phycr_reg = lambda mac: IO_BASE[mac - 1] + PHYCR_REG_OFFSET
-PHYDATA_REG_OFFSET = 0x64
-phydata_reg = lambda mac: IO_BASE[mac - 1] + PHYDATA_REG_OFFSET
-
-
-devmem_read_cmd = lambda reg: [ 'devmem', hex(reg) ]
-devmem_write_cmd = lambda reg, val: [ 'devmem', hex(reg), '32', hex(val)]
-
-
-def devmem_read(reg):
- cmd = devmem_read_cmd(reg)
- #print('Cmd: {}'.format(cmd))
- out = subprocess.Popen(cmd, stdout=subprocess.PIPE).communicate()[0]
- return int(out, 0)
-
-
-def devmem_write(reg, val):
- cmd = devmem_write_cmd(reg, val)
- #print('Cmd: {}'.format(cmd))
- subprocess.Popen(cmd, stdout=subprocess.PIPE).communicate()[0]
-
-
-def wait_for_mdio_done(args):
- reg = phycr_reg(args.mac)
- while devmem_read(reg) & (PHYCR_READ_BIT|PHYCR_WRITE_BIT):
- time.sleep(0.010) # 10ms
-
-
-def read_mdio(args):
- reg = phycr_reg(args.mac)
- ctrl = devmem_read(reg)
- ctrl &= 0x3000003f
- ctrl |= (args.phy & 0x1F) << 16
- ctrl |= (args.register & 0x1F) << 21
- ctrl |= PHYCR_READ_BIT
- devmem_write(reg, ctrl)
- wait_for_mdio_done(args)
- val = devmem_read(phydata_reg(args.mac)) >> 16
- print('Read from PHY ({}.{}): {}'
- .format(hex(args.phy), hex(args.register), hex(val)))
-
-
-def write_mdio(args):
- ctrl_reg = phycr_reg(args.mac)
- ctrl = devmem_read(ctrl_reg)
- ctrl &= 0x3000003f
- ctrl |= (args.phy & 0x1F) << 16
- ctrl |= (args.register & 0x1F) << 21
- ctrl |= PHYCR_WRITE_BIT
- data_reg = phydata_reg(args.mac)
- # write data first
- devmem_write(data_reg, args.value)
- # then ctrl
- devmem_write(ctrl_reg, ctrl)
- wait_for_mdio_done(args)
- print('Write to PHY ({}.{}): {}'
- .format(hex(args.phy), hex(args.register), hex(args.value)))
-
-
-def auto_int(x):
- return int(x, 0)
-
-if __name__ == '__main__':
- ap = ArgumentParser()
- ap.add_argument('--mac', '-m', type=int, default=2,
- help='The MAC')
- ap.add_argument('--phy', '-p', type=auto_int, default=0x1f,
- help='The PHY address')
-
- subparsers = ap.add_subparsers()
-
- read_parser = subparsers.add_parser('read',
- help='read MDIO')
- read_parser.set_defaults(func=read_mdio)
- read_parser.add_argument('register', type=auto_int,
- help='The register to read from')
-
- write_parser = subparsers.add_parser('write',
- help='write MDIO')
- write_parser.set_defaults(func=write_mdio)
- write_parser.add_argument('register', type=auto_int,
- help='The register to write to')
- write_parser.add_argument('value', type=auto_int,
- help='The value to write to')
-
- args = ap.parse_args()
-
- if args.mac != 2 and args.mac != 1:
- print("MAC can only be either 1 or 2.")
- exit(-1)
-
- if args.phy > 0x1f:
- printf("PHY address must be smaller than 0x1f.")
- exit(-2)
-
- args.func(args)
diff --git a/meta-facebook/meta-yosemite/recipes-yosemite/fbutils/files/mount_data0.sh b/meta-facebook/meta-yosemite/recipes-yosemite/fbutils/files/mount_data0.sh
deleted file mode 100755
index 6986be5..0000000
--- a/meta-facebook/meta-yosemite/recipes-yosemite/fbutils/files/mount_data0.sh
+++ /dev/null
@@ -1,61 +0,0 @@
-#!/bin/sh
-#
-# Copyright 2014-present Facebook. All Rights Reserved.
-#
-# This program file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program in a file named COPYING; if not, write to the
-# Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor,
-# Boston, MA 02110-1301 USA
-#
-
-### BEGIN INIT INFO
-# Provides: mount_data0
-# Required-Start: mountvirtfs
-# Required-Stop:
-# Default-Start: S
-# Default-Stop:
-# Short-Description: Mount data0 partition from flash chip.
-# Description:
-### END INIT INFO
-
-. /etc/default/rcS
-
-# Find out which device maps to 'data0' on mtd
-# Note: /proc/mtd lists partitions using mtdX, where X is a number,
-# but we mount using /dev/mtdblockX. We'll do some magic here
-# to get the mtdX (char device) and mtdblockX (block device)
-# names.
-MOUNT_POINT="/mnt/data"
-DATA_CHAR_DEV=$(cat /proc/mtd | awk '{ if ($4 == "\"data0\"") print $1 }' |
- cut -d ':' -f 1 | awk '{ print "/dev/" $1 }')
-if [ -z "$DATA_CHAR_DEV" ]
-then
- echo "No data0 partition found. Not mounting anything to $MOUNT_POINT."
-else
- DEVICE_ID=$(echo $DATA_CHAR_DEV | tail -c 2)
- DATA_BLOCK_DEV=${DATA_CHAR_DEV/mtd/mtdblock}
-
- echo "data0 partition found on $DATA_BLOCK_DEV; mounting to $MOUNT_POINT."
- mount -t jffs2 $DATA_BLOCK_DEV $MOUNT_POINT
-
- # if the mount failed, format the partition and remount
- if [ $? -ne 0 ]
- then
- echo "Mount failed; formatting $DATA_BLOCK_DEV and remounting."
- flash_eraseall $DATA_CHAR_DEV
- mount -t jffs2 $DATA_BLOCK_DEV $MOUNT_POINT
- fi
-fi
-
-: exit 0
-
diff --git a/meta-facebook/meta-yosemite/recipes-yosemite/fbutils/files/post_led.sh b/meta-facebook/meta-yosemite/recipes-yosemite/fbutils/files/post_led.sh
deleted file mode 100644
index c23349f..0000000
--- a/meta-facebook/meta-yosemite/recipes-yosemite/fbutils/files/post_led.sh
+++ /dev/null
@@ -1,105 +0,0 @@
-#!/bin/sh
-#
-# Copyright 2004-present Facebook. All rights reserved.
-#
-# This program file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program in a file named COPYING; if not, write to the
-# Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor,
-# Boston, MA 02110-1301 USA
-#
-
-usage() {
- echo "Displays values onto the debug header LEDs."
- echo "Hex and decimal accepted."
- echo "Usage: $0 <value>"
-}
-
-. /usr/local/fbpackages/utils/ast-functions
-
-# Function to set the less significant hex digit
-display_lower() {
- local bit0=$(expr $1 % 2)
- local bit1=$(expr $1 / 2 % 2)
- local bit2=$(expr $1 / 4 % 2)
- local bit3=$(expr $1 / 8 % 2)
-
- # Set the pins to the correct operating mode.
- # The relevant pins are GPIOG[0...3].
- # For GPIO bank G, SCU84[0..3] must be 0.
- devmem_clear_bit $(scu_addr 84) 0
- devmem_clear_bit $(scu_addr 84) 1
- devmem_clear_bit $(scu_addr 84) 2
- devmem_clear_bit $(scu_addr 84) 3
-
- # Now set the GPIOs to the right binary values
- gpio_set 48 $bit0
- gpio_set 49 $bit1
- gpio_set 50 $bit2
- gpio_set 51 $bit3
-}
-
-# Function to set the more significant hex digit
-display_upper() {
- local bit0=$(expr $1 % 2)
- local bit1=$(expr $1 / 2 % 2)
- local bit2=$(expr $1 / 4 % 2)
- local bit3=$(expr $1 / 8 % 2)
-
- # Set the pins to the correct operating mode.
- # The relevant pins are GPIOB[4...7].
- # GPIOB4: SCU80[12] = 0 and Strap[14] = 0
- # GPIOB5: SCU80[13] = 0
- # GPIOB6: SCU80[14] = 0
- # GPIOB7: SCU80[15] = 0
- devmem_clear_bit $(scu_addr 70) 14
- devmem_clear_bit $(scu_addr 80) 12
- devmem_clear_bit $(scu_addr 80) 13
- devmem_clear_bit $(scu_addr 80) 14
- devmem_clear_bit $(scu_addr 80) 15
-
- gpio_set 12 $bit0
- gpio_set 13 $bit1
- gpio_set 14 $bit2
- gpio_set 15 $bit3
-}
-
-# Check number of parameters
-if [ $# -ne 1 ]
-then
- usage
- exit 1
-fi
-
-# Make sure input is actually numeric
-DEC_VALUE=$(printf "%d" $1 2>/dev/null)
-if [ $? -eq 1 ]
-then
- echo "Unable to parse input as numeric value."
- exit 1
-fi
-
-# Make sure input is within proper range
-if [ $DEC_VALUE -lt 0 ] || [ $DEC_VALUE -gt 255 ]
-then
- echo "Value $DEC_VALUE is outside of displayable range 0 - 0xff (255)."
- exit 1
-fi
-
-# Get upper/lower decimal values
-LOWER_DEC_VALUE=$(expr $DEC_VALUE % 16)
-UPPER_DEC_VALUE=$(expr $DEC_VALUE / 16)
-
-# Display the results
-display_lower $LOWER_DEC_VALUE
-display_upper $UPPER_DEC_VALUE
-
diff --git a/meta-facebook/meta-yosemite/recipes-yosemite/fbutils/files/power-on.sh b/meta-facebook/meta-yosemite/recipes-yosemite/fbutils/files/power-on.sh
deleted file mode 100644
index 3a9ce06..0000000
--- a/meta-facebook/meta-yosemite/recipes-yosemite/fbutils/files/power-on.sh
+++ /dev/null
@@ -1,99 +0,0 @@
-#!/bin/sh
-#
-# Copyright 2014-present Facebook. All Rights Reserved.
-#
-# This program file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program in a file named COPYING; if not, write to the
-# Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor,
-# Boston, MA 02110-1301 USA
-
-### BEGIN INIT INFO
-# Provides: power-on
-# Required-Start:
-# Required-Stop:
-# Default-Start: S
-# Default-Stop:
-# Short-Description: Power on Server
-### END INIT INFO
-. /usr/local/fbpackages/utils/ast-functions
-
-PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin
-
-# Disable Watch Dog Timer
-/usr/local/bin/watchdog_ctrl.sh off
-
-
-KEYDIR=/mnt/data/kv_store
-DEF_PWR_ON=1
-TO_PWR_ON=
-
-check_por_config()
-{
-
- TO_PWR_ON=-1
-
- # Check if the file/key doesn't exist
- if [ ! -f "${KEYDIR}/slot${1}_por_cfg" ]; then
- TO_PWR_ON=$DEF_PWR_ON
- else
- POR=`cat ${KEYDIR}/slot${1}_por_cfg`
-
- # Case ON
- if [ $POR == "on" ]; then
- TO_PWR_ON=1;
-
- # Case OFF
- elif [ $POR == "off" ]; then
- TO_PWR_ON=0;
-
- # Case LPS
- elif [ $POR == "lps" ]; then
-
- # Check if the file/key doesn't exist
- if [ ! -f "${KEYDIR}/pwr_server${1}_last_state" ]; then
- TO_PWR_ON=$DEF_PWR_ON
- else
- LS=`cat ${KEYDIR}/pwr_server${1}_last_state`
- if [ $LS == "on" ]; then
- TO_PWR_ON=1;
- elif [ $LS == "off" ]; then
- TO_PWR_ON=0;
- fi
- fi
- fi
- fi
-}
-
-# Check whether it is fresh power on reset
-if [ $(is_bmc_por) -eq 1 ]; then
-
- check_por_config 1
- if [ $TO_PWR_ON -eq 1 ] && [ $(is_server_prsnt 1) == "1" ] ; then
- power-util slot1 on
- fi
-
- check_por_config 2
- if [ $TO_PWR_ON -eq 1 ] && [ $(is_server_prsnt 2) == "1" ] ; then
- power-util slot2 on
- fi
-
- check_por_config 3
- if [ $TO_PWR_ON -eq 1 ] && [ $(is_server_prsnt 3) == "1" ] ; then
- power-util slot3 on
- fi
-
- check_por_config 4
- if [ $TO_PWR_ON -eq 1 ] && [ $(is_server_prsnt 4) == "1" ] ; then
- power-util slot4 on
- fi
-fi
diff --git a/meta-facebook/meta-yosemite/recipes-yosemite/fbutils/files/power_led.sh b/meta-facebook/meta-yosemite/recipes-yosemite/fbutils/files/power_led.sh
deleted file mode 100755
index 2f9bb6a..0000000
--- a/meta-facebook/meta-yosemite/recipes-yosemite/fbutils/files/power_led.sh
+++ /dev/null
@@ -1,58 +0,0 @@
-#!/bin/bash
-#
-# Copyright 2014-present Facebook. All Rights Reserved.
-#
-# This program file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program in a file named COPYING; if not, write to the
-# Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor,
-# Boston, MA 02110-1301 USA
-#
-
-usage() {
- echo "Usage: $1 <slot#> <on | off>"
- exit -1
-}
-
-. /usr/local/fbpackages/utils/ast-functions
-
-PATH=/sbin:/bin:/usr/sbin:/usr/bin
-
-set -e
-
-if [ $# != 2 ]; then
- usage $0
-fi
-
-# Slot#1: GPIOM1(97),Slot#2: GPIOM0(96),Slot#3: GPIOM3(99),Slot#4: GPIOM2(98)
-if [ $1 = "1" ]; then
- gpio=M1
-elif [ $1 = "2" ]; then
- gpio=M0
-elif [ $1 = "3" ]; then
- gpio=M3
-elif [ $1 = "4" ]; then
- gpio=M2
-else
- usage $0
-fi
-
-
-if [ $2 = "on" ]; then
- val=1
-elif [ $2 = "off" ]; then
- val=0
-else
- usage $0
-fi
-
-gpio_set $gpio $val
diff --git a/meta-facebook/meta-yosemite/recipes-yosemite/fbutils/files/power_util.py b/meta-facebook/meta-yosemite/recipes-yosemite/fbutils/files/power_util.py
deleted file mode 100644
index d1cc60e..0000000
--- a/meta-facebook/meta-yosemite/recipes-yosemite/fbutils/files/power_util.py
+++ /dev/null
@@ -1,151 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2015-present Facebook. All Rights Reserved.
-#
-# This program file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program in a file named COPYING; if not, write to the
-# Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor,
-# Boston, MA 02110-1301 USA
-#
-
-import os
-import re
-import time
-import logging
-from ctypes import *
-
-POR_DIR = '/mnt/data/power/por'
-POR_CONFIG = '%s/config' % POR_DIR
-POR_LPS = '%s/last_state' % POR_DIR
-
-logging.basicConfig(level=logging.INFO)
-log = logging.getLogger(__name__)
-
-class PORConfig():
- on = "1" # Default ON
- off = "2" # Default OFF
- lps = "3" # Default is to use the Last Power State
-
-# Handler for Bridge IC libraries
-bic = CDLL("libbic.so")
-
-class BIC_GPIO(Structure):
- _fields_ = [ ("bic_gpio_data", c_char * 4) ]
-
-# Get 32-bit GPIO data
-def get_bic_gpio():
- gpio = BIC_GPIO()
- p_gpio = pointer(gpio)
- bic.bic_get_gpio(p_gpio)
- return gpio
-
-# Get the CPU power status
-def get_pwr_cpu():
- gpio = get_bic_gpio()
- pwrgood_cpu = (ord(gpio.bic_gpio_data[0]) & 0x01)
- return pwrgood_cpu
-
-# Initilize the POR configuration files in /mnt/data
-def init_por():
-
- por = PORConfig()
-
- # For the Power On Reset Config
- if not os.path.isfile(POR_CONFIG):
- try:
- os.makedirs(POR_DIR)
- except OSERROR as err:
- pass
-
- por_cnfg = open(POR_CONFIG, 'w')
- por_cnfg.write('%s\n' % por.on)
- por_cnfg.close()
-
- # For the Last Power State info
- if not os.path.isfile(POR_LPS):
- curr_time = int(time.time())
- lps = 'on %s' % str(curr_time)
-
- f_lps = open(POR_LPS, 'w')
- f_lps.write('%s\n' % lps)
- f_lps.close()
-
-# Get the POR config [ ON | OFF | LPS ]
-def get_por_config():
-
- por = PORConfig()
-
- if os.path.isfile(POR_CONFIG):
- por_cnfg = open(POR_CONFIG, 'r')
- cnfg = por_cnfg.read(1)
-
- if cnfg in [por.on, por.off, por.lps]:
- return cnfg
- else:
- return 0
- else:
- return -1
-
-# To check whether the last power state was on or off
-def get_por_lps():
-
- if os.path.isfile(POR_LPS):
- f_lps = open(POR_LPS, 'r')
- lps = f_lps.readline()
- if re.search(r'on', lps):
- return 1
- elif re.search(r'off', lps):
- return 0
- else:
- return -1
-
-# This tells whether to Power ON or not on POR
-# 1 - Power ON
-# 0 - Do not Power ON
-def por_policy():
-
- por = PORConfig()
- cnfg = get_por_config()
- if cnfg < 1:
- log.error("power_util: Error getting the POR config.")
- exit(-1)
-
- if (cnfg == por.on):
- # cpu power ON
- log.debug('ON: Powering ON')
- return 1
-
- elif (cnfg == por.off):
- # cpu power OFF
- log.debug('OFF: Powering OFF')
- return 0
-
- elif (cnfg == por.lps):
- lps = get_por_lps()
- if lps < 0:
- log.error("power_util: Error getting the POR Last State.")
- exit(-1)
-
- if lps == 1:
- # cpu power ON
- log.debug('LPS: Powering ON')
- return 1
-
- elif lps == 0:
- # cpu power OFF
- log.debug('LPS: Powering OFF')
- return 0
-
-
-if __name__ == "__main__":
- main()
diff --git a/meta-facebook/meta-yosemite/recipes-yosemite/fbutils/files/rc.early b/meta-facebook/meta-yosemite/recipes-yosemite/fbutils/files/rc.early
deleted file mode 100644
index 0f47c72..0000000
--- a/meta-facebook/meta-yosemite/recipes-yosemite/fbutils/files/rc.early
+++ /dev/null
@@ -1,25 +0,0 @@
-#!/bin/sh
-#
-# Copyright 2014-present Facebook. All Rights Reserved.
-#
-# This program file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program in a file named COPYING; if not, write to the
-# Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor,
-# Boston, MA 02110-1301 USA
-#
-# This script will be executed at rcS S04 level, which is right after mount /mnt/data
-# and before almost anything else.
-
-if [ -x /mnt/data/etc/rc.early ]; then
- /mnt/data/etc/rc.early
-fi
diff --git a/meta-facebook/meta-yosemite/recipes-yosemite/fbutils/files/rc.local b/meta-facebook/meta-yosemite/recipes-yosemite/fbutils/files/rc.local
deleted file mode 100644
index 36fa0f1..0000000
--- a/meta-facebook/meta-yosemite/recipes-yosemite/fbutils/files/rc.local
+++ /dev/null
@@ -1,26 +0,0 @@
-#!/bin/sh
-#
-# Copyright 2014-present Facebook. All Rights Reserved.
-#
-# This program file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program in a file named COPYING; if not, write to the
-# Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor,
-# Boston, MA 02110-1301 USA
-#
-
-#
-# This script will be executed *after* all the other init scripts.
-
-if [ -x /mnt/data/etc/rc.local ]; then
- /mnt/data/etc/rc.local
-fi
diff --git a/meta-facebook/meta-yosemite/recipes-yosemite/fbutils/files/reset_usb.sh b/meta-facebook/meta-yosemite/recipes-yosemite/fbutils/files/reset_usb.sh
deleted file mode 100644
index a7936b1..0000000
--- a/meta-facebook/meta-yosemite/recipes-yosemite/fbutils/files/reset_usb.sh
+++ /dev/null
@@ -1,55 +0,0 @@
-#!/bin/sh
-#
-# Copyright 2014-present Facebook. All Rights Reserved.
-#
-# This program file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program in a file named COPYING; if not, write to the
-# Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor,
-# Boston, MA 02110-1301 USA
-#
-
-. /usr/local/fbpackages/utils/ast-functions
-
-#TODO: Add logic to control mux based on front panel switch
-echo -n "Set USB Mux to given slot ... "
-
-# USB_MUX_SEL signals: GPIOE4(36), GPIOE5(37)
-slot=$1
-
-case $slot in
- 1)
- gpio_set E4 1
- gpio_set E5 0
- ;;
- 2)
- gpio_set E4 0
- gpio_set E5 0
- ;;
- 3)
- gpio_set E4 1
- gpio_set E5 1
- ;;
- 4)
- gpio_set E4 0
- gpio_set E5 1
- ;;
- *)
- gpio_set E4 0
- gpio_set E5 0
- ;;
-esac
-
-# Enable the USB MUX GPIOS3(147)
-gpio_set S3 0
-
-echo "Done"
diff --git a/meta-facebook/meta-yosemite/recipes-yosemite/fbutils/files/setup-gpio.sh b/meta-facebook/meta-yosemite/recipes-yosemite/fbutils/files/setup-gpio.sh
deleted file mode 100755
index 10aad30..0000000
--- a/meta-facebook/meta-yosemite/recipes-yosemite/fbutils/files/setup-gpio.sh
+++ /dev/null
@@ -1,401 +0,0 @@
-#!/bin/bash
-#
-# Copyright 2014-present Facebook. All Rights Reserved.
-#
-# This program file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program in a file named COPYING; if not, write to the
-# Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor,
-# Boston, MA 02110-1301 USA
-#
-
-### BEGIN INIT INFO
-# Provides: gpio-setup
-# Required-Start:
-# Required-Stop:
-# Default-Start: S
-# Default-Stop:
-# Short-Description: Set up GPIO pins as appropriate
-### END INIT INFO
-
-# This file contains definitions for the GPIO pins that were not otherwise
-# defined in other files. We should probably move some more of the
-# definitions to this file at some point.
-
-# The commented-out sections are generally already defined elsewhere,
-# and defining them twice generates errors.
-
-# The exception to this is the definition of the GPIO H0, H1, and H2
-# pins, which seem to adversely affect the rebooting of the system.
-# When defined, the system doesn't reboot cleanly. We're still
-# investigating this.
-
-. /usr/local/fbpackages/utils/ast-functions
-
-# Set up to read the board revision pins, Y0, Y1, Y2
-devmem_set_bit $(scu_addr 70) 19
-devmem_clear_bit $(scu_addr a4) 8
-devmem_clear_bit $(scu_addr a4) 9
-devmem_clear_bit $(scu_addr a4) 10
-
-gpio_export Y0
-gpio_export Y1
-gpio_export Y2
-
-# SLOT1_PRSNT_N, GPIOH5 (61)
-# GPIOH5(61): SCU90[6], SCU90[7] shall be 0
-devmem_clear_bit $(scu_addr 90) 6
-devmem_clear_bit $(scu_addr 90) 7
-
-gpio_export H5
-
-# SLOT2_PRSNT_N, GPIOH4 (60)
-# GPIOH4(60): SCU90[6], SCU90[7] shall be 0
-gpio_export H4
-
-# SLOT3_PRSNT_N, GPIOH7 (63)
-# GPIOH7(63): SCU90[6], SCU90[7] shall be 0
-gpio_export H7
-
-# SLOT4_PRSNT_N, GPIOH6 (62)
-# GPIOH6(62): SCU90[6], SCU90[7] shall be 0
-gpio_export H6
-
-# BMC_PWR_BTN_IN_N, uServer power button in, on GPIO D0(24)
-gpio_export D0
-
-# PWR_SLOT1_BTN_N, 1S Server power out, on GPIO D3
-# GPIOD3(27): SCU90[1], SCU8C[9], and SCU70[21] shall be 0
-devmem_clear_bit $(scu_addr 90) 1
-devmem_clear_bit $(scu_addr 8c) 9
-devmem_clear_bit $(scu_addr 70) 21
-
-gpio_set D3 1
-
-# PWR_SLOT2_BTN_N, 1S Server power out, on GPIO D1
-# Make sure the Power Control Pin is Set properly
-# GPIOD1(25): SCU90[1], SCU8C[8], and SCU70[21] shall be 0
-
-devmem_clear_bit $(scu_addr 8c) 8
-
-gpio_set D1 1
-
-# PWR_SLOT3_BTN_N, 1S Server power out, on GPIO D7
-# GPIOD7(31): SCU90[1], SCU8C[11], and SCU70[21] shall be 0
-devmem_clear_bit $(scu_addr 8c) 11
-
-gpio_set D7 1
-
-# PWR_SLOT4_BTN_N, 1S Server power out, on GPIO D5
-# GPIOD5(29): SCU90[1], SCU8C[10], and SCU70[21] shall be 0
-devmem_clear_bit $(scu_addr 8c) 10
-
-gpio_set D5 1
-
-# SMB_SLOT0_NIC_ALERT_N, alert for 1S Server NIC I2C, GPIO B0
-devmem_clear_bit $(scu_addr 80) 8
-
-gpio_export B0
-
-# Enable P3V3: GPIOS1(145)
-# To use GPIOS1 (145), SCU8C[1], SCU94[0], and SCU94[1] must be 0
-devmem_clear_bit $(scu_addr 8C) 1
-devmem_clear_bit $(scu_addr 94) 0
-devmem_clear_bit $(scu_addr 94) 1
-
-gpio_set S1 1
-
-# PWRGD_P3V3: GPIOS2(146)
-# To use GPIOS2 (146), SCU8C[2], SCU94[0], and SCU94[1] must be 0
-devmem_clear_bit $(scu_addr 8C) 2
-devmem_clear_bit $(scu_addr 94) 0
-devmem_clear_bit $(scu_addr 94) 1
-
-# Setup GPIOs to Mux Enable: GPIOS3(147), Channel Select: GPIOE4(36), GPIOE5(37)
-
-# To use GPIOS3 (147), SCU8C[3], SCU94[0], and SCU94[1] must be 0
-devmem_clear_bit $(scu_addr 8C) 3
-devmem_clear_bit $(scu_addr 94) 0
-devmem_clear_bit $(scu_addr 94) 1
-
-# To use GPIOE4 (36), SCU80[20], SCU8C[14], and SCU70[22] must be 0
-devmem_clear_bit $(scu_addr 80) 20
-devmem_clear_bit $(scu_addr 8C) 14
-devmem_clear_bit $(scu_addr 70) 22
-
-# To use GPIOE5 (37), SCU80[21], SCU8C[14], and SCU70[22] must be 0
-devmem_clear_bit $(scu_addr 80) 21
-devmem_clear_bit $(scu_addr 8C) 14
-devmem_clear_bit $(scu_addr 70) 22
-
-gpio_set S3 0
-gpio_set E4 1
-gpio_set E5 0
-
-# BMC_HEARTBEAT_N, heartbeat LED, GPIO Q7(135)
-devmem_clear_bit $(scu_addr 90) 28
-
-gpio_export Q7
-
-# USB_OC_N, resettable fuse tripped, GPIO Q6
-devmem_clear_bit $(scu_addr 90) 28
-
-gpio_export Q6
-
-# System SPI
-# Strap 12 must be 0 and Strape 13 must be 1
-devmem_clear_bit $(scu_addr 70) 12
-devmem_set_bit $(scu_addr 70) 13
-
-# DEBUG_PORT_UART_SEL_BMC_N: GPIOR1(137)
-# To use GPIOR1, SCU88[25] must be 0
-devmem_clear_bit $(scu_addr 88) 25
-
-gpio_export R1
-
-# DEBUG UART Controls
-# 4 signals: DEBUG_UART_SEL_0/1/2 and DEBUG_UART_RX_SEL_N
-# GPIOE0 (32), GPIOE1 (33), GPIOE2 (34) and GPIOE3 (35)
-
-# To enable GPIOE0, SCU80[16], SCU8C[12], and SCU70[22] must be 0
-devmem_clear_bit $(scu_addr 80) 16
-devmem_clear_bit $(scu_addr 8C) 12
-devmem_clear_bit $(scu_addr 70) 22
-
-gpio_set E0 0
-
-# To enable GPIOE1, SCU80[17], SCU8C[12], and SCU70[22] must be 0
-devmem_clear_bit $(scu_addr 80) 17
-
-gpio_set E1 0
-
-# To enable GPIOE2, SCU80[18], SCU8C[13], and SCU70[22] must be 0
-devmem_clear_bit $(scu_addr 80) 18
-devmem_clear_bit $(scu_addr 8C) 13
-
-gpio_set E2 1
-
-# To enable GPIOE3, SCU80[19], SCU8C[13], and SCU70[22] must be 0
-devmem_clear_bit $(scu_addr 80) 19
-
-gpio_set E3 1
-
-# Enable GPIOY3: BoardId(Yosemite or Test system)
-devmem_clear_bit $(scu_addr a4) 11
-
-# Power LED for Slot#2:
-# To use GPIOM0 (96), SCU90[4], SCU90[5], and SCU84[24] must be 0
-devmem_clear_bit $(scu_addr 90) 4
-devmem_clear_bit $(scu_addr 90) 5
-devmem_clear_bit $(scu_addr 84) 24
-
-gpio_set M0 1
-
-# Power LED for Slot#1:
-# To use GPIOM1 (97), SCU90[4], SCU90[5], and SCU84[25] must be 0
-devmem_clear_bit $(scu_addr 84) 25
-
-gpio_set M1 1
-
-# Power LED for Slot#4:
-# To use GPIOM2 (98), SCU90[4], SCU90[5], and SCU84[26] must be 0
-devmem_clear_bit $(scu_addr 84) 26
-
-gpio_set M2 1
-
-# Power LED for Slot#3:
-# To use GPIOM3 (99), SCU90[4], SCU90[5], and SCU84[27] must be 0
-devmem_clear_bit $(scu_addr 84) 27
-
-gpio_set M3 1
-
-
-# Identify LED for Slot#2:
-# To use GPIOF0 (40), SCU80[24] must be 0
-devmem_clear_bit $(scu_addr 80) 24
-
-gpio_set F0 1
-
-# Identify LED for Slot#1:
-# To use GPIOF1 (41), SCU80[25], SCUA4[12], must be 0
-devmem_clear_bit $(scu_addr 80) 25
-devmem_clear_bit $(scu_addr A4) 12
-
-gpio_set F1 1
-
-# Identify LED for Slot#4:
-# To use GPIOF2 (42), SCU80[26], SCUA4[13], must be 0
-devmem_clear_bit $(scu_addr 80) 26
-devmem_clear_bit $(scu_addr A4) 13
-
-gpio_set F2 1
-
-# Identify LED for Slot#3:
-# To use GPIOF3 (43), SCU80[27], SCUA4[14], must be 0
-devmem_clear_bit $(scu_addr 80) 27
-devmem_clear_bit $(scu_addr A4) 14
-
-gpio_set F3 1
-
-# Front Panel Hand Switch GPIO setup
-# HAND_SW_ID1: GPIOR2(138)
-# To use GPIOR2, SCU88[26] must be 0
-devmem_clear_bit $(scu_addr 88) 26
-
-gpio_export R2
-
-# HAND_SW_ID2: GPIOR3(139)
-# To use GPIOR3, SCU88[27] must be 0
-devmem_clear_bit $(scu_addr 88) 27
-
-gpio_export R3
-
-# HAND_SW_ID4: GPIOR4(140)
-# To use GPIOR4, SCU88[28] must be 0
-devmem_clear_bit $(scu_addr 88) 28
-
-gpio_export R4
-
-
-# HAND_SW_ID8: GPIOR5(141)
-# To use GPIOR5, SCU88[29] must be 0
-devmem_clear_bit $(scu_addr 88) 29
-
-gpio_export R5
-
-# LED POST CODES: 8 GPIO signals
-
-# LED_POSTCODE_0: GPIOG0 (48)
-# To use GPIOG0, SCU84[0] must be 0
-devmem_clear_bit $(scu_addr 84) 0
-
-gpio_set G0 0
-
-# LED_POSTCODE_1: GPIOG1 (49)
-# To use GPIOG1, SCU84[1] must be 0
-devmem_clear_bit $(scu_addr 84) 1
-
-gpio_set G1 0
-
-# LED_POSTCODE_2: GPIOG2 (50)
-# To use GPIOG2, SCU84[2] must be 0
-devmem_clear_bit $(scu_addr 84) 2
-
-gpio_set G2 0
-
-# LED_POSTCODE_3: GPIOG3 (51)
-# To use GPIOG3, SCU84[3] must be 0
-devmem_clear_bit $(scu_addr 84) 3
-
-gpio_set G3 0
-
-# LED_POSTCODE_4: GPIOP4 (124)
-gpio_set P4 0
-
-# LED_POSTCODE_5: GPIOP5 (125)
-gpio_set P5 0
-
-# LED_POSTCODE_6: GPIOP6 (126)
-# To use GPIOP6, SCU88[22] must be 0
-devmem_clear_bit $(scu_addr 88) 22
-
-gpio_set P6 0
-
-# LED_POSTCODE_7: GPIOP7 (127)
-# To use GPIOP7, SCU88[23] must be 0
-devmem_clear_bit $(scu_addr 88) 23
-
-gpio_set P7 0
-
-# BMC_READY_N: GPIOG6 (54)
-# To use GPIOG6, SCU84[6] must be 0
-devmem_clear_bit $(scu_addr 84) 6
-
-gpio_set G6 0
-
-# BMC_RST_BTN_IN_N: GPIOS0 (144)
-# To use GPIOS0, SCU8C[0]
-devmem_clear_bit $(scu_addr 8c) 0
-
-gpio_export S0
-
-# RESET for all Slots
-# RST_SLOT1_SYS_RESET_N: GPIOH1 (57)
-# To use GPIOH1, SCU90[6], SCU90[7] must be 0
-devmem_clear_bit $(scu_addr 90) 6
-devmem_clear_bit $(scu_addr 90) 7
-
-gpio_set H1 1
-
-# RST_SLOT2_SYS_RESET_N: GPIOH0 (56)
-# To use GPIOH0, SCU90[6], SCU90[7] must be 0
-gpio_set H0 1
-
-# RST_SLOT3_SYS_RESET_N: GPIOH3 (59)
-# To use GPIOH3, SCU90[6], SCU90[7] must be 0
-gpio_set H3 1
-
-# RST_SLOT4_SYS_RESET_N: GPIOH2 (58)
-# To use GPIOH2, SCU90[6], SCU90[7] must be 0
-gpio_set H2 1
-
-# 12V_STBY Enable for Slots
-
-# P12V_STBY_SLOT1_EN: GPIOO5 (117)
-# To use GPIOO5, SCU88[13] must be 0
-devmem_clear_bit $(scu_addr 88) 13
-
-gpio_set O5 1
-
-# P12V_STBY_SLOT2_EN: GPIOO4 (116)
-# To use GPIOO4, SCU88[12] must be 0
-devmem_clear_bit $(scu_addr 88) 12
-
-gpio_set O4 1
-
-# P12V_STBY_SLOT3_EN: GPIOO7 (119)
-# To use GPIOO7, SCU88[15] must be 0
-devmem_clear_bit $(scu_addr 88) 15
-
-gpio_set O7 1
-
-# P12V_STBY_SLOT4_EN: GPIOO6 (118)
-# To use GPIOO6, SCU88[13] must be 0
-devmem_clear_bit $(scu_addr 88) 14
-
-gpio_set O6 1
-
-# PWRGD_P12V_STBY_SLOT1: GPIOP1 (121)
-# To use GPIOP1, SCU88[17] must be 0
-devmem_clear_bit $(scu_addr 88) 17
-gpio_export P1
-
-# PWRGD_P12V_STBY_SLOT2: GPIOP0 (120)
-# To use GPIOP0, SCU88[16] must be 0
-devmem_clear_bit $(scu_addr 88) 16
-gpio_export P0
-
-# PWRGD_P12V_STBY_SLOT3: GPIOP3 (123)
-# To use GPIOP3, SCU88[19] must be 0
-devmem_clear_bit $(scu_addr 88) 19
-gpio_export P3
-
-# PWRGD_P12V_STBY_SLOT4: GPIOP2 (122)
-# To use GPIOP2, SCU88[18] must be 0
-devmem_clear_bit $(scu_addr 88) 18
-gpio_export P2
-
-# TODO: Enable this pin after the HW issue is fixed
-# Enable the the EXTRST functionality of GPIOB7
-#devmem_set_bit $(scu_addr 80) 15
-#devmem_clear_bit $(scu_addr 90) 31
-#devmem_set_bit $(scu_addr 3c) 3
diff --git a/meta-facebook/meta-yosemite/recipes-yosemite/fbutils/files/setup_rov.sh b/meta-facebook/meta-yosemite/recipes-yosemite/fbutils/files/setup_rov.sh
deleted file mode 100755
index 749fe65..0000000
--- a/meta-facebook/meta-yosemite/recipes-yosemite/fbutils/files/setup_rov.sh
+++ /dev/null
@@ -1,99 +0,0 @@
-#!/bin/bash
-#
-# Copyright 2014-present Facebook. All Rights Reserved.
-#
-# This program file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program in a file named COPYING; if not, write to the
-# Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor,
-# Boston, MA 02110-1301 USA
-#
-
-# The T2 chip can prefer different input voltages, depending, presumably
-# of manufacturing variations. We need to determine whether it wants
-# 0.95V or 1.025V, reset the T2 to reduce total power usage, set the
-# outgoing voltage on the first buck converter, and bring T2 up out of
-# reset.
-
-. /usr/local/fbpackages/utils/ast-functions
-
-# read the T2 ROV after the GPIOs are enabled
-t2_rov() {
- local val0 val1 val2
- # Note that the values are *not* read in order.
- val0=$(cat /sys/class/gpio/gpio58/value 2>/dev/null)
- val1=$(cat /sys/class/gpio/gpio56/value 2>/dev/null)
- val2=$(cat /sys/class/gpio/gpio57/value 2>/dev/null)
- echo $((val0 | (val1 << 1) | (val2 << 2)))
-}
-
-rov=$(t2_rov)
-
-# target_volts come from the data sheet and 18mV of loss and
-# some fudging based on actual measurements to get either 1.025V
-# or 0.95V at T2
-if [ $rov -eq 1 ]; then
- target_volts=0x5a
-elif [ $rov -eq 2 ]; then
- target_volts=0x65
-else
- echo "Unrecognized T2 ROV value $rov, setting failed."
- exit 1
-fi
-target_volts=$(( $target_volts * 1 )) # normalize to decimal
-
-# We shouldn't have to rmmod pmbus, because it hasn't been loaded yet,
-# but if the script is rerun after the system is up, it may be necessary.
-rmmod pmbus
-reload=$?
-
-# Get current voltage value
-cur_volts=$(i2cget -y 1 0x60 0x8b w)
-cur_volts=$(( $cur_volts * 1 )) # normalize to decimal
-
-# Only bounce the T2 if we actually need to modify the voltage
-if [ $cur_volts -ne $target_volts ]; then
- # Set values before turning out output; we're using "PCIE, then MCS"
- echo 1 > /sys/class/gpio/gpio42/value
- echo 1 > /sys/class/gpio/gpio43/value
- echo out > /sys/class/gpio/gpio42/direction
- echo out > /sys/class/gpio/gpio43/direction
- echo 0 > /sys/class/gpio/gpio16/value
- echo out > /sys/class/gpio/gpio16/direction
- # T2 is in reset; note that this may cause NMI messages on the uServer,
- # which shouldn't be up anyway when this is first run.
-
- # Set the requested value to the current value to avoid rapid shifts
- i2cset -y 1 0x60 0x21 $cur_volts w
- # Enable the requested voltage
- i2cset -y 1 0x60 0xd2 0x5a
- i2cset -y 1 0x60 0xd3 0x5a
- sleep 1
-
- # Set the target voltage
- i2cset -y 1 0x60 0x21 $target_volts w
-
- sleep 1
-
- # Let T2 come out of reset
- echo 1 > /sys/class/gpio/gpio16/value
- echo "T2 ROV value set based on $rov."
- sleep 2
- echo 0 > /sys/class/gpio/gpio42/value
- echo 0 > /sys/class/gpio/gpio43/value
-else
- echo "T2 ROV already correctly set."
-fi
-# Bring back pmbus if necessary
-if [ $reload -eq 0 ]; then
- modprobe pmbus
-fi
diff --git a/meta-facebook/meta-yosemite/recipes-yosemite/fbutils/files/setup_switch.py b/meta-facebook/meta-yosemite/recipes-yosemite/fbutils/files/setup_switch.py
deleted file mode 100644
index 995cec8..0000000
--- a/meta-facebook/meta-yosemite/recipes-yosemite/fbutils/files/setup_switch.py
+++ /dev/null
@@ -1,49 +0,0 @@
-#!/usr/bin/python
-#
-# Copyright 2004-present Facebook. All rights reserved.
-#
-# This program file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program in a file named COPYING; if not, write to the
-# Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor,
-# Boston, MA 02110-1301 USA
-#
-# This script combines multiple switch configuration into one python script.
-# All such configuration can be done directly through bcm5396_util.py.
-# But, it turns out it took several seconds to just start the python script.
-# Involking the script 16 times (2 to create vlan, 13 to set port vlan default,
-# and 1 to enable vlan function) contributes 1 minute delay.
-
-from bcm5396 import Bcm5396
-
-MDC_GPIO = 6
-MDIO_GPIO = 7
-
-INTERNAL_VLAN = 4088
-DEFAULT_VLAN=4090
-
-INTERNAL_PORTS = [3, 10, 1, 11, 0, 8, 2, 9, 4, 12, 14, 13]
-FRONT_PORT=5
-
-if __name__ == '__main__':
- bcm = Bcm5396(Bcm5396.MDIO_ACCESS, mdc=MDC_GPIO, mdio=MDIO_GPIO)
- # create default VLAN including internal ports and front panel
- # port (un-tagged)
- bcm.add_vlan(DEFAULT_VLAN, INTERNAL_PORTS + [FRONT_PORT],
- INTERNAL_PORTS + [FRONT_PORT], 0)
- # set ingress vlan for internal ports and front panel port to default vlan
- for port in INTERNAL_PORTS + [FRONT_PORT]:
- bcm.vlan_set_port_default(port, DEFAULT_VLAN, 0)
- # create internal vlan including internal ports only (tagged)
- bcm.add_vlan(INTERNAL_VLAN, [], INTERNAL_PORTS, 0)
- # enable vlan
- bcm.vlan_ctrl(True)
diff --git a/meta-facebook/meta-yosemite/recipes-yosemite/fbutils/files/sol-util b/meta-facebook/meta-yosemite/recipes-yosemite/fbutils/files/sol-util
deleted file mode 100755
index 3769a5b..0000000
--- a/meta-facebook/meta-yosemite/recipes-yosemite/fbutils/files/sol-util
+++ /dev/null
@@ -1,74 +0,0 @@
-#!/bin/sh
-#
-# Copyright 2014-present Facebook. All Rights Reserved.
-#
-# This program file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program in a file named COPYING; if not, write to the
-# Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor,
-# Boston, MA 02110-1301 USA
-#
-
-BIN_CONSOLED="/usr/local/bin/consoled"
-LOGFILE1="/tmp/consoled_$1_log-old"
-LOGFILE2="/tmp/consoled_$1_log"
-
-
-if [ "$1" == "slot1" ] || [ "$1" == "slot2" ] || [ "$1" == "slot3" ] || [ "$1" == "slot4" ]
-then
- SLOT=$1
-else
- echo "Usage: sol-util [ slot1 | slot2 | slot3 | slot4 ]"
- echo " sol-util [ slot1 | slot2 | slot3 | slot4 ] --force"
- echo " sol-util [ slot1 | slot2 | slot3 | slot4 ] --history"
- exit -1
-fi
-
-if [ $# -gt 1 ]; then
- if [[ "$2" == "--history" ]]; then
- cat $LOGFILE1 2>/dev/null
- cat $LOGFILE2 2>/dev/null
- exit 0
- fi
-fi
-
-PS=$(ps | grep -e $BIN_CONSOLED | grep -e $SLOT)
-
-PID=$(ps | grep -e $BIN_CONSOLED | grep -e $SLOT | awk '{print $1}')
-
-
-if [[ $PS =~ "term" ]] && [[ "$2" != "--force" ]]; then
- echo "Another SOL session is running."
- echo "Please use the \"--force\" option"
- exit -1
-fi
-
-echo "You are in SOL session."
-echo "Use ctrl-x to quit."
-echo "-----------------------"
-echo
-
-kill -9 -s TERM $PID 2>/dev/null
-
-if [[ "$2" == "--force" ]]; then
- PID=$(ps | grep -e $BIN_CONSOLED | grep -e $SLOT | awk '{print $1}')
- kill -9 -s TERM $PID 2>/dev/null
-fi
-
-$BIN_CONSOLED $SLOT --term
-
-$BIN_CONSOLED $SLOT --buffer
-
-echo
-echo
-echo "-----------------------"
-echo "Exit from SOL session."
diff --git a/meta-facebook/meta-yosemite/recipes-yosemite/fbutils/files/src/include/i2c-dev.h b/meta-facebook/meta-yosemite/recipes-yosemite/fbutils/files/src/include/i2c-dev.h
deleted file mode 100644
index 3b67afc..0000000
--- a/meta-facebook/meta-yosemite/recipes-yosemite/fbutils/files/src/include/i2c-dev.h
+++ /dev/null
@@ -1,364 +0,0 @@
-/*
- i2c-dev.h - i2c-bus driver, char device interface
-
- Copyright (C) 1995-97 Simon G. Vogl
- Copyright (C) 1998-99 Frodo Looijaard <frodol@dds.nl>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- MA 02110-1301 USA.
-*/
-
-#ifndef _LINUX_I2C_DEV_H
-#define _LINUX_I2C_DEV_H
-
-#include <linux/types.h>
-#include <sys/ioctl.h>
-#include <stddef.h>
-#include <string.h>
-
-
-/* -- i2c.h -- */
-
-#define _I2C_MIN(a, b) (((a) <= (b)) ? (a) : (b))
-
-/*
- * I2C Message - used for pure i2c transaction, also from /dev interface
- */
-struct i2c_msg {
- __u16 addr; /* slave address */
- unsigned short flags;
-#define I2C_CLIENT_PEC 0x04 /* Use Packet Error Checking */
-#define I2C_M_TEN 0x0010 /* this is a ten bit chip address */
-#define I2C_M_RD 0x0001 /* read data, from slave to master */
-#define I2C_S_EN 0x0002 /* read data, from slave to master */
-#define I2C_M_NOSTART 0x4000 /* if I2C_FUNC_PROTOCOL_MANGLING */
-#define I2C_M_REV_DIR_ADDR 0x2000 /* if I2C_FUNC_PROTOCOL_MANGLING */
-#define I2C_M_IGNORE_NAK 0x1000 /* if I2C_FUNC_PROTOCOL_MANGLING */
-#define I2C_M_NO_RD_ACK 0x0800 /* if I2C_FUNC_PROTOCOL_MANGLING */
-#define I2C_M_RECV_LEN 0x0400 /* length will be first received byte */
- short len; /* msg length */
- char *buf; /* pointer to msg data */
-};
-
-/* To determine what functionality is present */
-
-#define I2C_FUNC_I2C 0x00000001
-#define I2C_FUNC_10BIT_ADDR 0x00000002
-#define I2C_FUNC_PROTOCOL_MANGLING 0x00000004 /* I2C_M_{REV_DIR_ADDR,NOSTART,..} */
-#define I2C_FUNC_SMBUS_PEC 0x00000008
-#define I2C_FUNC_SMBUS_BLOCK_PROC_CALL 0x00008000 /* SMBus 2.0 */
-#define I2C_FUNC_SMBUS_QUICK 0x00010000
-#define I2C_FUNC_SMBUS_READ_BYTE 0x00020000
-#define I2C_FUNC_SMBUS_WRITE_BYTE 0x00040000
-#define I2C_FUNC_SMBUS_READ_BYTE_DATA 0x00080000
-#define I2C_FUNC_SMBUS_WRITE_BYTE_DATA 0x00100000
-#define I2C_FUNC_SMBUS_READ_WORD_DATA 0x00200000
-#define I2C_FUNC_SMBUS_WRITE_WORD_DATA 0x00400000
-#define I2C_FUNC_SMBUS_PROC_CALL 0x00800000
-#define I2C_FUNC_SMBUS_READ_BLOCK_DATA 0x01000000
-#define I2C_FUNC_SMBUS_WRITE_BLOCK_DATA 0x02000000
-#define I2C_FUNC_SMBUS_READ_I2C_BLOCK 0x04000000 /* I2C-like block xfer */
-#define I2C_FUNC_SMBUS_WRITE_I2C_BLOCK 0x08000000 /* w/ 1-byte reg. addr. */
-
-#define I2C_FUNC_SMBUS_BYTE (I2C_FUNC_SMBUS_READ_BYTE | \
- I2C_FUNC_SMBUS_WRITE_BYTE)
-#define I2C_FUNC_SMBUS_BYTE_DATA (I2C_FUNC_SMBUS_READ_BYTE_DATA | \
- I2C_FUNC_SMBUS_WRITE_BYTE_DATA)
-#define I2C_FUNC_SMBUS_WORD_DATA (I2C_FUNC_SMBUS_READ_WORD_DATA | \
- I2C_FUNC_SMBUS_WRITE_WORD_DATA)
-#define I2C_FUNC_SMBUS_BLOCK_DATA (I2C_FUNC_SMBUS_READ_BLOCK_DATA | \
- I2C_FUNC_SMBUS_WRITE_BLOCK_DATA)
-#define I2C_FUNC_SMBUS_I2C_BLOCK (I2C_FUNC_SMBUS_READ_I2C_BLOCK | \
- I2C_FUNC_SMBUS_WRITE_I2C_BLOCK)
-
-/* Old name, for compatibility */
-#define I2C_FUNC_SMBUS_HWPEC_CALC I2C_FUNC_SMBUS_PEC
-
-/*
- * Data for SMBus Messages
- */
-#define I2C_SMBUS_BLOCK_MAX 32 /* As specified in SMBus standard */
-#define I2C_SMBUS_I2C_BLOCK_MAX 32 /* Not specified but we use same structure */
-union i2c_smbus_data {
- __u8 byte;
- __u16 word;
- __u8 block[I2C_SMBUS_BLOCK_MAX + 2]; /* block[0] is used for length */
- /* and one more for PEC */
-};
-
-#define I2C_SMBUS_BLOCK_LARGE_MAX 240
-union i2c_smbus_large_data {
- union i2c_smbus_data data;
- __u8 block[I2C_SMBUS_BLOCK_LARGE_MAX + 2]; /* block[0] is used for length */
- /* and one more for PEC */
-};
-
-/* smbus_access read or write markers */
-#define I2C_SMBUS_READ 1
-#define I2C_SMBUS_WRITE 0
-
-/* SMBus transaction types (size parameter in the above functions)
- Note: these no longer correspond to the (arbitrary) PIIX4 internal codes! */
-#define I2C_SMBUS_QUICK 0
-#define I2C_SMBUS_BYTE 1
-#define I2C_SMBUS_BYTE_DATA 2
-#define I2C_SMBUS_WORD_DATA 3
-#define I2C_SMBUS_PROC_CALL 4
-#define I2C_SMBUS_BLOCK_DATA 5
-#define I2C_SMBUS_I2C_BLOCK_BROKEN 6
-#define I2C_SMBUS_BLOCK_PROC_CALL 7 /* SMBus 2.0 */
-#define I2C_SMBUS_I2C_BLOCK_DATA 8
-#define I2C_SMBUS_BLOCK_LARGE_DATA 9
-
-
-/* /dev/i2c-X ioctl commands. The ioctl's parameter is always an
- * unsigned long, except for:
- * - I2C_FUNCS, takes pointer to an unsigned long
- * - I2C_RDWR, takes pointer to struct i2c_rdwr_ioctl_data
- * - I2C_SMBUS, takes pointer to struct i2c_smbus_ioctl_data
- */
-#define I2C_RETRIES 0x0701 /* number of times a device address should
- be polled when not acknowledging */
-#define I2C_TIMEOUT 0x0702 /* set timeout in units of 10 ms */
-
-/* NOTE: Slave address is 7 or 10 bits, but 10-bit addresses
- * are NOT supported! (due to code brokenness)
- */
-#define I2C_SLAVE 0x0703 /* Use this slave address */
-#define I2C_SLAVE_FORCE 0x0706 /* Use this slave address, even if it
- is already in use by a driver! */
-#define I2C_TENBIT 0x0704 /* 0 for 7 bit addrs, != 0 for 10 bit */
-
-#define I2C_FUNCS 0x0705 /* Get the adapter functionality mask */
-
-#define I2C_RDWR 0x0707 /* Combined R/W transfer (one STOP only) */
-#define I2C_SLAVE_RDWR 0x0709 /* Slave Read/Write */
-
-#define I2C_PEC 0x0708 /* != 0 to use PEC with SMBus */
-#define I2C_SMBUS 0x0720 /* SMBus transfer */
-
-
-/* This is the structure as used in the I2C_SMBUS ioctl call */
-struct i2c_smbus_ioctl_data {
- __u8 read_write;
- __u8 command;
- __u32 size;
- union i2c_smbus_data *data;
-};
-
-/* This is the structure as used in the I2C_RDWR ioctl call */
-struct i2c_rdwr_ioctl_data {
- struct i2c_msg *msgs; /* pointers to i2c_msgs */
- __u32 nmsgs; /* number of i2c_msgs */
-};
-
-#define I2C_RDRW_IOCTL_MAX_MSGS 42
-
-
-static inline __s32 i2c_smbus_access(int file, char read_write, __u8 command,
- int size, union i2c_smbus_data *data)
-{
- struct i2c_smbus_ioctl_data args;
-
- args.read_write = read_write;
- args.command = command;
- args.size = size;
- args.data = data;
- return ioctl(file,I2C_SMBUS,&args);
-}
-
-
-static inline __s32 i2c_smbus_write_quick(int file, __u8 value)
-{
- return i2c_smbus_access(file,value,0,I2C_SMBUS_QUICK,NULL);
-}
-
-static inline __s32 i2c_smbus_read_byte(int file)
-{
- union i2c_smbus_data data;
- if (i2c_smbus_access(file,I2C_SMBUS_READ,0,I2C_SMBUS_BYTE,&data))
- return -1;
- else
- return 0x0FF & data.byte;
-}
-
-static inline __s32 i2c_smbus_write_byte(int file, __u8 value)
-{
- return i2c_smbus_access(file,I2C_SMBUS_WRITE,value,
- I2C_SMBUS_BYTE,NULL);
-}
-
-static inline __s32 i2c_smbus_read_byte_data(int file, __u8 command)
-{
- union i2c_smbus_data data;
- if (i2c_smbus_access(file,I2C_SMBUS_READ,command,
- I2C_SMBUS_BYTE_DATA,&data))
- return -1;
- else
- return 0x0FF & data.byte;
-}
-
-static inline __s32 i2c_smbus_write_byte_data(int file, __u8 command,
- __u8 value)
-{
- union i2c_smbus_data data;
- data.byte = value;
- return i2c_smbus_access(file,I2C_SMBUS_WRITE,command,
- I2C_SMBUS_BYTE_DATA, &data);
-}
-
-static inline __s32 i2c_smbus_read_word_data(int file, __u8 command)
-{
- union i2c_smbus_data data;
- if (i2c_smbus_access(file,I2C_SMBUS_READ,command,
- I2C_SMBUS_WORD_DATA,&data))
- return -1;
- else
- return 0x0FFFF & data.word;
-}
-
-static inline __s32 i2c_smbus_write_word_data(int file, __u8 command,
- __u16 value)
-{
- union i2c_smbus_data data;
- data.word = value;
- return i2c_smbus_access(file,I2C_SMBUS_WRITE,command,
- I2C_SMBUS_WORD_DATA, &data);
-}
-
-static inline __s32 i2c_smbus_process_call(int file, __u8 command, __u16 value)
-{
- union i2c_smbus_data data;
- data.word = value;
- if (i2c_smbus_access(file,I2C_SMBUS_WRITE,command,
- I2C_SMBUS_PROC_CALL,&data))
- return -1;
- else
- return 0x0FFFF & data.word;
-}
-
-
-/* Returns the number of read bytes */
-static inline __s32 i2c_smbus_read_block_data(int file, __u8 command,
- __u8 *values)
-{
- union i2c_smbus_data data;
- if (i2c_smbus_access(file,I2C_SMBUS_READ,command,
- I2C_SMBUS_BLOCK_DATA,&data))
- return -1;
- else {
- memcpy(values, &data.block[1], _I2C_MIN(data.block[0], I2C_SMBUS_BLOCK_MAX));
- return data.block[0];
- }
-}
-
-static inline __s32 i2c_smbus_write_block_data(int file, __u8 command,
- __u8 length, const __u8 *values)
-{
- union i2c_smbus_data data;
- if (length > 32)
- length = 32;
- memcpy(&data.block[1], values, length);
- data.block[0] = length;
- return i2c_smbus_access(file,I2C_SMBUS_WRITE,command,
- I2C_SMBUS_BLOCK_DATA, &data);
-}
-
-static inline __s32 i2c_smbus_read_block_large_data(int file, __u8 command,
- __u8 *values)
-{
- union i2c_smbus_large_data data;
- if (i2c_smbus_access(file, I2C_SMBUS_READ, command,
- I2C_SMBUS_BLOCK_LARGE_DATA,
- (union i2c_smbus_data *)&data)) {
- return -1;
- } else {
- /* the first byte is the length which is not copied */
- memcpy(values, &data.block[1], _I2C_MIN(data.block[0], I2C_SMBUS_BLOCK_LARGE_MAX));
- return data.block[0];
- }
-}
-
-static inline __s32 i2c_smbus_write_block_large_data(int file, __u8 command,
- __u8 length,
- const __u8 *values)
-{
- union i2c_smbus_large_data data;
- if (length > I2C_SMBUS_BLOCK_LARGE_MAX) {
- length = I2C_SMBUS_BLOCK_LARGE_MAX;
- }
- data.block[0] = length;
- memcpy(&data.block[1], values, length);
- return i2c_smbus_access(file, I2C_SMBUS_WRITE, command,
- I2C_SMBUS_BLOCK_LARGE_DATA,
- (union i2c_smbus_data *)&data);
-}
-
-/* Returns the number of read bytes */
-/* Until kernel 2.6.22, the length is hardcoded to 32 bytes. If you
- ask for less than 32 bytes, your code will only work with kernels
- 2.6.23 and later. */
-static inline __s32 i2c_smbus_read_i2c_block_data(int file, __u8 command,
- __u8 length, __u8 *values)
-{
- union i2c_smbus_data data;
-
- if (length > 32)
- length = 32;
- data.block[0] = length;
- if (i2c_smbus_access(file,I2C_SMBUS_READ,command,
- length == 32 ? I2C_SMBUS_I2C_BLOCK_BROKEN :
- I2C_SMBUS_I2C_BLOCK_DATA,&data))
- return -1;
- else {
- memcpy(values, &data.block[1], _I2C_MIN(data.block[0], I2C_SMBUS_BLOCK_MAX));
- return data.block[0];
- }
-}
-
-static inline __s32 i2c_smbus_write_i2c_block_data(int file, __u8 command,
- __u8 length,
- const __u8 *values)
-{
- union i2c_smbus_data data;
- if (length > 32)
- length = 32;
- memcpy(&data.block[1], values, length);
- data.block[0] = length;
- return i2c_smbus_access(file,I2C_SMBUS_WRITE,command,
- I2C_SMBUS_I2C_BLOCK_BROKEN, &data);
-}
-
-/* Returns the number of read bytes */
-static inline __s32 i2c_smbus_block_process_call(int file, __u8 command,
- __u8 length, __u8 *values)
-{
- union i2c_smbus_data data;
- if (length > 32)
- length = 32;
- memcpy(&data.block[1], values, length);
- data.block[0] = length;
- if (i2c_smbus_access(file,I2C_SMBUS_WRITE,command,
- I2C_SMBUS_BLOCK_PROC_CALL,&data))
- return -1;
- else {
- memcpy(values, &data.block[1], _I2C_MIN(data.block[0], I2C_SMBUS_BLOCK_MAX));
- return data.block[0];
- }
-}
-
-#undef _I2C_MIN
-
-#endif /* _LINUX_I2C_DEV_H */
diff --git a/meta-facebook/meta-yosemite/recipes-yosemite/fbutils/files/src/include/log.h b/meta-facebook/meta-yosemite/recipes-yosemite/fbutils/files/src/include/log.h
deleted file mode 100644
index a69d69e..0000000
--- a/meta-facebook/meta-yosemite/recipes-yosemite/fbutils/files/src/include/log.h
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Copyright 2014-present Facebook. All Rights Reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-#ifndef LOG_H
-#define LOG_H
-
-#include <stdio.h>
-#include <string.h>
-
-//#define DEBUG
-//#define VERBOSE
-
-#define _LOG(dst, fmt, ...) do { \
- fprintf(dst, "%s:%d " fmt "\n", \
- __FUNCTION__, __LINE__, ##__VA_ARGS__); \
- fflush(dst); \
-} while(0)
-
-#define LOG_ERR(err, fmt, ...) do { \
- char buf[128]; \
- strerror_r(err, buf, sizeof(buf)); \
- _LOG(stderr, "ERROR " fmt ": %s", ##__VA_ARGS__, buf); \
-} while(0)
-
-#define LOG_INFO(fmt, ...) do { \
- _LOG(stdout, fmt, ##__VA_ARGS__); \
-} while(0)
-
-#ifdef DEBUG
-#define LOG_DBG(fmt, ...) do { \
- _LOG(stdout, fmt, ##__VA_ARGS__); \
-} while(0)
-#else
-#define LOG_DBG(fmt, ...)
-#endif
-
-#ifdef VERBOSE
-#define LOG_VER(fmt, ...) do { \
- _LOG(stdout, fmt, ##__VA_ARGS__); \
-} while(0)
-#else
-#define LOG_VER(fmt, ...)
-#endif
-
-#endif
diff --git a/meta-facebook/meta-yosemite/recipes-yosemite/fbutils/files/us_console.sh b/meta-facebook/meta-yosemite/recipes-yosemite/fbutils/files/us_console.sh
deleted file mode 100755
index 1672acd..0000000
--- a/meta-facebook/meta-yosemite/recipes-yosemite/fbutils/files/us_console.sh
+++ /dev/null
@@ -1,41 +0,0 @@
-#!/bin/sh
-#
-# Copyright 2014-present Facebook. All Rights Reserved.
-#
-# This program file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program in a file named COPYING; if not, write to the
-# Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor,
-# Boston, MA 02110-1301 USA
-#
-
-usage() {
- echo "$0 <connect | disconnect>"
-}
-
-. /usr/local/fbpackages/utils/ast-functions
-
-if [ $# -ne 1 ]; then
- usage
- exit 1
-fi
-
-if [ "$1" == "connect" ]; then
- VALUE=1
-elif [ "$1" == "disconnect" ]; then
- VALUE=0
-else
- usage
- exit 1
-fi
-
-gpio_set 32 $VALUE
diff --git a/meta-facebook/meta-yosemite/recipes-yosemite/fbutils/files/watch-fc.sh b/meta-facebook/meta-yosemite/recipes-yosemite/fbutils/files/watch-fc.sh
deleted file mode 100755
index d04b7cd..0000000
--- a/meta-facebook/meta-yosemite/recipes-yosemite/fbutils/files/watch-fc.sh
+++ /dev/null
@@ -1,34 +0,0 @@
-#!/bin/bash
-#
-# Copyright 2014-present Facebook. All Rights Reserved.
-#
-# This program file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program in a file named COPYING; if not, write to the
-# Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor,
-# Boston, MA 02110-1301 USA
-#
-
-. /usr/local/fbpackages/utils/ast-functions
-
-MAC1LINK=0 # GPIOA0
-FAB0_PRES=20 # GPIOC4
-FAB1_PRES=21 # GPIOC5
-while true; do
- # fabN_pres: active low.
- if [ $(gpio_get $FAB0_PRES) = 0 ]; then
- gpio_set $MAC1LINK 0
- elif [ $(gpio_get $FAB1_PRES) = 0 ]; then
- gpio_set $MAC1LINK 1
- fi
- sleep 1
-done
diff --git a/meta-facebook/meta-yosemite/recipes-yosemite/fbutils/files/wedge_us_mac.sh b/meta-facebook/meta-yosemite/recipes-yosemite/fbutils/files/wedge_us_mac.sh
deleted file mode 100644
index 34b8e59..0000000
--- a/meta-facebook/meta-yosemite/recipes-yosemite/fbutils/files/wedge_us_mac.sh
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/bin/bash
-#
-# Copyright 2014-present Facebook. All Rights Reserved.
-#
-# This program file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program in a file named COPYING; if not, write to the
-# Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor,
-# Boston, MA 02110-1301 USA
-#
-
-PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin
-
-mac=$(i2cdump -y 0x0 0x49 s 0xd4 | grep '^00: d4'| awk '{ print $3":"$4":"$5":"$6":"$7":"$8 }') 2>/dev/null
-
-if [ -n "$mac" ]; then
- echo $mac
-else
- echo "Cannot find out the microserver MAC" 1>&2
-fi
diff --git a/meta-facebook/meta-yosemite/recipes-yosemite/fbutils/files/yosemite-sensors/Makefile b/meta-facebook/meta-yosemite/recipes-yosemite/fbutils/files/yosemite-sensors/Makefile
deleted file mode 100644
index 2bc9721..0000000
--- a/meta-facebook/meta-yosemite/recipes-yosemite/fbutils/files/yosemite-sensors/Makefile
+++ /dev/null
@@ -1,10 +0,0 @@
-# Copyright 2015-present Facebook. All Rights Reserved.
-all: yosemite-sensors
-
-yosemite-sensors: yosemite-sensors.c
- $(CC) -lyosemite_sensor -std=c99 -o $@ $^ $(LDFLAGS)
-
-.PHONY: clean
-
-clean:
- rm -rf *.o yosemite-sensors
diff --git a/meta-facebook/meta-yosemite/recipes-yosemite/fbutils/files/yosemite-sensors/yosemite-sensors.c b/meta-facebook/meta-yosemite/recipes-yosemite/fbutils/files/yosemite-sensors/yosemite-sensors.c
deleted file mode 100644
index 8eb772b..0000000
--- a/meta-facebook/meta-yosemite/recipes-yosemite/fbutils/files/yosemite-sensors/yosemite-sensors.c
+++ /dev/null
@@ -1,405 +0,0 @@
-/*
- * yosemite-sensors
- *
- * Copyright 2015-present Facebook. All Rights Reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <errno.h>
-#include <syslog.h>
-#include <stdint.h>
-#include <pthread.h>
-#include <facebook/bic.h>
-#include <openbmc/ipmi.h>
-#include <facebook/yosemite_sensor.h>
-
-int
-main(int argc, char **argv) {
- int value;
- float fvalue;
- uint8_t slot_id;
-
- slot_id = atoi(argv[1]);
-
- if (yosemite_sensor_read(slot_id, SP_SENSOR_INLET_TEMP, &fvalue)) {
- printf("yosemite_sensor_read failed: SP_SENSOR_INLET_TEMP\n");
- } else {
- printf("SP_SENSOR_INLET_TEMP: %.2f C\n", fvalue);
- }
-
- if (yosemite_sensor_read(slot_id, SP_SENSOR_OUTLET_TEMP, &fvalue)) {
- printf("yosemite_sensor_read failed: SP_SENSOR_OUTLET_TEMP\n");
- } else {
- printf("SP_SENSOR_OUTLET_TEMP: %.2f C\n", fvalue);
- }
-
- if (yosemite_sensor_read(slot_id, SP_SENSOR_FAN0_TACH, &value)) {
- printf("yosemite_sensor_read failed: SP_SENSOR_FAN0_TACH\n");
- } else {
- printf("SP_SENSOR_FAN0_TACH: %d rpm\n", value);
- }
-
- if (yosemite_sensor_read(slot_id, SP_SENSOR_FAN1_TACH, &value)) {
- printf("yosemite_sensor_read failed: SP_SENSOR_FAN1_TACH\n");
- } else {
- printf("SP_SENSOR_FAN1_TACH: %d rpm\n", value);
- }
-
- if (yosemite_sensor_read(slot_id, SP_SENSOR_P5V, &fvalue)) {
- printf("yosemite_sensor_read failed: SP_SENSOR_P5V\n");
- } else {
- printf("SP_SENSOR_P5V: %.2f Volts\n", fvalue);
- }
-
- if (yosemite_sensor_read(slot_id, SP_SENSOR_P12V, &fvalue)) {
- printf("yosemite_sensor_read failed: SP_SENSOR_P12V\n");
- } else {
- printf("SP_SENSOR_P12V: %.2f Volts\n", fvalue);
- }
-
- if (yosemite_sensor_read(slot_id, SP_SENSOR_P3V3_STBY, &fvalue)) {
- printf("yosemite_sensor_read failed: SP_SENSOR_P3V3_STBY\n");
- } else {
- printf("SP_SENSOR_P3V3_STBY: %.2f Volts\n", fvalue);
- }
-
- if (yosemite_sensor_read(slot_id, SP_SENSOR_P12V_SLOT1, &fvalue)) {
- printf("yosemite_sensor_read failed: SP_SENSOR_P12V_SLOT1\n");
- } else {
- printf("SP_SENSOR_P12V_SLOT1: %.2f Volts\n", fvalue);
- }
-
- if (yosemite_sensor_read(slot_id, SP_SENSOR_P12V_SLOT2, &fvalue)) {
- printf("yosemite_sensor_read failed: SP_SENSOR_P12V_SLOT2\n");
- } else {
- printf("SP_SENSOR_P12V_SLOT2: %.2f Volts\n", fvalue);
- }
-
- if (yosemite_sensor_read(slot_id, SP_SENSOR_P12V_SLOT3, &fvalue)) {
- printf("yosemite_sensor_read failed: SP_SENSOR_P12V_SLOT3\n");
- } else {
- printf("SP_SENSOR_P12V_SLOT3: %.2f Volts\n", fvalue);
- }
-
- if (yosemite_sensor_read(slot_id, SP_SENSOR_P12V_SLOT4, &fvalue)) {
- printf("yosemite_sensor_read failed: SP_SENSOR_P12V_SLOT4\n");
- } else {
- printf("SP_SENSOR_P12V_SLOT4: %.2f Volts\n", fvalue);
- }
-
- if (yosemite_sensor_read(slot_id, SP_SENSOR_P3V3, &fvalue)) {
- printf("yosemite_sensor_read failed: SP_SENSOR_P3V3\n");
- } else {
- printf("SP_SENSOR_P3V3: %.2f Volts\n", fvalue);
- }
-
- if (yosemite_sensor_read(slot_id, SP_SENSOR_HSC_IN_VOLT, &fvalue)) {
- printf("yosemite_sensor_read failed: SP_SENSOR_HSC_IN_VOLT\n");
- } else {
- printf("SP_SENSOR_HSC_IN_VOLT: %.2f Volts\n", fvalue);
- }
-
- if (yosemite_sensor_read(slot_id, SP_SENSOR_HSC_OUT_CURR, &fvalue)) {
- printf("yosemite_sensor_read failed: SP_SENSOR_HSC_OUT_CURR\n");
- } else {
- printf("SP_SENSOR_HSC_OUT_CURR: %.2f Amps\n", fvalue);
- }
-
- if (yosemite_sensor_read(slot_id, SP_SENSOR_HSC_TEMP, &fvalue)) {
- printf("yosemite_sensor_read failed: SP_SENSOR_HSC_TEMP\n");
- } else {
- printf("SP_SENSOR_P3V3: %.2f C\n", fvalue);
- }
-
- if (yosemite_sensor_read(slot_id, SP_SENSOR_HSC_IN_POWER, &fvalue)) {
- printf("yosemite_sensor_read failed: SP_SENSOR_HSC_IN_POWER\n");
- } else {
- printf("SP_SENSOR_HSC_IN_POWER: %.2f Watts\n", fvalue);
- }
-
- if (yosemite_sensor_read(slot_id, BIC_SENSOR_MB_OUTLET_TEMP, &fvalue)) {
- printf("yosemite_sensor_read failed: BIC_SENSOR_MB_OUTLET_TEMP\n");
- } else {
- printf("BIC_SENSOR_MB_OUTLET_TEMP: %.2f C\n", fvalue);
- }
-
- if (yosemite_sensor_read(slot_id, BIC_SENSOR_VCCIN_VR_TEMP, &fvalue)) {
- printf("yosemite_sensor_read failed: BIC_SENSOR_VCCIN_VR_TEMP\n");
- } else {
- printf("BIC_SENSOR_VCCIN_VR_TEMP: %.2f C\n", fvalue);
- }
-
- if (yosemite_sensor_read(slot_id, BIC_SENSOR_VCC_GBE_VR_TEMP, &fvalue)) {
- printf("yosemite_sensor_read failed: BIC_SENSOR_VCC_GBE_VR_TEMP\n");
- } else {
- printf("BIC_SENSOR_VCC_GBE_VR_TEMP: %.2f C\n", fvalue);
- }
-
- if (yosemite_sensor_read(slot_id, BIC_SENSOR_1V05PCH_VR_TEMP, &fvalue)) {
- printf("yosemite_sensor_read failed: BIC_SENSOR_1V05PCH_VR_TEMP\n");
- } else {
- printf("BIC_SENSOR_1V05PCH_VR_TEMP: %.2f C\n", fvalue);
- }
-
- if (yosemite_sensor_read(slot_id, BIC_SENSOR_SOC_TEMP, &fvalue)) {
- printf("yosemite_sensor_read failed: BIC_SENSOR_SOC_TEMP\n");
- } else {
- printf("BIC_SENSOR_SOC_TEMP: %.2f C\n", fvalue);
- }
-
- if (yosemite_sensor_read(slot_id, BIC_SENSOR_MB_INLET_TEMP, &fvalue)) {
- printf("yosemite_sensor_read failed: BIC_SENSOR_MB_INLET_TEMP\n");
- } else {
- printf("BIC_SENSOR_MB_INLET_TEMP: %.2f C\n", fvalue);
- }
-
- if (yosemite_sensor_read(slot_id, BIC_SENSOR_PCH_TEMP, &fvalue)) {
- printf("yosemite_sensor_read failed: BIC_SENSOR_PCH_TEMP\n");
- } else {
- printf("BIC_SENSOR_PCH_TEMP: %.2f C\n", fvalue);
- }
-
- if (yosemite_sensor_read(slot_id, BIC_SENSOR_SOC_THERM_MARGIN, &fvalue)) {
- printf("yosemite_sensor_read failed: BIC_SENSOR_SOC_THERM_MARGIN\n");
- } else {
- printf("BIC_SENSOR_SOC_THERM_MARGIN: %.2f C\n", fvalue);
- }
-
- if (yosemite_sensor_read(slot_id, BIC_SENSOR_VDDR_VR_TEMP, &fvalue)) {
- printf("yosemite_sensor_read failed: BIC_SENSOR_VDDR_VR_TEMP\n");
- } else {
- printf("BIC_SENSOR_VDDR_VR_TEMP: %.2f C\n", fvalue);
- }
-
- if (yosemite_sensor_read(slot_id, BIC_SENSOR_SOC_TJMAX, &fvalue)) {
- printf("yosemite_sensor_read failed: BIC_SENSOR_SOC_TJMAX\n");
- } else {
- printf("BIC_SENSOR_SOC_TJMAX: %.2f C\n", fvalue);
- }
-
- if (yosemite_sensor_read(slot_id, BIC_SENSOR_VCC_SCSUS_VR_TEMP, &fvalue)) {
- printf("yosemite_sensor_read failed: BIC_SENSOR_VCC_SCSUS_VR_TEMP\n");
- } else {
- printf("BIC_SENSOR_VCC_SCSUS_VR_TEMP: %.2f C\n", fvalue);
- }
-
- if (yosemite_sensor_read(slot_id, BIC_SENSOR_SOC_DIMMA0_TEMP, &fvalue)) {
- printf("yosemite_sensor_read failed: BIC_SENSOR_SOC_DIMMA0_TEMP\n");
- } else {
- printf("BIC_SENSOR_SOC_DIMMA0_TEMP: %.2f C\n", fvalue);
- }
-
- if (yosemite_sensor_read(slot_id, BIC_SENSOR_SOC_DIMMA1_TEMP, &fvalue)) {
- printf("yosemite_sensor_read failed: BIC_SENSOR_SOC_DIMMA1_TEMP\n");
- } else {
- printf("BIC_SENSOR_SOC_DIMMA1_TEMP: %.2f C\n", fvalue);
- }
-
- if (yosemite_sensor_read(slot_id, BIC_SENSOR_SOC_DIMMB0_TEMP, &fvalue)) {
- printf("yosemite_sensor_read failed: BIC_SENSOR_SOC_DIMMB0_TEMP\n");
- } else {
- printf("BIC_SENSOR_SOC_DIMMB0_TEMP: %.2f C\n", fvalue);
- }
-
- if (yosemite_sensor_read(slot_id, BIC_SENSOR_SOC_DIMMB1_TEMP, &fvalue)) {
- printf("yosemite_sensor_read failed: BIC_SENSOR_SOC_DIMMB1_TEMP\n");
- } else {
- printf("BIC_SENSOR_SOC_DIMMB1_TEMP: %.2f C\n", fvalue);
- }
-
- // Monolake Current Sensors
- if (yosemite_sensor_read(slot_id, BIC_SENSOR_VCC_GBE_VR_CURR, &fvalue)) {
- printf("yosemite_sensor_read failed: BIC_SENSOR_VCC_GBE_VR_CURR\n");
- } else {
- printf("BIC_SENSOR_VCC_GBE_VR_CURR: %.2f Amps\n", fvalue);
- }
-
- if (yosemite_sensor_read(slot_id, BIC_SENSOR_1V05_PCH_VR_CURR, &fvalue)) {
- printf("yosemite_sensor_read failed: BIC_SENSOR_1V05_PCH_VR_CURR\n");
- } else {
- printf("BIC_SENSOR_1V05_PCH_VR_CURR: %.2f Amps\n", fvalue);
- }
-
- if (yosemite_sensor_read(slot_id, BIC_SENSOR_VCCIN_VR_CURR, &fvalue)) {
- printf("yosemite_sensor_read failed: BIC_SENSOR_VCCIN_VR_CURR\n");
- } else {
- printf("BIC_SENSOR_VCCIN_VR_CURR: %.2f Amps\n", fvalue);
- }
-
- if (yosemite_sensor_read(slot_id, BIC_SENSOR_VDDR_VR_CURR, &fvalue)) {
- printf("yosemite_sensor_read failed: BIC_SENSOR_VDDR_VR_CURR\n");
- } else {
- printf("BIC_SENSOR_VDDR_VR_CURR: %.2f Amps\n", fvalue);
- }
-
- if (yosemite_sensor_read(slot_id, BIC_SENSOR_VCC_SCSUS_VR_CURR, &fvalue)) {
- printf("yosemite_sensor_read failed: BIC_SENSOR_VCC_SCSUS_VR_CURR\n");
- } else {
- printf("BIC_SENSOR_VCC_SCSUS_VR_CURR: %.2f Amps\n", fvalue);
- }
-
- // Monolake Voltage Sensors
- if (yosemite_sensor_read(slot_id, BIC_SENSOR_VCCIN_VR_VOL, &fvalue)) {
- printf("yosemite_sensor_read failed: BIC_SENSOR_VCCIN_VR_VOL\n");
- } else {
- printf("BIC_SENSOR_VCCIN_VR_VOL: %.2f Volts\n", fvalue);
- }
-
- if (yosemite_sensor_read(slot_id, BIC_SENSOR_VDDR_VR_VOL, &fvalue)) {
- printf("yosemite_sensor_read failed: BIC_SENSOR_VDDR_VR_VOL\n");
- } else {
- printf("BIC_SENSOR_VDDR_VR_VOL: %.2f Volts\n", fvalue);
- }
-
- if (yosemite_sensor_read(slot_id, BIC_SENSOR_VCC_SCSUS_VR_VOL, &fvalue)) {
- printf("yosemite_sensor_read failed: BIC_SENSOR_VCC_SCSUS_VR_VOL\n");
- } else {
- printf("BIC_SENSOR_VCC_SCSUS_VR_VOL: %.2f Volts\n", fvalue);
- }
-
- if (yosemite_sensor_read(slot_id, BIC_SENSOR_VCC_GBE_VR_VOL, &fvalue)) {
- printf("yosemite_sensor_read failed: BIC_SENSOR_VCC_GBE_VR_VOL\n");
- } else {
- printf("BIC_SENSOR_VCC_GBE_VR_VOL: %.2f Volts\n", fvalue);
- }
-
- if (yosemite_sensor_read(slot_id, BIC_SENSOR_1V05_PCH_VR_VOL, &fvalue)) {
- printf("yosemite_sensor_read failed: BIC_SENSOR_1V05_PCH_VR_VOL\n");
- } else {
- printf("BIC_SENSOR_1V05_PCH_VR_VOL: %.2f Volts\n", fvalue);
- }
-
- if (yosemite_sensor_read(slot_id, BIC_SENSOR_P3V3_MB, &fvalue)) {
- printf("yosemite_sensor_read failed: BIC_SENSOR_P3V3_MB\n");
- } else {
- printf("BIC_SENSOR_P3V3_MB: %.2f Volts\n", fvalue);
- }
-
- if (yosemite_sensor_read(slot_id, BIC_SENSOR_P12V_MB, &fvalue)) {
- printf("yosemite_sensor_read failed: BIC_SENSOR_P12V_MB\n");
- } else {
- printf("BIC_SENSOR_P12V_MB: %.2f Volts\n", fvalue);
- }
-
- if (yosemite_sensor_read(slot_id, BIC_SENSOR_P1V05_PCH, &fvalue)) {
- printf("yosemite_sensor_read failed: BIC_SENSOR_P1V05_PCH\n");
- } else {
- printf("BIC_SENSOR_P1V05_PCH: %.2f Volts\n", fvalue);
- }
-
- if (yosemite_sensor_read(slot_id, BIC_SENSOR_P3V3_STBY_MB, &fvalue)) {
- printf("yosemite_sensor_read failed: BIC_SENSOR_P3V3_STBY_MB\n");
- } else {
- printf("BIC_SENSOR_P3V3_STBY_MB: %.2f Volts\n", fvalue);
- }
-
- if (yosemite_sensor_read(slot_id, BIC_SENSOR_P5V_STBY_MB, &fvalue)) {
- printf("yosemite_sensor_read failed: BIC_SENSOR_P5V_STBY_MB\n");
- } else {
- printf("BIC_SENSOR_P5V_STBY_MB: %.2f Volts\n", fvalue);
- }
-
- if (yosemite_sensor_read(slot_id, BIC_SENSOR_PV_BAT, &fvalue)) {
- printf("yosemite_sensor_read failed: BIC_SENSOR_PV_BAT\n");
- } else {
- printf("BIC_SENSOR_PV_BAT: %.2f Volts\n", fvalue);
- }
-
- if (yosemite_sensor_read(slot_id, BIC_SENSOR_PVDDR, &fvalue)) {
- printf("yosemite_sensor_read failed: BIC_SENSOR_PVDDR\n");
- } else {
- printf("BIC_SENSOR_PVDDR: %.2f Volts\n", fvalue);
- }
-
- if (yosemite_sensor_read(slot_id, BIC_SENSOR_PVCC_GBE, &fvalue)) {
- printf("yosemite_sensor_read failed: BIC_SENSOR_PVCC_GBE\n");
- } else {
- printf("BIC_SENSOR_PVCC_GBE: %.2f Volts\n", fvalue);
- }
-
- // Monolake Power Sensors
- if (yosemite_sensor_read(slot_id, BIC_SENSOR_VCCIN_VR_POUT, &fvalue)) {
- printf("yosemite_sensor_read failed: BIC_SENSOR_VCCIN_VR_POUT\n");
- } else {
- printf("BIC_SENSOR_VCCIN_VR_POUT: %.2f Watts\n", fvalue);
- }
-
- if (yosemite_sensor_read(slot_id, BIC_SENSOR_INA230_POWER, &fvalue)) {
- printf("yosemite_sensor_read failed: BIC_SENSOR_INA230_POWER\n");
- } else {
- printf("BIC_SENSOR_INA230_POWER: %.2f Watts\n", fvalue);
- }
-
- if (yosemite_sensor_read(slot_id, BIC_SENSOR_SOC_PACKAGE_PWR, &fvalue)) {
- printf("yosemite_sensor_read failed: BIC_SENSOR_SOC_PACKAGE_PWR\n");
- } else {
- printf("BIC_SENSOR_SOC_PACKAGE_PWR: %.2f Watts\n", fvalue);
- }
-
- if (yosemite_sensor_read(slot_id, BIC_SENSOR_VDDR_VR_POUT, &fvalue)) {
- printf("yosemite_sensor_read failed: BIC_SENSOR_VDDR_VR_POUT\n");
- } else {
- printf("BIC_SENSOR_VDDR_VR_POUT: %.2f Watts\n", fvalue);
- }
-
- if (yosemite_sensor_read(slot_id, BIC_SENSOR_VCC_SCSUS_VR_POUT, &fvalue)) {
- printf("yosemite_sensor_read failed: BIC_SENSOR_VCC_SCSUS_VR_POUT\n");
- } else {
- printf("BIC_SENSOR_VCC_SCSUS_VR_POUT: %.2f Watts\n", fvalue);
- }
-
- if (yosemite_sensor_read(slot_id, BIC_SENSOR_VCC_GBE_VR_POUT, &fvalue)) {
- printf("yosemite_sensor_read failed: BIC_SENSOR_VCC_GBE_VR_POUT\n");
- } else {
- printf("BIC_SENSOR_VCC_GBE_VR_POUT: %.2f Watts\n", fvalue);
- }
-
- // Discrete Sensors
- if (yosemite_sensor_read(slot_id, BIC_SENSOR_SYSTEM_STATUS, &value)) {
- printf("yosemite_sensor_read failed: BIC_SENSOR_SYSTEM_STATUS\n");
- } else {
- printf("BIC_SENSOR_SYSTEM_STATUS: 0x%X\n", value);
- }
-
- if (yosemite_sensor_read(slot_id, BIC_SENSOR_PROC_FAIL, &value)) {
- printf("yosemite_sensor_read failed: BIC_SENSOR_PROC_FAIL\n");
- } else {
- printf("BIC_SENSOR_PROC_FAIL: 0x%X\n", value);
- }
-
- if (yosemite_sensor_read(slot_id, BIC_SENSOR_SYS_BOOT_STAT, &value)) {
- printf("yosemite_sensor_read failed: BIC_SENSOR_SYS_BOOT_STAT\n");
- } else {
- printf("BIC_SENSOR_SYS_BOOT_STAT: 0x%X\n", value);
- }
-
- if (yosemite_sensor_read(slot_id, BIC_SENSOR_VR_HOT, &value)) {
- printf("yosemite_sensor_read failed: BIC_SENSOR_VR_HOT\n");
- } else {
- printf("BIC_SENSOR_VR_HOT: 0x%X\n", value);
- }
-
- if (yosemite_sensor_read(slot_id, BIC_SENSOR_CPU_DIMM_HOT, &value)) {
- printf("yosemite_sensor_read failed: BIC_SENSOR_CPU_DIMM_HOT\n");
- } else {
- printf("BIC_SENSOR_CPU_DIMM_HOT: 0x%X\n", value);
- }
-
- return 0;
-}
diff --git a/meta-facebook/meta-yosemite/recipes-yosemite/fbutils/files/yosemite_power.sh b/meta-facebook/meta-yosemite/recipes-yosemite/fbutils/files/yosemite_power.sh
deleted file mode 100644
index 3a2aaf7..0000000
--- a/meta-facebook/meta-yosemite/recipes-yosemite/fbutils/files/yosemite_power.sh
+++ /dev/null
@@ -1,169 +0,0 @@
-#!/bin/bash
-#
-# Copyright 2015-present Facebook. All Rights Reserved.
-#
-# This program file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program in a file named COPYING; if not, write to the
-# Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor,
-# Boston, MA 02110-1301 USA
-#
-
-. /usr/local/fbpackages/utils/ast-functions
-
-PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin
-
-LPS_PATH=/mnt/data/power/por/last_state
-
-prog="$0"
-
-usage() {
- echo "Usage: $prog <slot#> <command> [command options]"
- echo
- echo "Commands:"
- echo " status: Get the current 1S server power status"
- echo
- echo " on: Power on 1S server if not powered on already"
- echo " options:"
- echo " -f: Re-do power on sequence no matter if 1S server has "
- echo " been powered on or not."
- echo
- echo " off: Power off 1S server ungracefully"
- echo
- echo
-}
-
-do_status() {
- if [ $(is_server_prsnt $slot) == "0" ]; then
- echo "The given slot is Empty"
- return 0
- fi
-
- echo -n "1S Server power for slot#$slot is "
- if [ $(yosemite_is_server_on $slot) -eq 1 ] ; then
- echo "on"
- else
- echo "off"
- fi
- return 0
-}
-
-do_on() {
-
- if [ $(is_server_prsnt $slot) == "0" ]; then
- echo "The given slot is Empty"
- return 0
- fi
-
- local force opt
- force=0
- while getopts "f" opt; do
- case $opt in
- f)
- force=1
- ;;
- *)
- usage
- exit -1
- ;;
-
- esac
- done
- echo -n "Power on slot#$slot server ..."
- if [ $force -eq 0 ]; then
- # need to check if 1S Server is on or not
- if [ $(yosemite_is_server_on $slot) -eq 1 ]; then
- echo " Already on. Skip!"
- return 1
- fi
- fi
-
- # TODO: State the power state change
- echo "on $(date +%s)" > $LPS_PATH
-
- # first make sure, GPIO is high
- gpio_set $gpio 1
- # generate the power on pulse
- gpio_set $gpio 0
- sleep 1
- gpio_set $gpio 1
- sleep 1
- # Turn on the power LED
- /usr/local/bin/power_led.sh $slot on
- echo " Done"
- return 0
-}
-
-do_off() {
- if [ $(is_server_prsnt $slot) == "0" ]; then
- echo "The given slot is Empty"
- return 0
- fi
- echo -n "Power off slot#$slot server ..."
-
- #TODO: State the power state change
- echo "off $(date +%s)" > $LPS_PATH
-
- # first make sure, GPIO is high
- gpio_set $gpio 1
- sleep 1
- gpio_set $gpio 0
- sleep 5
- gpio_set $gpio 1
- # Turn off the power LED
- /usr/local/bin/power_led.sh $slot off
- echo " Done"
- return 0
-}
-
-# Slot1: GPIOD3(27), Slot2: GPIOD1(25), Slot3: GPIOD7(31), Slot4: GPIOD5(29)
-slot=$1
-
-case $slot in
- 1)
- gpio=D3
- ;;
- 2)
- gpio=D1
- ;;
- 3)
- gpio=D7
- ;;
- 4)
- gpio=D5
- ;;
- *)
- gpio=D3
- ;;
-esac
-
-command="$2"
-shift
-shift
-
-case "$command" in
- status)
- do_status $@
- ;;
- on)
- do_on $@
- ;;
- off)
- do_off $@
- ;;
- *)
- usage
- exit -1
- ;;
-esac
-
-exit $?
diff --git a/meta-facebook/meta-yosemite/recipes-yosemite/fbutils/fpc-util_0.1.bb b/meta-facebook/meta-yosemite/recipes-yosemite/fbutils/fpc-util_0.1.bb
deleted file mode 100644
index 04665f1..0000000
--- a/meta-facebook/meta-yosemite/recipes-yosemite/fbutils/fpc-util_0.1.bb
+++ /dev/null
@@ -1,21 +0,0 @@
-# Copyright 2015-present Facebook. All Rights Reserved.
-SUMMARY = "Front Panel Control Utility"
-DESCRIPTION = "Util to override the front panel control remotely"
-SECTION = "base"
-PR = "r1"
-LICENSE = "GPLv2"
-LIC_FILES_CHKSUM = "file://fpc-util.c;beginline=4;endline=16;md5=b395943ba8a0717a83e62ca123a8d238"
-
-SRC_URI = "file://fpc-util \
- "
-
-S = "${WORKDIR}/fpc-util"
-
-do_install() {
- install -d ${D}${bindir}
- install -m 0755 fpc-util ${D}${bindir}/fpc-util
-}
-
-DEPENDS += "libpal"
-
-FILES_${PN} = "${bindir}"
diff --git a/meta-facebook/meta-yosemite/recipes-yosemite/fbutils/fw-util_0.1.bb b/meta-facebook/meta-yosemite/recipes-yosemite/fbutils/fw-util_0.1.bb
deleted file mode 100644
index 80c3064..0000000
--- a/meta-facebook/meta-yosemite/recipes-yosemite/fbutils/fw-util_0.1.bb
+++ /dev/null
@@ -1,21 +0,0 @@
-# Copyright 2015-present Facebook. All Rights Reserved.
-SUMMARY = "Firmware Utility"
-DESCRIPTION = "Util for printing or updating firmware images"
-SECTION = "base"
-PR = "r1"
-LICENSE = "GPLv2"
-LIC_FILES_CHKSUM = "file://fw-util.c;beginline=4;endline=16;md5=b395943ba8a0717a83e62ca123a8d238"
-
-SRC_URI = "file://fw-util \
- "
-
-S = "${WORKDIR}/fw-util"
-
-do_install() {
- install -d ${D}${bindir}
- install -m 0755 fw-util ${D}${bindir}/fw-util
-}
-
-DEPENDS += " libbic libpal"
-
-FILES_${PN} = "${bindir}"
diff --git a/meta-facebook/meta-yosemite/recipes-yosemite/fbutils/yosemite-sensors_0.1.bb b/meta-facebook/meta-yosemite/recipes-yosemite/fbutils/yosemite-sensors_0.1.bb
deleted file mode 100644
index 245f05d..0000000
--- a/meta-facebook/meta-yosemite/recipes-yosemite/fbutils/yosemite-sensors_0.1.bb
+++ /dev/null
@@ -1,21 +0,0 @@
-# Copyright 2015-present Facebook. All Rights Reserved.
-SUMMARY = "Yosemite Sensor Utility"
-DESCRIPTION = "Util for reading various sensors on Yosemite"
-SECTION = "base"
-PR = "r1"
-LICENSE = "GPLv2"
-LIC_FILES_CHKSUM = "file://yosemite-sensors.c;beginline=4;endline=16;md5=b395943ba8a0717a83e62ca123a8d238"
-
-SRC_URI = "file://yosemite-sensors \
- "
-
-S = "${WORKDIR}/yosemite-sensors"
-
-do_install() {
- install -d ${D}${bindir}
- install -m 0755 yosemite-sensors ${D}${bindir}/yosemite-sensors
-}
-
-DEPENDS += "libyosemite-sensor"
-
-FILES_${PN} = "${bindir}"
diff --git a/meta-facebook/meta-yosemite/recipes-yosemite/front-paneld/files/Makefile b/meta-facebook/meta-yosemite/recipes-yosemite/front-paneld/files/Makefile
deleted file mode 100644
index 604fabf..0000000
--- a/meta-facebook/meta-yosemite/recipes-yosemite/front-paneld/files/Makefile
+++ /dev/null
@@ -1,10 +0,0 @@
-# Copyright 2015-present Facebook. All Rights Reserved.
-all: front-paneld
-
-front-paneld: front-paneld.c
- $(CC) -pthread -lpal -lbic -o $@ $^ $(LDFLAGS)
-
-.PHONY: clean
-
-clean:
- rm -rf *.o front-paneld
diff --git a/meta-facebook/meta-yosemite/recipes-yosemite/front-paneld/files/front-paneld.c b/meta-facebook/meta-yosemite/recipes-yosemite/front-paneld/files/front-paneld.c
deleted file mode 100644
index 5f1c1ff..0000000
--- a/meta-facebook/meta-yosemite/recipes-yosemite/front-paneld/files/front-paneld.c
+++ /dev/null
@@ -1,587 +0,0 @@
-/*
- *
- * Copyright 2015-present Facebook. All Rights Reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <errno.h>
-#include <syslog.h>
-#include <string.h>
-#include <pthread.h>
-#include <fcntl.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <sys/un.h>
-#include <time.h>
-#include <sys/time.h>
-#include <openbmc/ipmi.h>
-#include <openbmc/ipmb.h>
-#include <openbmc/pal.h>
-
-#define BTN_MAX_SAMPLES 200
-#define BTN_POWER_OFF 40
-#define MAX_NUM_SLOTS 4
-#define HB_TIMESTAMP_COUNT (60 * 60)
-
-// Helper function for msleep
-void
-msleep(int msec) {
- struct timespec req;
-
- req.tv_sec = 0;
- req.tv_nsec = msec * 1000 * 1000;
-
- while(nanosleep(&req, &req) == -1 && errno == EINTR) {
- continue;
- }
-}
-
-// Thread for monitoring debug card hotswap
-static void *
-debug_card_handler() {
- int curr = -1;
- int prev = -1;
- uint8_t prsnt;
- uint8_t pos ;
- uint8_t prev_pos = -1;
- uint8_t lpc;
- int i, ret;
-
- while (1) {
- // Check if debug card present or not
- ret = pal_is_debug_card_prsnt(&prsnt);
- if (ret) {
- goto debug_card_out;
- }
-
- curr = prsnt;
-
- // Check if Debug Card was either inserted or removed
- if (curr != prev) {
-
- if (!curr) {
- // Debug Card was removed
- syslog(LOG_WARNING, "Debug Card Extraction\n");
- // Switch UART mux to BMC
- ret = pal_switch_uart_mux(HAND_SW_BMC);
- if (ret) {
- goto debug_card_out;
- }
- } else {
- // Debug Card was inserted
- syslog(LOG_WARNING, "Debug Card Insertion\n");
-
- }
- }
-
- // If Debug Card is present
- if (curr) {
- ret = pal_get_hand_sw(&pos);
- if (ret) {
- goto debug_card_out;
- }
-
- if (pos == prev_pos && pos != HAND_SW_BMC & !prev) {
- goto display_post;
- }
-
-
- // Switch UART mux based on hand switch
- ret = pal_switch_uart_mux(pos);
- if (ret) {
- goto debug_card_out;
- }
-
- // Enable POST code based on hand switch
- if (pos == HAND_SW_BMC) {
- // For BMC, there is no need to have POST specific code
- goto debug_card_done;
- }
-
- // Make sure the server at selected position is present
- ret = pal_is_server_prsnt(pos, &prsnt);
- if (ret || !prsnt) {
- goto debug_card_done;
- }
-
- // Enable POST codes for all slots
- ret = pal_post_enable(pos);
- if (ret) {
- goto debug_card_out;
- }
-
-display_post:
- // Get last post code and display it
- ret = pal_post_get_last(pos, &lpc);
- if (ret) {
- goto debug_card_out;
- }
-
- ret = pal_post_handle(pos, lpc);
- if (ret) {
- goto debug_card_out;
- }
-
- }
-
-debug_card_done:
- prev = curr;
- prev_pos = pos;
-debug_card_out:
- if (prsnt)
- msleep(500);
- else
- sleep(1);
- }
-}
-
-// Thread to monitor the hand switch
-static void *
-usb_handler() {
- int curr = -1;
- int prev = -1;
- int ret;
- uint8_t pos;
- uint8_t prsnt;
- uint8_t lpc;
-
- while (1) {
- // Get the current hand switch position
- ret = pal_get_hand_sw(&pos);
- if (ret) {
- goto hand_sw_out;
- }
- curr = pos;
- if (curr == prev) {
- // No state change, continue;
- goto hand_sw_out;
- }
-
- // Switch USB Mux to selected server
- ret = pal_switch_usb_mux(pos);
- if (ret) {
- goto hand_sw_out;
- }
-
- prev = curr;
-hand_sw_out:
- sleep(1);
- continue;
- }
-}
-
-// Thread to monitor Reset Button and propagate to selected server
-static void *
-rst_btn_handler() {
- int ret;
- uint8_t pos;
- int i;
- uint8_t btn;
-
- while (1) {
- // Check the position of hand switch
- ret = pal_get_hand_sw(&pos);
- if (ret || pos == HAND_SW_BMC) {
- // For BMC, no need to handle Reset Button
- sleep (1);
- continue;
- }
-
- // Check if reset button is pressed
- ret = pal_get_rst_btn(&btn);
- if (ret || !btn) {
- goto rst_btn_out;
- }
-
- // Pass the reset button to the selected slot
- syslog(LOG_WARNING, "Reset button pressed\n");
- ret = pal_set_rst_btn(pos, 0);
- if (ret) {
- goto rst_btn_out;
- }
-
- // Wait for the button to be released
- for (i = 0; i < BTN_MAX_SAMPLES; i++) {
- ret = pal_get_rst_btn(&btn);
- if (ret || btn) {
- msleep(100);
- continue;
- }
- syslog(LOG_WARNING, "Reset button released\n");
- syslog(LOG_CRIT, "Reset Button pressed for FRU: %d\n", pos);
- ret = pal_set_rst_btn(pos, 1);
- goto rst_btn_out;
- }
-
- // handle error case
- if (i == BTN_MAX_SAMPLES) {
- syslog(LOG_WARNING, "Reset button seems to stuck for long time\n");
- goto rst_btn_out;
- }
-rst_btn_out:
- msleep(100);
- }
-}
-
-// Thread to handle Power Button and power on/off the selected server
-static void *
-pwr_btn_handler() {
- int ret;
- uint8_t pos, btn, cmd;
- int i;
- uint8_t power;
-
- while (1) {
- // Check the position of hand switch
- ret = pal_get_hand_sw(&pos);
- if (ret || pos == HAND_SW_BMC) {
- sleep(1);
- continue;
- }
-
- // Check if power button is pressed
- ret = pal_get_pwr_btn(&btn);
- if (ret || !btn) {
- goto pwr_btn_out;
- }
-
- syslog(LOG_WARNING, "power button pressed\n");
-
- // Wait for the button to be released
- for (i = 0; i < BTN_MAX_SAMPLES; i++) {
- ret = pal_get_pwr_btn(&btn);
- if (ret || btn ) {
- msleep(100);
- continue;
- }
- syslog(LOG_WARNING, "power button released\n");
- break;
- }
-
- // handle error case
- if (i == BTN_MAX_SAMPLES) {
- syslog(LOG_WARNING, "Power button seems to stuck for long time\n");
- goto pwr_btn_out;
- }
-
- // Get the current power state (power on vs. power off)
- ret = pal_get_server_power(pos, &power);
- if (ret) {
- goto pwr_btn_out;
- }
-
- // Set power command should reverse of current power state
- cmd = !power;
-
- // To determine long button press
- if (i >= BTN_POWER_OFF) {
- syslog(LOG_CRIT, "Power Button Long Press for FRU: %d\n", pos);
- } else {
-
- // If current power state is ON and it is not a long press,
- // the power off should be Graceful Shutdown
- if (power == SERVER_POWER_ON)
- cmd = SERVER_GRACEFUL_SHUTDOWN;
-
- syslog(LOG_CRIT, "Power Button Press for FRU: %d\n", pos);
- }
-
- // Reverse the power state of the given server
- ret = pal_set_server_power(pos, cmd);
-pwr_btn_out:
- msleep(100);
- }
-}
-
-// Thread to handle Heart Beat LED and monitor SLED Cycles
-static void *
-hb_handler() {
- int count = 0;
- struct timespec ts;
- struct timespec mts;
- char tstr[64] = {0};
- char buf[128] = {0};
- uint8_t por = 0;
- uint8_t time_init = 0;
- long time_sled_on;
- long time_sled_off;
-
- // Read the last timestamp from KV storage
- pal_get_key_value("timestamp_sled", tstr);
- time_sled_off = (long) strtoul(tstr, NULL, 10);
-
- // If this reset is due to Power-On-Reset, we detected SLED power OFF event
- if (pal_is_bmc_por()) {
- ctime_r(&time_sled_off, buf);
- syslog(LOG_CRIT, "SLED Powered OFF at %s", buf);
- }
-
-
- while (1) {
- // Toggle HB LED
- pal_set_hb_led(1);
- msleep(500);
- pal_set_hb_led(0);
- msleep(500);
-
- // Make sure the time is initialized properly
- // Since there is no battery backup, the time could be reset to build time
- if (time_init == 0) {
- // Read current time
- clock_gettime(CLOCK_REALTIME, &ts);
-
- if (ts.tv_sec < time_sled_off) {
- continue;
- }
-
- // If current time is more than the stored time, the date is correct
- time_init = 1;
-
- // Need to log SLED ON event, if this is Power-On-Reset
- if (pal_is_bmc_por()) {
- // Get uptime
- clock_gettime(CLOCK_MONOTONIC, &mts);
- // To find out when SLED was on, subtract the uptime from current time
- time_sled_on = ts.tv_sec - mts.tv_sec;
-
- ctime_r(&time_sled_on, buf);
- // Log an event if this is Power-On-Reset
- syslog(LOG_CRIT, "SLED Powered ON at %s", buf);
- }
- }
-
- // Store timestamp every one hour to keep track of SLED power
- if (count++ == HB_TIMESTAMP_COUNT) {
- clock_gettime(CLOCK_REALTIME, &ts);
- sprintf(tstr, "%d", ts.tv_sec);
- pal_set_key_value("timestamp_sled", tstr);
- count = 0;
- }
- }
-}
-
-// Thread to handle LED state of the server at given slot
-static void *
-led_handler(void *num) {
- int ret;
- uint8_t prsnt;
- uint8_t power;
- uint8_t pos;
- uint8_t led_blink;
- uint8_t ident = 0;
- int led_on_time, led_off_time;
- char identify[16] = {0};
- char tstr[64] = {0};
- int id_led_on_time = 200;
- int id_led_off_time = 200;
- int power_led_on_time = 500;
- int power_led_off_time = 500;
-
- uint8_t slot = (*(int*) num) + 1;
-
-#ifdef DEBUG
- syslog(LOG_INFO, "led_handler for slot %d\n", slot);
-#endif
-
- ret = pal_is_server_prsnt(slot, &prsnt);
- if (ret || !prsnt) {
- // Turn off led and exit
- ret = pal_set_led(slot, 0);
- goto led_handler_exit;
- }
-
- while (1) {
-
- // Check if this slot needs to be identified
- ident = 0;
-
- // Check if sled needs to be identified
- memset(identify, 0x0, 16);
- ret = pal_get_key_value("identify_sled", identify);
- if (ret == 0 && !strcmp(identify, "on")) {
- ident = 0x1;
- }
-
- // Check if slot needs to be identified
- if (!ident) {
- sprintf(tstr, "identify_slot%d", slot);
- memset(identify, 0x0, 16);
- ret = pal_get_key_value(tstr, identify);
- if (ret == 0 && !strcmp(identify, "on")) {
- ident = 0x1;
- }
- }
-
- if (ident) {
- // Turn OFF Power LED
- pal_set_led(slot, 0);
-
- // Start blinking the ID LED
- pal_set_id_led(slot, 0);
-
- msleep(id_led_on_time);
-
- pal_set_id_led(slot, 1);
-
- msleep(id_led_off_time);
- continue;
- } else {
- // Turn OFF ID LED
- pal_set_id_led(slot, 1);
- }
-
- // Get power status for this slot
- ret = pal_get_server_power(slot, &power);
- if (ret) {
- sleep(1);
- continue;
- }
-
- // Get hand switch position to see if this is selected server
- ret = pal_get_hand_sw(&pos);
- if (ret) {
- sleep(1);
- continue;
- }
-
- if (pos == HAND_SW_BMC) {
- // Start blinking the ID LED
- pal_set_led(slot, 0);
-
- msleep(power_led_off_time);
-
- pal_set_led(slot, 1);
-
- msleep(power_led_on_time);
- continue;
- }
-
- if (pos == slot) {
- // This server is selcted one, set led_blink flag
- led_blink = 1;
- } else {
- led_blink = 0;
- }
-
- if (!led_blink) {
- // Set the led state based on power state
- ret = pal_set_led(slot, power);
- goto led_handler_out;
- }
-
- // Set blink rate
- if (power) {
- led_on_time = 900;
- led_off_time = 100;
- } else {
- led_on_time = 100;
- led_off_time = 900;
- }
-
- // Start blinking the LED
- ret = pal_set_led(slot, 1);
- if (ret) {
- goto led_handler_out;
- }
-
- msleep(led_on_time);
-
- ret = pal_set_led(slot, 0);
- if (ret) {
- goto led_handler_out;
- }
-
- msleep(led_off_time);
-led_handler_out:
- msleep(100);
- }
-
-led_handler_exit:
- free(num);
-}
-
-int
-main (int argc, char * const argv[]) {
- pthread_t tid_hand_sw;
- pthread_t tid_debug_card;
- pthread_t tid_rst_btn;
- pthread_t tid_pwr_btn;
- pthread_t tid_hb;
- pthread_t tid_leds[MAX_NUM_SLOTS];
- int i;
- int *ip;
- int rc;
- int pid_file;
-
- pid_file = open("/var/run/front-paneld.pid", O_CREAT | O_RDWR, 0666);
- rc = flock(pid_file, LOCK_EX | LOCK_NB);
- if(rc) {
- if(EWOULDBLOCK == errno) {
- printf("Another front-paneld instance is running...\n");
- exit(-1);
- }
- } else {
- daemon(0, 1);
- openlog("front-paneld", LOG_CONS, LOG_DAEMON);
- }
-
-
- if (pthread_create(&tid_debug_card, NULL, debug_card_handler, NULL) < 0) {
- syslog(LOG_WARNING, "pthread_create for debug card error\n");
- exit(1);
- }
- if (pthread_create(&tid_hand_sw, NULL, usb_handler, NULL) < 0) {
- syslog(LOG_WARNING, "pthread_create for hand switch error\n");
- exit(1);
- }
-
- if (pthread_create(&tid_rst_btn, NULL, rst_btn_handler, NULL) < 0) {
- syslog(LOG_WARNING, "pthread_create for reset button error\n");
- exit(1);
- }
-
- if (pthread_create(&tid_pwr_btn, NULL, pwr_btn_handler, NULL) < 0) {
- syslog(LOG_WARNING, "pthread_create for power button error\n");
- exit(1);
- }
-
- if (pthread_create(&tid_hb, NULL, hb_handler, NULL) < 0) {
- syslog(LOG_WARNING, "pthread_create for heart beat error\n");
- exit(1);
- }
-
- for (i = 0; i < MAX_NUM_SLOTS; i++) {
- ip = malloc(sizeof(int));
- *ip = i;
- if (pthread_create(&tid_leds[i], NULL, led_handler, (void*)ip) < 0) {
- syslog(LOG_WARNING, "pthread_create for hand switch error\n");
- exit(1);
- }
- }
- pthread_join(tid_debug_card, NULL);
- pthread_join(tid_hand_sw, NULL);
- pthread_join(tid_rst_btn, NULL);
- pthread_join(tid_pwr_btn, NULL);
- pthread_join(tid_hb, NULL);
- for (i = 0; i < MAX_NUM_SLOTS; i++) {
- pthread_join(tid_leds[i], NULL);
- }
-
- return 0;
-}
diff --git a/meta-facebook/meta-yosemite/recipes-yosemite/front-paneld/files/setup-front-paneld.sh b/meta-facebook/meta-yosemite/recipes-yosemite/front-paneld/files/setup-front-paneld.sh
deleted file mode 100644
index 7055cc0..0000000
--- a/meta-facebook/meta-yosemite/recipes-yosemite/front-paneld/files/setup-front-paneld.sh
+++ /dev/null
@@ -1,16 +0,0 @@
-#!/bin/sh
-#
-# Copyright 2015-present Facebook. All Rights Reserved.
-#
-### BEGIN INIT INFO
-# Provides: setup-front-paneld
-# Required-Start:
-# Required-Stop:
-# Default-Start: S
-# Default-Stop:
-# Short-Description: Start front panel control daemon
-### END INIT INFO
-
-echo -n "Setup Front Panel Daemon.."
- /usr/local/bin/front-paneld > /dev/null 2>&1 &
-echo "done."
diff --git a/meta-facebook/meta-yosemite/recipes-yosemite/front-paneld/front-paneld_0.1.bb b/meta-facebook/meta-yosemite/recipes-yosemite/front-paneld/front-paneld_0.1.bb
deleted file mode 100644
index 8eb4457..0000000
--- a/meta-facebook/meta-yosemite/recipes-yosemite/front-paneld/front-paneld_0.1.bb
+++ /dev/null
@@ -1,44 +0,0 @@
-# Copyright 2015-present Facebook. All Rights Reserved.
-
-SUMMARY = "Front Panel Control Daemon"
-DESCRIPTION = "Daemon to monitor and control the front panel "
-SECTION = "base"
-PR = "r1"
-LICENSE = "GPLv2"
-LIC_FILES_CHKSUM = "file://front-paneld.c;beginline=5;endline=17;md5=da35978751a9d71b73679307c4d296ec"
-
-
-DEPENDS_append = "libpal libbic update-rc.d-native"
-
-SRC_URI = "file://Makefile \
- file://setup-front-paneld.sh \
- file://front-paneld.c \
- "
-
-S = "${WORKDIR}"
-
-binfiles = "front-paneld"
-
-pkgdir = "front-paneld"
-
-do_install() {
- dst="${D}/usr/local/fbpackages/${pkgdir}"
- bin="${D}/usr/local/bin"
- install -d $dst
- install -d $bin
- install -m 755 front-paneld ${dst}/front-paneld
- ln -snf ../fbpackages/${pkgdir}/front-paneld ${bin}/front-paneld
- install -d ${D}${sysconfdir}/init.d
- install -d ${D}${sysconfdir}/rcS.d
- install -m 755 setup-front-paneld.sh ${D}${sysconfdir}/init.d/setup-front-paneld.sh
- update-rc.d -r ${D} setup-front-paneld.sh start 67 5 .
-}
-
-FBPACKAGEDIR = "${prefix}/local/fbpackages"
-
-FILES_${PN} = "${FBPACKAGEDIR}/front-paneld ${prefix}/local/bin ${sysconfdir} "
-
-# Inhibit complaints about .debug directories:
-
-INHIBIT_PACKAGE_DEBUG_SPLIT = "1"
-INHIBIT_PACKAGE_STRIP = "1"
diff --git a/meta-facebook/meta-yosemite/recipes-yosemite/fruid/fruid_0.1.bbappend b/meta-facebook/meta-yosemite/recipes-yosemite/fruid/fruid_0.1.bbappend
deleted file mode 100644
index c87f2a7..0000000
--- a/meta-facebook/meta-yosemite/recipes-yosemite/fruid/fruid_0.1.bbappend
+++ /dev/null
@@ -1,24 +0,0 @@
-# Copyright 2015-present Facebook. All Rights Reserved.
-#
-# This program file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program in a file named COPYING; if not, write to the
-# Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor,
-# Boston, MA 02110-1301 USA
-
-
-S = "${WORKDIR}"
-
-CFLAGS_prepend = " -DCONFIG_YOSEMITE"
-LDFLAGS_append = " -lyosemite_fruid"
-
-DEPENDS_prepend = "libyosemite-fruid"
diff --git a/meta-facebook/meta-yosemite/recipes-yosemite/gpiod/files/Makefile b/meta-facebook/meta-yosemite/recipes-yosemite/gpiod/files/Makefile
deleted file mode 100644
index 68e9453..0000000
--- a/meta-facebook/meta-yosemite/recipes-yosemite/gpiod/files/Makefile
+++ /dev/null
@@ -1,26 +0,0 @@
-# Copyright 2015-present Facebook. All Rights Reserved.
-#
-# This program file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program in a file named COPYING; if not, write to the
-# Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor,
-# Boston, MA 02110-1301 USA
-
-all: gpiod
-
-sensord: gpiod.c
- $(CC) $(CFLAGS) -D _XOPEN_SOURCE -pthread -lm -std=c99 -o $@ $^ $(LDFLAGS)
-
-.PHONY: clean
-
-clean:
- rm -rf *.o gpiod
diff --git a/meta-facebook/meta-yosemite/recipes-yosemite/gpiod/files/gpiod.c b/meta-facebook/meta-yosemite/recipes-yosemite/gpiod/files/gpiod.c
deleted file mode 100644
index f4bf9f9..0000000
--- a/meta-facebook/meta-yosemite/recipes-yosemite/gpiod/files/gpiod.c
+++ /dev/null
@@ -1,380 +0,0 @@
-/*
- * sensord
- *
- * Copyright 2015-present Facebook. All Rights Reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <stdbool.h>
-#include <unistd.h>
-#include <errno.h>
-#include <syslog.h>
-#include <stdint.h>
-#include <math.h>
-#include <string.h>
-#include <pthread.h>
-#include <sys/un.h>
-#include <sys/file.h>
-#include <openbmc/ipmi.h>
-#include <openbmc/pal.h>
-#include <facebook/bic.h>
-#include <facebook/yosemite_gpio.h>
-
-#define SETBIT(x, y) (x | (1 << y))
-#define GETBIT(x, y) ((x & (1 << y)) > y)
-#define CLEARBIT(x, y) (x & (~(1 << y)))
-#define GETMASK(y) (1 << y)
-
-#define MAX_NUM_SLOTS 4
-#define DELAY_GPIOD_READ 500000 // Polls each slot gpio values every 4*x usec
-#define SOCK_PATH_GPIO "/tmp/gpio_socket"
-
-/* To hold the gpio info and status */
-typedef struct {
- uint8_t flag;
- uint8_t status;
- uint8_t ass_val;
- char name[32];
-} gpio_pin_t;
-
-static gpio_pin_t gpio_slot1[MAX_GPIO_PINS] = {0};
-static gpio_pin_t gpio_slot2[MAX_GPIO_PINS] = {0};
-static gpio_pin_t gpio_slot3[MAX_GPIO_PINS] = {0};
-static gpio_pin_t gpio_slot4[MAX_GPIO_PINS] = {0};
-
-/* Returns the pointer to the struct holding all gpio info for the fru#. */
-static gpio_pin_t *
-get_struct_gpio_pin(uint8_t fru) {
-
- gpio_pin_t *gpios;
-
- switch (fru) {
- case FRU_SLOT1:
- gpios = gpio_slot1;
- break;
- case FRU_SLOT2:
- gpios = gpio_slot2;
- break;
- case FRU_SLOT3:
- gpios = gpio_slot3;
- break;
- case FRU_SLOT4:
- gpios = gpio_slot4;
- break;
- default:
- syslog(LOG_WARNING, "get_struct_gpio_pin: Wrong SLOT ID %d\n", fru);
- return NULL;
- }
-
- return gpios;
-}
-
-int
-enable_gpio_intr_config(uint8_t fru, uint8_t gpio) {
- int ret;
-
- bic_gpio_config_t cfg = {0};
- bic_gpio_config_t verify_cfg = {0};
-
-
- ret = bic_get_gpio_config(fru, gpio, &cfg);
- if (ret < 0) {
- syslog(LOG_ERR, "enable_gpio_intr_config: bic_get_gpio_config failed"
- "for slot_id: %u, gpio pin: %u", fru, gpio);
- return -1;
- }
-
- cfg.ie = 1;
-
- ret = bic_set_gpio_config(fru, gpio, &cfg);
- if (ret < 0) {
- syslog(LOG_ERR, "enable_gpio_intr_config: bic_set_gpio_config failed"
- "for slot_id: %u, gpio pin: %u", fru, gpio);
- return -1;
- }
-
- ret = bic_get_gpio_config(fru, gpio, &verify_cfg);
- if (ret < 0) {
- syslog(LOG_ERR, "enable_gpio_intr_config: verification bic_get_gpio_config"
- "for slot_id: %u, gpio pin: %u", fru, gpio);
- return -1;
- }
-
- if (verify_cfg.ie != cfg.ie) {
- syslog(LOG_WARNING, "Slot_id: %u,Interrupt enabling FAILED for GPIO pin# %d",
- fru, gpio);
- return -1;
- }
-
- return 0;
-}
-
-/* Enable the interrupt mode for all the gpio sensors */
-static void
-enable_gpio_intr(uint8_t fru) {
-
- int i, ret;
- gpio_pin_t *gpios;
-
- gpios = get_struct_gpio_pin(fru);
- if (gpios == NULL) {
- syslog(LOG_WARNING, "enable_gpio_intr: get_struct_gpio_pin failed.");
- return;
- }
-
- for (i = 0; i < gpio_pin_cnt; i++) {
-
- gpios[i].flag = 0;
-
- ret = enable_gpio_intr_config(fru, gpio_pin_list[i]);
- if (ret < 0) {
- syslog(LOG_WARNING, "enable_gpio_intr: Slot: %d, Pin %d interrupt enabling"
- " failed", fru, gpio_pin_list[i]);
- syslog(LOG_WARNING, "enable_gpio_intr: Disable check for Slot %d, Pin %d",
- fru, gpio_pin_list[i]);
- } else {
- gpios[i].flag = 1;
-#ifdef DEBUG
- syslog(LOG_WARNING, "enable_gpio_intr: Enabled check for Slot: %d, Pin %d",
- fru, gpio_pin_list[i]);
-#endif /* DEBUG */
- }
- }
-}
-
-static void
-populate_gpio_pins(uint8_t fru) {
-
- int i, ret;
-
- gpio_pin_t *gpios;
-
- gpios = get_struct_gpio_pin(fru);
- if (gpios == NULL) {
- syslog(LOG_WARNING, "populate_gpio_pins: get_struct_gpio_pin failed.");
- return;
- }
-
- for(i = 0; i < gpio_pin_cnt; i++) {
- // Only monitor the PWRGOOD_CPU pin
- if (i == PWRGOOD_CPU)
- gpios[gpio_pin_list[i]].flag = 1;
- }
-
-
- for(i = 0; i < MAX_GPIO_PINS; i++) {
- if (gpios[i].flag) {
- gpios[i].ass_val = GETBIT(gpio_ass_val, i);
- ret = yosemite_get_gpio_name(fru, i, gpios[i].name);
- if (ret < 0)
- continue;
- }
- }
-}
-
-/* Wrapper function to configure and get all gpio info */
-static void
-init_gpio_pins() {
- int fru;
-
- for (fru = FRU_SLOT1; fru < (FRU_SLOT1 + MAX_NUM_SLOTS); fru++) {
- populate_gpio_pins(fru);
- }
-}
-
-/* Monitor the gpio pins */
-static int
-gpio_monitor_poll(uint8_t fru_flag) {
- int i, ret;
- uint8_t fru;
- uint32_t revised_pins, n_pin_val, o_pin_val[MAX_NUM_SLOTS + 1] = {0};
- gpio_pin_t *gpios;
- char pwr_state[MAX_VALUE_LEN];
-
- uint32_t status;
- bic_gpio_t gpio = {0};
-
- /* Check for initial Asserts */
- for (fru = 1; fru <= MAX_NUM_SLOTS; fru++) {
- if (GETBIT(fru_flag, fru) == 0)
- continue;
-
- ret = bic_get_gpio(fru, &gpio);
- if (ret) {
-#ifdef DEBUG
- syslog(LOG_WARNING, "gpio_monitor_poll: bic_get_gpio failed for "
- " fru %u", fru);
-#endif
- continue;
- }
-
- gpios = get_struct_gpio_pin(fru);
- if (gpios == NULL) {
- syslog(LOG_WARNING, "gpio_monitor_poll: get_struct_gpio_pin failed for"
- " fru %u", fru);
- continue;
- }
-
- memcpy(&status, (uint8_t *) &gpio, sizeof(status));
-
- o_pin_val[fru] = 0;
-
- for (i = 0; i < MAX_GPIO_PINS; i++) {
-
- if (gpios[i].flag == 0)
- continue;
-
- gpios[i].status = GETBIT(status, i);
-
- if (gpios[i].status)
- o_pin_val[fru] = SETBIT(o_pin_val[fru], i);
-
- if (gpios[i].status == gpios[i].ass_val) {
- syslog(LOG_CRIT, "ASSERT: fru: %u, num: %d, gpio pin: %-20s",
- fru, i, gpios[i].name);
- }
- }
- }
-
- /* Keep monitoring each fru's gpio pins every 4 * GPIOD_READ_DELAY seconds */
- while(1) {
- for (fru = 1; fru <= MAX_NUM_SLOTS; fru++) {
- if (!(GETBIT(fru_flag, fru))) {
- usleep(DELAY_GPIOD_READ);
- continue;
- }
-
- gpios = get_struct_gpio_pin(fru);
- if (gpios == NULL) {
- syslog(LOG_WARNING, "gpio_monitor_poll: get_struct_gpio_pin failed for"
- " fru %u", fru);
- continue;
- }
-
- memset(pwr_state, 0, MAX_VALUE_LEN);
- pal_get_last_pwr_state(fru, pwr_state);
-
- /* Get the GPIO pins */
- if ((ret = bic_get_gpio(fru, (bic_gpio_t *) &n_pin_val)) < 0) {
- /* log the error message only when the CPU is on but not reachable. */
- if (!(strcmp(pwr_state, "on"))) {
-#ifdef DEBUG
- syslog(LOG_WARNING, "gpio_monitor_poll: bic_get_gpio failed for "
- " fru %u", fru);
-#endif
- }
- continue;
- }
-
- if (o_pin_val[fru] == n_pin_val) {
- o_pin_val[fru] = n_pin_val;
- usleep(DELAY_GPIOD_READ);
- continue;
- }
-
- revised_pins = (n_pin_val ^ o_pin_val[fru]);
-
- for (i = 0; i < MAX_GPIO_PINS; i++) {
- if (GETBIT(revised_pins, i) && (gpios[i].flag == 1)) {
- gpios[i].status = GETBIT(n_pin_val, i);
-
- // Check if the new GPIO val is ASSERT
- if (gpios[i].status == gpios[i].ass_val) {
- /*
- * GPIO - PWRGOOD_CPU assert indicates that the CPU is turned off or in a bad shape.
- * Raise an error and change the LPS from on to off or vice versa for deassert.
- */
- if (!(strcmp(pwr_state, "on")))
- pal_set_last_pwr_state(fru, "off");
-
- syslog(LOG_CRIT, "ASSERT: fru: %u, num: %d, gpio pin: %-20s",
- fru, i, gpios[i].name);
- } else {
-
- if (!(strcmp(pwr_state, "off")))
- pal_set_last_pwr_state(fru, "on");
-
- syslog(LOG_CRIT, "DEASSERT: fru: %u, num: %d, gpio pin: %-20s",
- fru, i, gpios[i].name);
- }
- }
- }
-
- o_pin_val[fru] = n_pin_val;
- usleep(DELAY_GPIOD_READ);
-
- } /* For Loop for each fru */
- } /* while loop */
-} /* function definition*/
-
-static void
-print_usage() {
- printf("Usage: gpiod [ %s ]\n", pal_server_list);
-}
-
-/* Spawns a pthread for each fru to monitor all the sensors on it */
-static void
-run_gpiod(int argc, void **argv) {
-
- //gpio_monitor();
-
- int i, ret;
- uint8_t fru_flag, fru;
-
- /* Check for which fru do we need to monitor the gpio pins */
- fru_flag = 0;
- for (i = 1; i < argc; i++) {
- ret = pal_get_fru_id(argv[i], &fru);
- if (ret < 0) {
- print_usage();
- exit(-1);
- }
- fru_flag = SETBIT(fru_flag, fru);
- }
-
- gpio_monitor_poll(fru_flag);
-}
-
-int
-main(int argc, void **argv) {
- int dev, rc, pid_file;
-
- if (argc < 2) {
- print_usage();
- exit(-1);
- }
-
- pid_file = open("/var/run/gpiod.pid", O_CREAT | O_RDWR, 0666);
- rc = flock(pid_file, LOCK_EX | LOCK_NB);
- if(rc) {
- if(EWOULDBLOCK == errno) {
- printf("Another gpiod instance is running...\n");
- exit(-1);
- }
- } else {
-
- init_gpio_pins();
-
- daemon(0,1);
- openlog("gpiod", LOG_CONS, LOG_DAEMON);
- syslog(LOG_INFO, "gpiod: daemon started");
- run_gpiod(argc, argv);
- }
-
- return 0;
-}
diff --git a/meta-facebook/meta-yosemite/recipes-yosemite/gpiod/files/setup-gpiod.sh b/meta-facebook/meta-yosemite/recipes-yosemite/gpiod/files/setup-gpiod.sh
deleted file mode 100644
index 01df2cd..0000000
--- a/meta-facebook/meta-yosemite/recipes-yosemite/gpiod/files/setup-gpiod.sh
+++ /dev/null
@@ -1,54 +0,0 @@
-#!/bin/sh
-#
-# Copyright 2015-present Facebook. All Rights Reserved.
-#
-# This program file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program in a file named COPYING; if not, write to the
-# Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor,
-# Boston, MA 02110-1301 USA
-#
-
-### BEGIN INIT INFO
-# Provides: setup-sensord
-# Required-Start:
-# Required-Stop:
-# Default-Start: S
-# Default-Stop:
-# Short-Description: Setup sensor monitoring
-### END INIT INFO
-
-. /usr/local/fbpackages/utils/ast-functions
-
-echo -n "Setup gpio monitoring for yosemite... "
-
-# Check for the slots present and run sensord for those slots only.
-SLOTS=
- if [ $(is_server_prsnt 1) == "1" ]; then
- SLOTS="$SLOTS slot1"
- fi
-
- if [ $(is_server_prsnt 2) == "1" ]; then
- SLOTS="$SLOTS slot2"
- fi
-
- if [ $(is_server_prsnt 3) == "1" ]; then
- SLOTS="$SLOTS slot3"
- fi
-
- if [ $(is_server_prsnt 4) == "1" ]; then
- SLOTS="$SLOTS slot4"
- fi
-
-/usr/local/bin/gpiod $SLOTS
-
-echo "done."
diff --git a/meta-facebook/meta-yosemite/recipes-yosemite/gpiod/gpiod_0.1.bb b/meta-facebook/meta-yosemite/recipes-yosemite/gpiod/gpiod_0.1.bb
deleted file mode 100644
index a815f36..0000000
--- a/meta-facebook/meta-yosemite/recipes-yosemite/gpiod/gpiod_0.1.bb
+++ /dev/null
@@ -1,62 +0,0 @@
-# Copyright 2015-present Facebook. All Rights Reserved.
-#
-# This program file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program in a file named COPYING; if not, write to the
-# Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor,
-# Boston, MA 02110-1301 USA
-
-SUMMARY = "GPIO Sensor Monitoring Daemon"
-DESCRIPTION = "Daemon for monitoring the gpio sensors"
-SECTION = "base"
-PR = "r1"
-LICENSE = "GPLv2"
-LIC_FILES_CHKSUM = "file://gpiod.c;beginline=4;endline=16;md5=b395943ba8a0717a83e62ca123a8d238"
-
-SRC_URI = "file://Makefile \
- file://gpiod.c \
- file://setup-gpiod.sh \
- "
-
-S = "${WORKDIR}"
-
-binfiles = "gpiod \
- "
-
-CFLAGS += " -lbic -lyosemite_gpio -lpal "
-
-DEPENDS += " libbic libyosemite-gpio libpal "
-
-pkgdir = "gpiod"
-
-do_install() {
- dst="${D}/usr/local/fbpackages/${pkgdir}"
- bin="${D}/usr/local/bin"
- install -d $dst
- install -d $bin
- for f in ${binfiles}; do
- install -m 755 $f ${dst}/$f
- ln -snf ../fbpackages/${pkgdir}/$f ${bin}/$f
- done
- install -d ${D}${sysconfdir}/init.d
- install -d ${D}${sysconfdir}/rcS.d
- install -m 755 setup-gpiod.sh ${D}${sysconfdir}/init.d/setup-gpiod.sh
- update-rc.d -r ${D} setup-gpiod.sh start 91 5 .
-}
-
-FBPACKAGEDIR = "${prefix}/local/fbpackages"
-
-FILES_${PN} = "${FBPACKAGEDIR}/gpiod ${prefix}/local/bin ${sysconfdir} "
-
-
-INHIBIT_PACKAGE_DEBUG_SPLIT = "1"
-INHIBIT_PACKAGE_STRIP = "1"
diff --git a/meta-facebook/meta-yosemite/recipes-yosemite/ipmbd/files/setup-ipmbd.sh b/meta-facebook/meta-yosemite/recipes-yosemite/ipmbd/files/setup-ipmbd.sh
deleted file mode 100644
index b37d8fa..0000000
--- a/meta-facebook/meta-yosemite/recipes-yosemite/ipmbd/files/setup-ipmbd.sh
+++ /dev/null
@@ -1,104 +0,0 @@
-#! /bin/sh
-#
-# Copyright 2015-present Facebook. All Rights Reserved.
-#
-# This program file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program in a file named COPYING; if not, write to the
-# Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor,
-# Boston, MA 02110-1301 USA
-#
-
-### BEGIN INIT INFO
-# Provides: ipmbd
-# Required-Start:
-# Required-Stop:
-# Default-Start: S
-# Default-Stop: 0 6
-# Short-Description: Provides ipmb message tx/rx service
-#
-### END INIT INFO
-
-. /usr/local/fbpackages/utils/ast-functions
-
-PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin
-DAEMON=/usr/local/bin/ipmbd
-NAME=ipmbd
-DESC="IPMB Rx/Tx Daemon"
-
-test -f $DAEMON || exit 0
-
-STOPPER=
-ACTION="$1"
-
-case "$ACTION" in
- start)
- echo -n "Starting $DESC: "
-
- if [ $(is_server_prsnt 1) == "1" ]; then
- $DAEMON 3 > /dev/null 2>&1 &
- fi
-
- if [ $(is_server_prsnt 2) == "1" ]; then
- $DAEMON 1 > /dev/null 2>&1 &
- fi
-
- if [ $(is_server_prsnt 3) == "1" ]; then
- $DAEMON 7 > /dev/null 2>&1 &
- fi
-
- if [ $(is_server_prsnt 4) == "1" ]; then
- $DAEMON 5 > /dev/null 2>&1 &
- fi
-
- echo "$NAME."
- ;;
- stop)
- echo -n "Stopping $DESC: "
- start-stop-daemon --stop --quiet --exec $DAEMON
- echo "$NAME."
- ;;
- restart|force-reload)
- echo -n "Restarting $DESC: "
- start-stop-daemon --stop --quiet --exec $DAEMON
- sleep 1
- if [ $(is_server_prsnt 1) == "1" ]; then
- $DAEMON 3 > /dev/null 2>&1 &
- fi
-
- if [ $(is_server_prsnt 2) == "1" ]; then
- $DAEMON 1 > /dev/null 2>&1 &
- fi
-
- if [ $(is_server_prsnt 3) == "1" ]; then
- $DAEMON 7 > /dev/null 2>&1 &
- fi
-
- if [ $(is_server_prsnt 4) == "1" ]; then
- $DAEMON 5 > /dev/null 2>&1 &
- fi
-
- echo "$NAME."
- ;;
- status)
- status $DAEMON
- exit $?
- ;;
- *)
- N=${0##*/}
- N=${N#[SK]??}
- echo "Usage: $N {start|stop|status|restart|force-reload}" >&2
- exit 1
- ;;
-esac
-
-exit 0
diff --git a/meta-facebook/meta-yosemite/recipes-yosemite/ipmbd/ipmbd_0.1.bbappend b/meta-facebook/meta-yosemite/recipes-yosemite/ipmbd/ipmbd_0.1.bbappend
deleted file mode 100644
index f2cc6a7..0000000
--- a/meta-facebook/meta-yosemite/recipes-yosemite/ipmbd/ipmbd_0.1.bbappend
+++ /dev/null
@@ -1,28 +0,0 @@
-# Copyright 2015-present Facebook. All Rights Reserved.
-
-FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
-SRC_URI += " file://setup-ipmbd.sh \
- "
-DEPENDS_append = " fbutils "
-
-CFLAGS_prepend = " -DCONFIG_YOSEMITE"
-
-do_install() {
- dst="${D}/usr/local/fbpackages/${pkgdir}"
- bin="${D}/usr/local/bin"
- install -d $dst
- install -d $bin
- install -m 755 ipmbd ${dst}/ipmbd
- ln -snf ../fbpackages/${pkgdir}/ipmbd ${bin}/ipmbd
- install -d ${D}${sysconfdir}/init.d
- install -d ${D}${sysconfdir}/rcS.d
- install -m 755 setup-ipmbd.sh ${D}${sysconfdir}/init.d/setup-ipmbd.sh
- update-rc.d -r ${D} setup-ipmbd.sh start 65 5 .
-}
-
-FBPACKAGEDIR = "${prefix}/local/fbpackages"
-
-FILES_${PN} = "${FBPACKAGEDIR}/ipmbd ${prefix}/local/bin ${sysconfdir} "
-
-INHIBIT_PACKAGE_DEBUG_SPLIT = "1"
-INHIBIT_PACKAGE_STRIP = "1"
diff --git a/meta-facebook/meta-yosemite/recipes-yosemite/ipmid/files/bic.c b/meta-facebook/meta-yosemite/recipes-yosemite/ipmid/files/bic.c
deleted file mode 100644
index 938e076..0000000
--- a/meta-facebook/meta-yosemite/recipes-yosemite/ipmid/files/bic.c
+++ /dev/null
@@ -1,78 +0,0 @@
-/* Copyright 2015-present Facebook. All Rights Reserved.
- *
- * This file contains code to support IPMI2.0 Specificaton available @
- * http://www.intel.com/content/www/us/en/servers/ipmi/ipmi-specifications.html
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <errno.h>
-#include <string.h>
-#include <syslog.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <sys/un.h>
-#include <openbmc/ipmi.h>
-
-#define MAX_IPMI_RES_LEN 100
-
-/*
- * Function to handle GPIO interrupt
- */
-void
-lib_gpio_intr_handle(unsigned char *request, unsigned char req_len,
- unsigned char *response, unsigned char *res_len) {
-
- int sockfd, t, len;
- struct sockaddr_un remote;
-
- // TODO: Need to update to reuse the socket instead of creating new
- if ((sockfd = socket(AF_UNIX, SOCK_STREAM, 0)) == -1) {
- syslog(LOG_WARNING, "lib_gpio_intr_handle: socket() failed\n");
- return;
- }
-
- remote.sun_family = AF_UNIX;
- strcpy(remote.sun_path, SOCK_PATH_GPIO);
- len = strlen(remote.sun_path) + sizeof(remote.sun_family);
-
- if (connect(sockfd, (struct sockaddr *)&remote, len) == -1) {
- syslog(LOG_WARNING, "lib_gpio_intr_handle: connect() failed\n");
- return;
- }
-
- if (send(sockfd, request, req_len, 0) == -1) {
- syslog(LOG_WARNING, "lib_gpio_intr_handle: send() failed\n");
- return;
- }
-
- if ((t=recv(sockfd, response, MAX_IPMI_RES_LEN, 0)) > 0) {
- *res_len = t;
- } else {
- if (t < 0) {
- syslog(LOG_WARNING, "lib_gpio_intr_handle: recv() failed\n");
- } else {
- syslog(LOG_WARNING, "Server closed connection");
- }
-
- return;
- }
-
- close(sockfd);
-
- return;
-}
diff --git a/meta-facebook/meta-yosemite/recipes-yosemite/ipmid/files/bic.h b/meta-facebook/meta-yosemite/recipes-yosemite/ipmid/files/bic.h
deleted file mode 100644
index c0fcfbb..0000000
--- a/meta-facebook/meta-yosemite/recipes-yosemite/ipmid/files/bic.h
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- *
- * Copyright 2015-present Facebook. All Rights Reserved.
- *
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-
-#ifndef __BIC_H__
-#define __BIC_H__
-
-#define SOCK_PATH_GPIO "/tmp/gpio_socket"
-
-void lib_gpio_intr_handle(unsigned char *request, unsigned char req_len,
- unsigned char *response, unsigned char *res_len);
-
-#endif /* __BIC_H__ */
diff --git a/meta-facebook/meta-yosemite/recipes-yosemite/ipmid/files/fruid.c b/meta-facebook/meta-yosemite/recipes-yosemite/ipmid/files/fruid.c
deleted file mode 100644
index d3fb856..0000000
--- a/meta-facebook/meta-yosemite/recipes-yosemite/ipmid/files/fruid.c
+++ /dev/null
@@ -1,120 +0,0 @@
-/*
- *
- * Copyright 2015-present Facebook. All Rights Reserved.
- *
- * This file provides platform specific implementation of FRUID information
- *
- * FRUID specification can be found at
- * www.intel.com/content/dam/www/public/us/en/documents/product-briefs/platform-management-fru-document-rev-1-2-feb-2013.pdf
- *
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <errno.h>
-#include <syslog.h>
-#include <string.h>
-#include <stdint.h>
-#include "fruid.h"
-
-#define EEPROM_SPB "/sys/class/i2c-adapter/i2c-8/8-0051/eeprom"
-#define EEPROM_NIC "/sys/class/i2c-adapter/i2c-12/12-0051/eeprom"
-
-#define BIN_SPB "/tmp/fruid_spb.bin"
-#define BIN_NIC "/tmp/fruid_nic.bin"
-
-#define NAME_SPB "Side Plane Board"
-#define NAME_NIC "Mezz Card"
-
-#define FRUID_SIZE 256
-
-/*
- * copy_eeprom_to_bin - copy the eeprom to binary file im /tmp directory
- *
- * @eeprom_file : path for the eeprom of the device
- * @bin_file : path for the binary file
- *
- * returns 0 on successful copy
- * returns non-zero on file operation errors
- */
-int copy_eeprom_to_bin(const char * eeprom_file, const char * bin_file) {
-
- int eeprom;
- int bin;
- uint64_t tmp[FRUID_SIZE];
- ssize_t bytes_rd, bytes_wr;
-
- errno = 0;
-
- if (access(eeprom_file, F_OK) != -1) {
-
- eeprom = open(eeprom_file, O_RDONLY);
- if (eeprom == -1) {
- syslog(LOG_ERR, "copy_eeprom_to_bin: unable to open the %s file: %s",
- eeprom_file, strerror(errno));
- return errno;
- }
-
- bin = open(bin_file, O_WRONLY | O_CREAT, 0644);
- if (bin == -1) {
- syslog(LOG_ERR, "copy_eeprom_to_bin: unable to create %s file: %s",
- bin_file, strerror(errno));
- return errno;
- }
-
- bytes_rd = read(eeprom, tmp, FRUID_SIZE);
- if (bytes_rd != FRUID_SIZE) {
- syslog(LOG_ERR, "copy_eeprom_to_bin: write to %s file failed: %s",
- eeprom_file, strerror(errno));
- return errno;
- }
-
- bytes_wr = write(bin, tmp, bytes_rd);
- if (bytes_wr != bytes_rd) {
- syslog(LOG_ERR, "copy_eeprom_to_bin: write to %s file failed: %s",
- bin_file, strerror(errno));
- return errno;
- }
-
- close(bin);
- close(eeprom);
- }
-
- return 0;
-}
-
-/* Populate the platform specific eeprom for fruid info */
-int plat_fruid_init(void) {
-
- int ret;
-
- ret = copy_eeprom_to_bin(EEPROM_SPB, BIN_SPB);
- ret = copy_eeprom_to_bin(EEPROM_NIC, BIN_NIC);
-
- return ret;
-}
-
-int plat_fruid_size(void) {
- /* TODO: Not supported yet */
- return 0;
-}
-int plat_fruid_data(int offset, int count, unsigned char *data) {
- /* TODO: Not supported yet */
- return 0;
-}
diff --git a/meta-facebook/meta-yosemite/recipes-yosemite/ipmid/files/lan.c b/meta-facebook/meta-yosemite/recipes-yosemite/ipmid/files/lan.c
deleted file mode 100644
index 3b36046..0000000
--- a/meta-facebook/meta-yosemite/recipes-yosemite/ipmid/files/lan.c
+++ /dev/null
@@ -1,127 +0,0 @@
-/*
- * lan.c
- *
- * Copyright 2015-present Facebook. All Rights Reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-
-#define _GNU_SOURCE /* To get defns of NI_MAXSERV and NI_MAXHOST */
-#include <arpa/inet.h>
-#include <sys/socket.h>
-#include <netdb.h>
-#include <ifaddrs.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <string.h>
-#include <net/if.h>
-#include <linux/if_link.h>
-#include <sys/ioctl.h>
-#include <stdbool.h>
-#include <openbmc/ipmi.h>
-
-#define ETH_INTF_NAME "eth0"
-
-#define IPV6_LINK_LOCAL_BYTE1 0xFE
-#define IPV6_LINK_LOCAL_BYTE2 0x80
-
-#define BYTE_MASK 0xFF
-#define BYTE1_OFFSET 8
-#define BYTE2_OFFSET 16
-#define BYTE3_OFFSET 24
-
-void plat_lan_init(lan_config_t *lan)
-{
- struct ifaddrs *ifaddr, *ifa;
- struct sockaddr_in *addr;
- struct sockaddr_in6 *addr6;
- int family, s, n, i;
- unsigned long ip;
- unsigned char *ip6;
- int sd;
- struct ifreq ifr;
- uint8_t mac_addr[6];
- uint8_t eui_64_addr[8] = {0x0};
- bool slaac_flag = false;
- char test[64];
-
- if (getifaddrs(&ifaddr) == -1) {
- return;
- }
-
- for (ifa = ifaddr, n = 0; ifa != NULL; ifa = ifa->ifa_next, n++) {
- if (ifa->ifa_addr == NULL) {
- continue;
- }
-
- if (strcmp(ifa->ifa_name, ETH_INTF_NAME)) {
- continue;
- }
-
- family = ifa->ifa_addr->sa_family;
-
- if (family == AF_INET) {
- addr = (struct sockaddr_in*) ifa->ifa_addr;
- ip = addr->sin_addr.s_addr;
-
- // copy the ip address from long to byte array with MSB first
- lan->ip_addr[3] = (ip >> BYTE3_OFFSET) & BYTE_MASK;
- lan->ip_addr[2] = (ip >> BYTE2_OFFSET) & BYTE_MASK;
- lan->ip_addr[1] = (ip >> BYTE1_OFFSET) & BYTE_MASK;
- lan->ip_addr[0] = ip & BYTE_MASK;
- } else if (family == AF_INET6) {
- addr6 = (struct sockaddr_in6*) ifa->ifa_addr;
- ip6 = addr6->sin6_addr.s6_addr;
-
- // If the address is Link Local, Ignore it
- if ((ip6[0] == IPV6_LINK_LOCAL_BYTE1) && (ip6[1] == IPV6_LINK_LOCAL_BYTE2)) {
- continue;
- }
-
- // Get the MAC address
- sd = socket(PF_INET, SOCK_DGRAM, 0);
- strcpy(ifr.ifr_name, ifa->ifa_name);
- if(ioctl(sd, SIOCGIFHWADDR, &ifr) != -1) {
- uint8_t* mac_addr = (uint8_t*)ifr.ifr_hwaddr.sa_data;
-
- /*
- * SLAAC address has lower 8B as follows:
- * 3B == First 24b MAC address
- * 2B == FFFE
- * 3B == Last 24b MAC address
- */
- memcpy((void *)&eui_64_addr[0], (void *)&mac_addr[0], 3);
- eui_64_addr[3] = 0xFF;
- eui_64_addr[4] = 0xFE;
- memcpy((void *)&eui_64_addr[5], (void *)&mac_addr[3], 3);
- eui_64_addr[0] += 2;
-
- // Check if the address is SLAAC address. If yes, skip it.
- if (!memcmp((void *)&ip6[8], (void *)eui_64_addr, 8)) {
- slaac_flag = true;
- }
- }
-
- if (slaac_flag)
- continue;
-
- // copy the ip address from array with MSB first
- memcpy(lan->ip6_addr, ip6, SIZE_IP6_ADDR);
- }
- }
-
- freeifaddrs(ifaddr);
-}
diff --git a/meta-facebook/meta-yosemite/recipes-yosemite/ipmid/files/sensor.c b/meta-facebook/meta-yosemite/recipes-yosemite/ipmid/files/sensor.c
deleted file mode 100644
index 57ab5ec..0000000
--- a/meta-facebook/meta-yosemite/recipes-yosemite/ipmid/files/sensor.c
+++ /dev/null
@@ -1,371 +0,0 @@
-/*
- *
- * Copyright 2014-present Facebook. All Rights Reserved.
- *
- * This file provides platform specific implementation of sensor information
- *
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-#include "sensor.h"
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <errno.h>
-#include <syslog.h>
-#include <string.h>
-
-#define SENSOR_MGMT_MAX 1
-#define SENSOR_DISC_MAX 8
-#define SENSOR_THRESH_MAX 1
-#define SENSOR_OEM_MAX 1
-
-#define BMC_SLAVE_ADDR 0x20
-
-typedef struct {
- unsigned char num;
- sensor_mgmt_t sensor[SENSOR_MGMT_MAX];
-} sensor_mgmt_info_t;
-
-typedef struct {
- unsigned char num;
- sensor_disc_t sensor[SENSOR_DISC_MAX];
-} sensor_disc_info_t;
-
-typedef struct {
- unsigned char num;
- sensor_thresh_t sensor[SENSOR_THRESH_MAX];
-} sensor_thresh_info_t;
-
-typedef struct {
- unsigned char num;
- sensor_oem_t sensor[SENSOR_OEM_MAX];
-} sensor_oem_info_t;
-
-// Global structures
-static sensor_mgmt_info_t g_sensor_mgmt = {0};
-static sensor_disc_info_t g_sensor_disc = {0};
-static sensor_thresh_info_t g_sensor_thresh = {0};
-static sensor_oem_info_t g_sensor_oem = {0};
-
-static void
-populate_mgmt_sensors(void) {
- sensor_mgmt_t sensor = {0};
-
- // Add record for the AST2100 BMC
- sensor.slave_addr = BMC_SLAVE_ADDR;
- sensor.chan_no = 0x0; // Primary BMC controller
-
- // Init Agent = false
- sensor.pwr_state_init = 0x00;
-
- // FRUID = true, SEL = true, SDR = true, Sensor = true
- sensor.dev_caps = 0x0F;
-
- // Device ID string
- // Type - 0xC0: ASCII, Length - 0x09
- sensor.str_type_len = 0xC0 + 0x09;
- strncpy(sensor.str, "Yosemite-BMC", 0x09);
-
- // Add this sensor to the global table
- if (g_sensor_mgmt.num >= SENSOR_MGMT_MAX) {
- syslog(LOG_WARNING, "populate_mgmt_sensors: num exceeded\n");
- return;
- }
-
- memcpy(&g_sensor_mgmt.sensor[g_sensor_mgmt.num], &sensor, sizeof(sensor_mgmt_t));
-
- g_sensor_mgmt.num++;
-
- return;
-}
-
-static void
-populate_disc_sensors(void) {
-
- sensor_disc_t sensor = {0};
-
- // Sensor uS Status
- // Sensor# 0x10
- // EntitiyId# 0xD0, EntityInst# 0x00
- // Sensor Type# Chassis 0x18
- // Event Read/Type# OEM 0x70
- sensor.owner= BMC_SLAVE_ADDR;
- sensor.lun = 0x00;
- sensor.sensor_num = 0x10;
-
- sensor.ent_id = 0xD0;
- sensor.ent_inst = 0x00;
- // Enable Scanning, Enable Events
- sensor.sensor_init = 0x63;
- // Supports Auto Re-Arm
- sensor.sensor_caps = 0x40;
- sensor.sensor_type = 0x18;
- sensor.evt_read_type = 0x70;
- // 1-bit for CPU0 Thermal Trip
- sensor.assert_evt_mask[0] = 0x04;
- sensor.deassert_evt_mask[0] = 0x00;
- sensor.read_evt_mask[0] = 0x04;
-
- // Device ID string
- // Type - 0xC0: ASCII, Length - 12
- sensor.str_type_len = 0xC0 + 9;
- strncpy(sensor.str, "uS-Status", 9);
-
- // Add this sensor to the global table
- if (g_sensor_disc.num >= SENSOR_DISC_MAX) {
- syslog(LOG_WARNING, "populate_disc_sensors: num exceeded\n");
- return;
- }
-
- memcpy(&g_sensor_disc.sensor[g_sensor_disc.num], &sensor, sizeof(sensor_disc_t));
-
- g_sensor_disc.num++;
-
- // Sensor SEL Status
- // Sensor# 0x5F
- // EntitiyId# 0xD0, EntityInst# 0x02
- // Sensor Type# OEM: 0xC0
- // Event Read/Type# Sensor Specific: 0x6F
- sensor.owner= BMC_SLAVE_ADDR;
- sensor.lun = 0x00;
- sensor.sensor_num = 0x5F;
-
- sensor.ent_id = 0xD0;
- sensor.ent_inst = 0x02;
- // Enable Scanning, Enable Events
- sensor.sensor_init = 0x63;
- // Supports Auto Re-Arm
- sensor.sensor_caps = 0x40;
- sensor.sensor_type = 0xC0;
- sensor.evt_read_type = 0x6F;
- // SEL Clear(bit1), SEL Rollover(bit8)
- sensor.assert_evt_mask[0] = 0x02;
- sensor.assert_evt_mask[1] = 0x01;
- sensor.deassert_evt_mask[0] = 0x00;
- sensor.deassert_evt_mask[1] = 0x00;
- sensor.read_evt_mask[0] = 0x02;
- sensor.read_evt_mask[1] = 0x01;
-
- // Device ID string
- // Type - 0xC0: ASCII, Length - 12
- sensor.str_type_len = 0xC0 + 10;
- strncpy(sensor.str, "SEL-Status", 10);
-
- // Add this sensor to the global table
- if (g_sensor_disc.num >= SENSOR_DISC_MAX) {
- syslog(LOG_WARNING, "populate_disc_sensors: num exceeded\n");
- return;
- }
-
- memcpy(&g_sensor_disc.sensor[g_sensor_disc.num], &sensor, sizeof(sensor_disc_t));
-
- g_sensor_disc.num++;
-
-
- // Sensor WDT
- // Sensor# 0x60
- // EntitiyId# 0xD0, EntityInst# 0x03
- // Sensor Type# WDT2: 0x23
- // Event Read/Type# Sensor Specific: 0x6F
- sensor.owner= BMC_SLAVE_ADDR;
- sensor.lun = 0x00;
- sensor.sensor_num = 0x60;
-
- sensor.ent_id = 0xD0;
- sensor.ent_inst = 0x03;
- // Enable Scanning, Enable Events
- sensor.sensor_init = 0x63;
- // Supports Auto Re-Arm
- sensor.sensor_caps = 0x40;
- sensor.sensor_type = 0x23;
- sensor.evt_read_type = 0x6F;
- // 5 bits for expiry, reset, pwrdown, pwrcycle, timer
- sensor.assert_evt_mask[0] = 0x0F;
- sensor.assert_evt_mask[1] = 0x01;
- sensor.deassert_evt_mask[0] = 0x00;
- sensor.deassert_evt_mask[1] = 0x00;
- sensor.read_evt_mask[0] = 0x0F;
- sensor.read_evt_mask[1] = 0x01;
-
- // Device ID string
- // Type - 0xC0: ASCII, Length - 12
- sensor.str_type_len = 0xC0 + 3;
- strncpy(sensor.str, "WDT", 3);
-
- // Add this sensor to the global table
- if (g_sensor_disc.num >= SENSOR_DISC_MAX) {
- syslog(LOG_WARNING, "populate_disc_sensors: num exceeded\n");
- return;
- }
-
- memcpy(&g_sensor_disc.sensor[g_sensor_disc.num], &sensor, sizeof(sensor_disc_t));
-
- g_sensor_disc.num++;
-
-
- // Sensor Chassis Pwr Sts
- // Sensor# 0x70
- // EntitiyId# 0x15, EntityInst# 0x00
- // Sensor Type# OEM: 0xC8
- // Event Read/Type# Sensor Specific: 0x6F
- sensor.owner= BMC_SLAVE_ADDR;
- sensor.lun = 0x00;
- sensor.sensor_num = 0x70;
-
- sensor.ent_id = 0x15;
- sensor.ent_inst = 0x00;
- // Enable Scanning, Enable Events
- sensor.sensor_init = 0x63;
- // Supports Auto Re-Arm
- sensor.sensor_caps = 0x40;
- sensor.sensor_type = 0xC8;
- sensor.evt_read_type = 0x6F;
- // 6 bits for pwroff, pwrcycle, pwron, softdown, ac-lost, hard-reset
- sensor.assert_evt_mask[0] = 0x3F;
- sensor.deassert_evt_mask[0] = 0x00;
- sensor.read_evt_mask[0] = 0x3F;
-
- // Device ID string
- // Type - 0xC0: ASCII, Length - 12
- sensor.str_type_len = 0xC0 + 13;
- strncpy(sensor.str, "CH-Pwr-Status", 13);
-
- // Add this sensor to the global table
- if (g_sensor_disc.num >= SENSOR_DISC_MAX) {
- syslog(LOG_WARNING, "populate_disc_sensors: num exceeded\n");
- return;
- }
-
- memcpy(&g_sensor_disc.sensor[g_sensor_disc.num], &sensor, sizeof(sensor_disc_t));
-
- g_sensor_disc.num++;
-
- // Sensor CPU DIMM Hot
- // Sensor# 0xB3
- // EntitiyId# 0xD0, EntityInst# 0x05
- // Sensor Type# OEM 0xC6
- // Event Read/Type# Sensor Specific 6Fh
- sensor.owner= BMC_SLAVE_ADDR;
- sensor.lun = 0x00;
- sensor.sensor_num = 0xB3;
-
- sensor.ent_id = 0xD0;
- sensor.ent_inst = 0x05;
- // Enable Scanning, Enable Events
- sensor.sensor_init = 0x63;
- // Supports Auto Re-Arm
- sensor.sensor_caps = 0x40;
- sensor.sensor_type = 0xC6;
- sensor.evt_read_type = 0x6F;
- // Two bits for CPU Hot, DIMM Hot
- sensor.assert_evt_mask[0] = 0x05;
- sensor.deassert_evt_mask[0] = 0x05;
- sensor.read_evt_mask[0] = 0x05;
-
- // Device ID string
- // Type - 0xC0: ASCII, Length - 12
- sensor.str_type_len = 0xC0 + 12;
- strncpy(sensor.str, "CPU_DIMM_HOT", 12);
-
- // Add this sensor to the global table
- if (g_sensor_disc.num >= SENSOR_DISC_MAX) {
- syslog(LOG_WARNING, "populate_disc_sensors: num exceeded\n");
- return;
- }
-
- memcpy(&g_sensor_disc.sensor[g_sensor_disc.num], &sensor, sizeof(sensor_disc_t));
-
- g_sensor_disc.num++;
-
- // Sensor PMBus Status Word Low
- // Sensor PMBus Status Word High
- // Sensor PMBus Status MFR
- // Sensor PMBus Status Input
- // Sensor NTP Status
- // Sensor# 0xED
- // EntitiyId# 0x35, EntityInst# 0x00
- // Sensor Type# OEM 0xC7
- // Event Read/Type# Sensor Specific 6Fh
- sensor.owner= BMC_SLAVE_ADDR;
- sensor.lun = 0x00;
- sensor.sensor_num = 0xED;
-
- sensor.ent_id = 0x35;
- sensor.ent_inst = 0x00;
- // Enable Scanning, Enable Events
- sensor.sensor_init = 0x63;
- // Supports Auto Re-Arm
- sensor.sensor_caps = 0x40;
- sensor.sensor_type = 0xC7;
- sensor.evt_read_type = 0x6F;
- // 1-bit for date/time sync failed
- sensor.assert_evt_mask[0] = 0x01;
- sensor.deassert_evt_mask[0] = 0x00;
- sensor.read_evt_mask[0] = 0x01;
-
- // Device ID string
- // Type - 0xC0: ASCII, Length - 10
- sensor.str_type_len = 0xC0 + 12;
- strncpy(sensor.str, "NTP-Status", 10);
-
- // Add this sensor to the global table
- if (g_sensor_disc.num >= SENSOR_DISC_MAX) {
- syslog(LOG_WARNING, "populate_disc_sensors: num exceeded\n");
- return;
- }
-
- memcpy(&g_sensor_disc.sensor[g_sensor_disc.num], &sensor, sizeof(sensor_disc_t));
-
- g_sensor_disc.num++;
-
- return;
-}
-
-// Access functions for Sensor Table
-void
-plat_sensor_mgmt_info(int *p_num, sensor_mgmt_t **p_sensor) {
- *p_num = g_sensor_mgmt.num;
- *p_sensor = g_sensor_mgmt.sensor;
-}
-
-void
-plat_sensor_disc_info(int *p_num, sensor_disc_t **p_sensor) {
- *p_num = g_sensor_disc.num;
- *p_sensor = g_sensor_disc.sensor;
-}
-
-void
-plat_sensor_thresh_info(int *p_num, sensor_thresh_t **p_sensor) {
- *p_num = g_sensor_thresh.num;
- *p_sensor = g_sensor_thresh.sensor;
-}
-
-void
-plat_sensor_oem_info(int *p_num, sensor_oem_t **p_sensor) {
- *p_num = g_sensor_oem.num;
- *p_sensor = g_sensor_oem.sensor;
-}
-
-// Initialize Sensor Table
-int
-plat_sensor_init(void) {
-
- // Populate all Sensors
- populate_mgmt_sensors();
- populate_disc_sensors();
-
- return 0;
-}
diff --git a/meta-facebook/meta-yosemite/recipes-yosemite/ipmid/files/setup-ipmid.sh b/meta-facebook/meta-yosemite/recipes-yosemite/ipmid/files/setup-ipmid.sh
deleted file mode 100644
index b724d70..0000000
--- a/meta-facebook/meta-yosemite/recipes-yosemite/ipmid/files/setup-ipmid.sh
+++ /dev/null
@@ -1,32 +0,0 @@
-#!/bin/sh
-#
-# Copyright 2014-present Facebook. All Rights Reserved.
-#
-# This program file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program in a file named COPYING; if not, write to the
-# Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor,
-# Boston, MA 02110-1301 USA
-#
-
-### BEGIN INIT INFO
-# Provides: setup-ipmid
-# Required-Start:
-# Required-Stop:
-# Default-Start: S
-# Default-Stop:
-# Short-Description: Set IPMI Message handler
-### END INIT INFO
-
-echo -n "Setup IPMI message handler... "
-/usr/local/bin/ipmid
-echo "done."
diff --git a/meta-facebook/meta-yosemite/recipes-yosemite/ipmid/ipmid_0.2.bbappend b/meta-facebook/meta-yosemite/recipes-yosemite/ipmid/ipmid_0.2.bbappend
deleted file mode 100644
index 57215c5..0000000
--- a/meta-facebook/meta-yosemite/recipes-yosemite/ipmid/ipmid_0.2.bbappend
+++ /dev/null
@@ -1,49 +0,0 @@
-# Copyright 2014-present Facebook. All Rights Reserved.
-#
-# This program file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program in a file named COPYING; if not, write to the
-# Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor,
-# Boston, MA 02110-1301 USA
-
-DEPENDS_append = "libipmi libfruid update-rc.d-native"
-
-FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
-SRC_URI += "file://setup-ipmid.sh \
- file://sensor.c \
- file://fruid.c \
- file://lan.c \
- "
-
-S = "${WORKDIR}"
-
-CFLAGS_prepend = " -DCONFIG_YOSEMITE "
-
-do_install() {
- dst="${D}/usr/local/fbpackages/${pkgdir}"
- bin="${D}/usr/local/bin"
- install -d $dst
- install -d $bin
- install -m 755 ipmid ${dst}/ipmid
- ln -snf ../fbpackages/${pkgdir}/ipmid ${bin}/ipmid
- install -d ${D}${sysconfdir}/init.d
- install -d ${D}${sysconfdir}/rcS.d
- install -m 755 setup-ipmid.sh ${D}${sysconfdir}/init.d/setup-ipmid.sh
- update-rc.d -r ${D} setup-ipmid.sh start 64 5 .
-}
-
-FBPACKAGEDIR = "${prefix}/local/fbpackages"
-
-FILES_${PN} = "${FBPACKAGEDIR}/ipmid ${prefix}/local/bin ${sysconfdir} "
-
-INHIBIT_PACKAGE_DEBUG_SPLIT = "1"
-INHIBIT_PACKAGE_STRIP = "1"
diff --git a/meta-facebook/meta-yosemite/recipes-yosemite/lm_sensors/files/yosemite.conf b/meta-facebook/meta-yosemite/recipes-yosemite/lm_sensors/files/yosemite.conf
deleted file mode 100644
index b05ec3a..0000000
--- a/meta-facebook/meta-yosemite/recipes-yosemite/lm_sensors/files/yosemite.conf
+++ /dev/null
@@ -1,44 +0,0 @@
-
-bus "i2c-9" "ast_i2c.9"
-
-chip "tmp75-i2c-9-4e"
- label temp1 "Inlet Temp"
-
-chip "tmp75-i2c-9-4f"
- label temp1 "Outlet Temp"
-
-chip "ast_pwm-*"
- label fan1 "Fan 1"
- label fan2 "Fan 2"
- ignore fan3
- ignore fan4
- ignore fan5
- ignore fan6
- ignore fan7
- ignore fan8
- ignore fan9
- ignore fan10
- ignore fan11
- ignore fan12
- ignore fan13
- ignore fan14
- ignore fan15
- ignore fan16
-
-chip "ast_adc-isa-0000"
- label in0 "P5V_STBY Voltage"
- label in1 "P12V_STBY Voltage"
- label in2 "P3V3_STBY Voltage"
- label in3 "P12V_STBY_SLOT0 Voltage"
- label in4 "P12V_STBY_SLOT1 Voltage"
- label in5 "P12V_STBY_SLOT2 Voltage"
- label in6 "P12V_STBY_SLOT3 Voltage"
- label in7 "P3V3 Voltage"
- ignore in8
- ignore in9
- ignore in10
- ignore in11
- ignore in12
- ignore in13
- ignore in14
- ignore in15
diff --git a/meta-facebook/meta-yosemite/recipes-yosemite/lm_sensors/lmsensors_%.bbappend b/meta-facebook/meta-yosemite/recipes-yosemite/lm_sensors/lmsensors_%.bbappend
deleted file mode 100644
index c33761e..0000000
--- a/meta-facebook/meta-yosemite/recipes-yosemite/lm_sensors/lmsensors_%.bbappend
+++ /dev/null
@@ -1,10 +0,0 @@
-
-FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
-
-SRC_URI += "file://yosemite.conf \
- "
-
-do_install_append() {
- install -d ${D}${sysconfdir}/sensors.d
- install -m 644 ../yosemite.conf ${D}${sysconfdir}/sensors.d/yosemite.conf
-}
diff --git a/meta-facebook/meta-yosemite/recipes-yosemite/me-util/files/Makefile b/meta-facebook/meta-yosemite/recipes-yosemite/me-util/files/Makefile
deleted file mode 100644
index 941ef10..0000000
--- a/meta-facebook/meta-yosemite/recipes-yosemite/me-util/files/Makefile
+++ /dev/null
@@ -1,10 +0,0 @@
-# Copyright 2015-present Facebook. All Rights Reserved.
-all: me-util
-
-me-util: me-util.o
- $(CC) $(CFLAGS) -pthread -lipmi -lipmb -lbic -lpal -std=c99 -o $@ $^ $(LDFLAGS)
-
-.PHONY: clean
-
-clean:
- rm -rf *.o me-util
diff --git a/meta-facebook/meta-yosemite/recipes-yosemite/me-util/files/me-util.c b/meta-facebook/meta-yosemite/recipes-yosemite/me-util/files/me-util.c
deleted file mode 100644
index 3a181b2..0000000
--- a/meta-facebook/meta-yosemite/recipes-yosemite/me-util/files/me-util.c
+++ /dev/null
@@ -1,119 +0,0 @@
-/*
- * me-util
- *
- * Copyright 2015-present Facebook. All Rights Reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <errno.h>
-#include <syslog.h>
-#include <stdint.h>
-#include <pthread.h>
-#include <string.h>
-#include <fcntl.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <errno.h>
-#include <facebook/bic.h>
-#include <openbmc/ipmi.h>
-
-#define LOGFILE "/tmp/me-util.log"
-
-static void
-print_usage_help(void) {
- printf("Usage: me-util <slot1|slot2|slot3|slot4> <[0..n]data_bytes_to_send>\n");
-}
-
-int
-main(int argc, char **argv) {
- uint8_t slot_id;
- uint8_t tbuf[256] = {0x00};
- uint8_t rbuf[256] = {0x00};
- uint8_t tlen = 0;
- uint8_t rlen = 0;
- int i;
- int ret;
- int logfd;
- int len;
- char log[128];
- char temp[8];
-
- if (argc < 3) {
- goto err_exit;
- }
-
- if (!strcmp(argv[1], "slot1")) {
- slot_id = 1;
- } else if (!strcmp(argv[1] , "slot2")) {
- slot_id = 2;
- } else if (!strcmp(argv[1] , "slot3")) {
- slot_id = 3;
- } else if (!strcmp(argv[1] , "slot4")) {
- slot_id = 4;
- } else {
- goto err_exit;
- }
-
- for (i = 2; i < argc; i++) {
- tbuf[tlen++] = (uint8_t)strtoul(argv[i], NULL, 0);
- }
-
-#if 1
- ret = bic_me_xmit(slot_id, tbuf, tlen, rbuf, &rlen);
- if (ret) {
- return ret;
- }
-#endif
-
- // memcpy(rbuf, tbuf, tlen);
- //rlen = tlen;
-
-
- memset(log, 0, 128);
- for (i = 0; i < rlen; i++) {
- printf("%02X ", rbuf[i]);
- memset(temp, 0, 8);
- sprintf(temp, "%02X ", rbuf[i]);
- strcat(log, temp);
- }
- printf("\n");
- sprintf(temp, "\n");
- strcat(log, temp);
-
- errno = 0;
-
- logfd = open(LOGFILE, O_CREAT | O_WRONLY);
- if (logfd < 0) {
- syslog(LOG_WARNING, "Opening a tmp file failed. errno: %d", errno);
- return -1;
- }
-
- len = write(logfd, log, strlen(log));
- if (len != strlen(log)) {
- syslog(LOG_WARNING, "Error writing the log to the file");
- return -1;
- }
-
- close(logfd);
-
- return 0;
-err_exit:
- print_usage_help();
- return -1;
-}
diff --git a/meta-facebook/meta-yosemite/recipes-yosemite/me-util/me-util_0.1.bb b/meta-facebook/meta-yosemite/recipes-yosemite/me-util/me-util_0.1.bb
deleted file mode 100644
index 02219f2..0000000
--- a/meta-facebook/meta-yosemite/recipes-yosemite/me-util/me-util_0.1.bb
+++ /dev/null
@@ -1,38 +0,0 @@
-# Copyright 2015-present Facebook. All Rights Reserved.
-SUMMARY = "Management Engine Utility"
-DESCRIPTION = "Util for communicating to Intel ME"
-SECTION = "base"
-PR = "r1"
-LICENSE = "GPLv2"
-LIC_FILES_CHKSUM = "file://me-util.c;beginline=4;endline=16;md5=b395943ba8a0717a83e62ca123a8d238"
-
-SRC_URI = "file://me-util.c \
- file://Makefile \
- "
-
-S = "${WORKDIR}"
-
-binfiles = "me-util \
- "
-
-pkgdir = "me-util"
-
-DEPENDS = " libbic libpal "
-
-do_install() {
- dst="${D}/usr/local/fbpackages/${pkgdir}"
- bin="${D}/usr/local/bin"
- install -d $dst
- install -d $bin
- for f in ${binfiles}; do
- install -m 755 $f ${dst}/$f
- ln -snf ../fbpackages/${pkgdir}/$f ${bin}/$f
- done
-}
-
-FBPACKAGEDIR = "${prefix}/local/fbpackages"
-
-FILES_${PN} = "${FBPACKAGEDIR}/me-util ${prefix}/local/bin"
-
-INHIBIT_PACKAGE_DEBUG_SPLIT = "1"
-INHIBIT_PACKAGE_STRIP = "1"
diff --git a/meta-facebook/meta-yosemite/recipes-yosemite/oob-nic/oob-nic/src/Makefile b/meta-facebook/meta-yosemite/recipes-yosemite/oob-nic/oob-nic/src/Makefile
deleted file mode 100644
index 00464e5..0000000
--- a/meta-facebook/meta-yosemite/recipes-yosemite/oob-nic/oob-nic/src/Makefile
+++ /dev/null
@@ -1,29 +0,0 @@
-# Copyright 2014-present Facebook. All Rights Reserved.
-#
-# This program file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program in a file named COPYING; if not, write to the
-# Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor,
-# Boston, MA 02110-1301 USA
-
-all: oob-nic i2craw
-
-oob-nic: main.o nic.o intf.o ll_map.o libnetlink.o
- $(CC) -o $@ $^ $(LDFLAGS) -lwedge_eeprom
-
-i2craw: i2craw.o
- $(CC) -o $@ $^ $(LDFLAGS)
-
-.PHONY: clean
-
-clean:
- rm -rf *.o oob-nic i2craw
diff --git a/meta-facebook/meta-yosemite/recipes-yosemite/oob-nic/oob-nic/src/README b/meta-facebook/meta-yosemite/recipes-yosemite/oob-nic/oob-nic/src/README
deleted file mode 100644
index f46971f..0000000
--- a/meta-facebook/meta-yosemite/recipes-yosemite/oob-nic/oob-nic/src/README
+++ /dev/null
@@ -1,10 +0,0 @@
-
-TODO:
-
-1. Currently, we poll the SMbus instead of rely on the ALERT. The kernel does not handle the ALERT either other than just a print out.
-
-2. Maximum fragment is 32
-
-3. We use libnetlink for bring interface up and setting MAC. That increases the binary by about 50k and also we copied about 5 files from iproute2 here for that. We might be able to get away this by using some non-iproute2 API
-
-4. The dependency in the Makefile does not consider .h
diff --git a/meta-facebook/meta-yosemite/recipes-yosemite/oob-nic/oob-nic/src/etc/oob-nic.sh b/meta-facebook/meta-yosemite/recipes-yosemite/oob-nic/oob-nic/src/etc/oob-nic.sh
deleted file mode 100644
index 71ee0fa..0000000
--- a/meta-facebook/meta-yosemite/recipes-yosemite/oob-nic/oob-nic/src/etc/oob-nic.sh
+++ /dev/null
@@ -1,93 +0,0 @@
-#! /bin/sh
-#
-# Copyright 2014-present Facebook. All Rights Reserved.
-#
-# This program file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program in a file named COPYING; if not, write to the
-# Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor,
-# Boston, MA 02110-1301 USA
-#
-
-### BEGIN INIT INFO
-# Provides: oob-nic
-# Required-Start:
-# Required-Stop:
-# Default-Start: S
-# Default-Stop: 0 6
-# Short-Description: One of the first scripts to be executed. Starts or stops
-# the OOB NIC.
-#
-### END INIT INFO
-
-PATH=/sbin:/bin:/usr/sbin:/usr/bin
-DAEMON=/usr/sbin/oob-nic
-NAME=oob-nic
-DESC="OOB NIC Driver"
-
-# source function library
-. /etc/init.d/functions
-
-test -f $DAEMON || exit 0
-
-. /usr/local/fbpackages/utils/ast-functions
-
-fix_etc_interfaces() {
- local intf_conf rev
- intf_conf="/etc/network/interfaces"
-}
-
-STOPPER=
-ACTION="$1"
-
-case "$ACTION" in
- start)
- echo -n "Starting $DESC: "
- if [ ! -d /dev/net ]
- then
- mkdir /dev/net
- fi
- if [ ! -f /dev/net/tun ]
- then
- mknod /dev/net/tun c 10 200
- chmod 666 /dev/net/tun
- fi
- fix_etc_interfaces
- $DAEMON > /dev/null 2>&1 &
- echo "$NAME."
- ;;
- stop)
- echo -n "Stopping $DESC: "
- start-stop-daemon --stop --quiet --exec $DAEMON
- echo "$NAME."
- ;;
- restart|force-reload)
- echo -n "Restarting $DESC: "
- start-stop-daemon --stop --quiet --exec $DAEMON
- sleep 1
- fix_etc_interfaces
- $DAEMON > /dev/null 2>&1 &
- echo "$NAME."
- ;;
- status)
- status $DAEMON
- exit $?
- ;;
- *)
- N=${0##*/}
- N=${N#[SK]??}
- echo "Usage: $N {start|stop|status|restart|force-reload}" >&2
- exit 1
- ;;
-esac
-
-exit 0
diff --git a/meta-facebook/meta-yosemite/recipes-yosemite/oob-nic/oob-nic/src/hlist.h b/meta-facebook/meta-yosemite/recipes-yosemite/oob-nic/oob-nic/src/hlist.h
deleted file mode 100644
index 5e89765..0000000
--- a/meta-facebook/meta-yosemite/recipes-yosemite/oob-nic/oob-nic/src/hlist.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Note: Original file from iproute2 package
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-#ifndef __HLIST_H__
-#define __HLIST_H__ 1
-/* Hash list stuff from kernel */
-
-#include <stddef.h>
-
-#define container_of(ptr, type, member) ({ \
- const typeof( ((type *)0)->member ) *__mptr = (ptr); \
- (type *)( (char *)__mptr - offsetof(type,member) );})
-
-struct hlist_head {
- struct hlist_node *first;
-};
-
-struct hlist_node {
- struct hlist_node *next, **pprev;
-};
-
-static inline void hlist_del(struct hlist_node *n)
-{
- struct hlist_node *next = n->next;
- struct hlist_node **pprev = n->pprev;
- *pprev = next;
- if (next)
- next->pprev = pprev;
-}
-
-static inline void hlist_add_head(struct hlist_node *n, struct hlist_head *h)
-{
- struct hlist_node *first = h->first;
- n->next = first;
- if (first)
- first->pprev = &n->next;
- h->first = n;
- n->pprev = &h->first;
-}
-
-#define hlist_for_each(pos, head) \
- for (pos = (head)->first; pos ; pos = pos->next)
-
-
-#define hlist_for_each_safe(pos, n, head) \
- for (pos = (head)->first; pos && ({ n = pos->next; 1; }); \
- pos = n)
-
-#define hlist_entry_safe(ptr, type, member) \
- ({ typeof(ptr) ____ptr = (ptr); \
- ____ptr ? hlist_entry(____ptr, type, member) : NULL; \
- })
-
-#define hlist_for_each_entry(pos, head, member) \
- for (pos = hlist_entry_safe((head)->first, typeof(*(pos)), member);\
- pos; \
- pos = hlist_entry_safe((pos)->member.next, typeof(*(pos)), member))
-
-#endif /* __HLIST_H__ */
diff --git a/meta-facebook/meta-yosemite/recipes-yosemite/oob-nic/oob-nic/src/i2craw.c b/meta-facebook/meta-yosemite/recipes-yosemite/oob-nic/oob-nic/src/i2craw.c
deleted file mode 100644
index f9d499b..0000000
--- a/meta-facebook/meta-yosemite/recipes-yosemite/oob-nic/oob-nic/src/i2craw.c
+++ /dev/null
@@ -1,245 +0,0 @@
-/*
- * Copyright 2004-present Facebook. All Rights Reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-#include <errno.h>
-#include <fcntl.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/ioctl.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <unistd.h>
-#include <stdint.h>
-
-#include "facebook/i2c-dev.h"
-#include "facebook/log.h"
-
-void usage(const char *prog) {
- printf("Usage: %s [options] <bus number> <slave address>\n", prog);
- printf("\n Options:\n"
- "\n\t-w 'bytes to write':\n"
- "\t\t i2c write\n"
- "\n\t-r <number of bytes to read>:\n"
- "\t\t if 0 is provided, the first byte of read is used to determine\n"
- "\t\t how many bytes more to read\n"
- "\n\t-p:\n"
- "\t\t Use PEC\n"
- "\n\t-h:\n"
- "\t\t Print this help\n"
- "\n Note: if both '-w' and '-r' are specified, write will be"
- "\n performed first, followed by read\n");
-}
-
-#define MAX_BYTES 255
-
-int g_use_pec = 0;
-int g_has_write = 0;
-int g_n_write = 0;
-uint8_t g_write_bytes[MAX_BYTES];
-int g_has_read = 0;
-int g_n_read = -1;
-uint8_t g_read_bytes[MAX_BYTES];
-uint8_t g_bus = -1;
-uint8_t g_slave_addr = 0xff;
-
-static int parse_byte_string(const char *str) {
- const char *startptr = str;
- char *endptr;
- int total = 0;
- unsigned long val;
-
- do {
- val = strtoul(startptr, &endptr, 0);
- if (startptr == endptr) {
- printf("'%s' is invalid\n", str);
- return -1;
- }
- if (val > MAX_BYTES) {
- printf("'%s' is invalid\n", str);
- return -1;
- }
- g_write_bytes[total++] = val;
- if (*endptr == '\0') {
- break;
- }
- if (total >= MAX_BYTES) {
- printf("'%s' is invalid\n", str);
- return -1;
- }
- startptr = endptr;
- } while(1);
-
- return total;
-}
-
-static int i2c_open() {
- int fd;
- char fn[32];
- int rc;
-
- snprintf(fn, sizeof(fn), "/dev/i2c-%d", g_bus);
- fd = open(fn, O_RDWR);
- if (fd == -1) {
- LOG_ERR(errno, "Failed to open i2c device %s", fn);
- return -1;
- }
-
- rc = ioctl(fd, I2C_SLAVE, g_slave_addr);
- if (rc < 0) {
- LOG_ERR(errno, "Failed to open slave @ address 0x%x", g_slave_addr);
- close(fd);
- }
-
- return fd;
-}
-
-static int i2c_io(int fd) {
- struct i2c_rdwr_ioctl_data data;
- struct i2c_msg msg[2];
- int n_msg = 0;
- int rc;
-
- memset(&msg, 0, sizeof(msg));
-
- if (g_has_write) {
- msg[n_msg].addr = g_slave_addr;
- msg[n_msg].flags = (g_use_pec) ? I2C_CLIENT_PEC : 0;
- msg[n_msg].len = g_n_write;
- msg[n_msg].buf = g_write_bytes;
- n_msg++;
- }
-
- if (g_has_read) {
- msg[n_msg].addr = g_slave_addr;
- msg[n_msg].flags = I2C_M_RD
- | ((g_use_pec) ? I2C_CLIENT_PEC : 0)
- | ((g_n_read == 0) ? I2C_M_RECV_LEN : 0);
- /*
- * In case of g_n_read is 0, block length will be added by
- * the underlying bus driver.
- */
- msg[n_msg].len = (g_n_read) ? g_n_read : 256;
- msg[n_msg].buf = g_read_bytes;
- if (g_n_read == 0) {
- /* If we're using variable length block reads, we have to set the
- * first byte of the buffer to at least one or the kernel complains.
- */
- g_read_bytes[0] = 1;
- }
- n_msg++;
- }
-
- data.msgs = msg;
- data.nmsgs = n_msg;
-
- rc = ioctl(fd, I2C_RDWR, &data);
- if (rc < 0) {
- LOG_ERR(errno, "Failed to do raw io");
- return -1;
- }
-
- return 0;
-}
-
-int main(int argc, char * const argv[]) {
- int i;
- int fd;
- int opt;
- while ((opt = getopt(argc, argv, "hpw:r:")) != -1) {
- switch (opt) {
- case 'h':
- usage(argv[0]);
- return 0;
- case 'p':
- g_use_pec = 1;
- break;
- case 'w':
- g_has_write = 1;
- if ((g_n_write = parse_byte_string(optarg)) <= 0) {
- usage(argv[0]);
- return -1;
- }
- break;
- case 'r':
- g_has_read = 1;
- g_n_read = atoi(optarg);
- break;
- default:
- usage(argv[0]);
- return -1;
- }
- }
-
- /* make sure we still have arguments for bus and slave address */
- if (optind + 2 != argc) {
- printf("Bus or slave address is missing\n");
- usage(argv[0]);
- return -1;
- }
-
- g_bus = atoi(argv[optind]);
- g_slave_addr = strtoul(argv[optind + 1], NULL, 0);
- if ((g_slave_addr & 0x80)) {
- printf("Slave address must be 7-bit\n");
- return -1;
- }
-
- if (!g_has_write && !g_has_read) {
- /* by default, read, first byte read is the length */
- g_has_read = 1;
- g_n_read = 0;
- }
-
- printf("Bus: %d\nDevice address: 0x%x\n", g_bus, g_slave_addr);
- if (g_has_write) {
- printf("To write %d bytes:", g_n_write);
- for (i = 0; i < g_n_write; i++) {
- printf(" 0x%x", g_write_bytes[i]);
- }
- printf("\n");
- }
- if (g_has_read) {
- if (g_n_read) {
- printf("To read %d bytes.\n", g_n_read);
- } else {
- printf("To read data.\n");
- }
- }
-
- fd = i2c_open();
- if (fd < 0) {
- return -1;
- }
-
- if (i2c_io(fd) < 0) {
- return -1;
- }
-
- if (g_has_read) {
- printf("Received:\n ");
- if (g_n_read == 0) {
- g_n_read = g_read_bytes[0] + 1;
- }
- for (i = 0; i < g_n_read; i++) {
- printf(" 0x%x", g_read_bytes[i]);
- }
- printf("\n");
- }
-
- return 0;
-}
diff --git a/meta-facebook/meta-yosemite/recipes-yosemite/oob-nic/oob-nic/src/intf.c b/meta-facebook/meta-yosemite/recipes-yosemite/oob-nic/oob-nic/src/intf.c
deleted file mode 100644
index 5bf8480..0000000
--- a/meta-facebook/meta-yosemite/recipes-yosemite/oob-nic/oob-nic/src/intf.c
+++ /dev/null
@@ -1,254 +0,0 @@
-/*
- * Copyright 2014-present Facebook. All Rights Reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-
-#include "intf.h"
-
-#include <errno.h>
-#include <fcntl.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-#include <sys/ioctl.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <linux/rtnetlink.h>
-#include <linux/if.h>
-#include <linux/if_tun.h>
-#include <linux/fib_rules.h>
-
-#include "facebook/log.h"
-#include "libnetlink.h"
-#include "ll_map.h"
-
-struct oob_intf_t {
- char oi_name[32];
- int oi_fd;
- int oi_ifidx;
- uint8_t oi_mac[6];
- struct rtnl_handle oi_rth;
-};
-
-#define TUN_DEVICE "/dev/net/tun"
-
-static int oob_intf_set_mac(oob_intf *intf, const uint8_t mac[6]) {
- int rc;
- struct {
- struct nlmsghdr n;
- struct ifinfomsg ifi;
- char buf[256];
- } req;
-
- memset(&req, 0, sizeof(req));
- req.n.nlmsg_len = NLMSG_LENGTH(sizeof(struct ifinfomsg));
- req.n.nlmsg_type = RTM_NEWLINK;
- req.n.nlmsg_flags = NLM_F_REQUEST;
- req.ifi.ifi_family = AF_UNSPEC;
- req.ifi.ifi_index = intf->oi_ifidx;
- memcpy(intf->oi_mac, mac, sizeof(intf->oi_mac));
- addattr_l(&req.n, sizeof(req), IFLA_ADDRESS,
- intf->oi_mac, sizeof(intf->oi_mac));
- rc = rtnl_talk(&intf->oi_rth, &req.n, 0, 0, NULL);
- if (rc < 0) {
- rc = errno;
- LOG_ERR(rc, "Failed to set mac to interface %s @ index %d",
- intf->oi_name, intf->oi_ifidx);
- return -rc;
- }
-
- LOG_INFO("Set interface %s @ index %d mac to %x:%x:%x:%x:%x:%x",
- intf->oi_name, intf->oi_ifidx,
- intf->oi_mac[0], intf->oi_mac[1], intf->oi_mac[2],
- intf->oi_mac[3], intf->oi_mac[4], intf->oi_mac[5]);
-
- return 0;
-}
-
-static int oob_intf_bring_up(oob_intf *intf) {
- int rc;
- struct {
- struct nlmsghdr n;
- struct ifinfomsg ifi;
- char buf[256];
- } req;
-
- memset(&req, 0, sizeof(req));
- req.n.nlmsg_len = NLMSG_LENGTH(sizeof(struct ifinfomsg));
- req.n.nlmsg_type = RTM_NEWLINK;
- req.n.nlmsg_flags = NLM_F_REQUEST;
- req.ifi.ifi_family = AF_UNSPEC;
- req.ifi.ifi_change |= IFF_UP;
- req.ifi.ifi_flags |= IFF_UP;
- req.ifi.ifi_index = intf->oi_ifidx;
- rc = rtnl_talk(&intf->oi_rth, &req.n, 0, 0, NULL);
- if (rc < 0) {
- rc = errno;
- LOG_ERR(rc, "Failed to bring up interface %s @ index %d",
- intf->oi_name, intf->oi_ifidx);
- return -rc;
- }
-
- LOG_INFO("Brought up interface %s @ index %d", intf->oi_name, intf->oi_ifidx);
-
- return 0;
-}
-
-oob_intf* oob_intf_create(const char *name, const uint8_t mac[6]) {
-
- int rc;
- int flags;
- struct ifreq ifr;
- oob_intf *intf = NULL;
-
-#define _CHECK_RC(fmt, ...) do { \
- if (rc < 0) { \
- rc = errno; \
- LOG_ERR(rc, fmt, ##__VA_ARGS__); \
- goto err_out; \
- } \
-} while(0)
-
- intf = malloc(sizeof(*intf));
- if (!intf) {
- rc = ENOMEM;
- LOG_ERR(rc, "Failed to allocate memory for interface");
- goto err_out;
- }
- memset(intf, 0, sizeof(*intf));
- strncpy(intf->oi_name, name, sizeof(intf->oi_name));
- intf->oi_name[sizeof(intf->oi_name) - 1] = '\0';
- intf->oi_fd = -1;
-
- rc = rtnl_open(&intf->oi_rth, 0);
- _CHECK_RC("Failed to open rth_handler");
-
- rc = open(TUN_DEVICE, O_RDWR);
- _CHECK_RC("Failed to open %s", TUN_DEVICE);
- intf->oi_fd = rc;
-
- memset(&ifr, 0, sizeof(ifr));
- /*
- * IFF_TAP: TAP interface
- * IFF_NO_PI: Do not provide pracket information
- */
- ifr.ifr_flags = IFF_TAP|IFF_NO_PI;
- strncpy(ifr.ifr_name, name, sizeof(ifr.ifr_name));
- ifr.ifr_name[sizeof(ifr.ifr_name) - 1] = '\0';
-
- rc = ioctl(intf->oi_fd, TUNSETIFF, (void *) &ifr);
- _CHECK_RC("Failed to create tap interface %s", ifr.ifr_name);
-
- /* make fd non-blocking */
- rc = fcntl(intf->oi_fd, F_GETFL);
- _CHECK_RC("Failed to get flags from fd ", intf->oi_fd);
- flags = rc | O_NONBLOCK;
- rc = fcntl(intf->oi_fd, F_SETFL, rc);
- _CHECK_RC("Failed to set non-blocking flags ", flags,
- " to fd ", intf->oi_fd);
-
- /* set CLOEXEC */
- rc = fcntl(intf->oi_fd, F_GETFD);
- _CHECK_RC("Failed to get flags from fd ", intf->oi_fd);
- flags = rc | FD_CLOEXEC;
- rc = fcntl(intf->oi_fd, F_SETFD, flags);
- _CHECK_RC("Failed to set close-on-exec flags ", flags,
- " to fd ", intf->oi_fd);
-
- // TODO: if needed, we can adjust send buffer size, TUNSETSNDBUF
- intf->oi_ifidx = ll_name_to_index(intf->oi_name);
-
- /* now set the mac address */
- oob_intf_set_mac(intf, mac);
-
-#if 0
- /* make it persistent */
- rc = ioctl(intf->oi_fd, TUNSETPERSIST, 0);
- _CHECK_RC("Failed to make the tap interface %s persistent", intf->oi_name);
-#endif
-
- LOG_INFO("Create/attach to tap interface %s @ fd %d, index %d",
- intf->oi_name, intf->oi_fd, intf->oi_ifidx);
-
- //oob_intf_bring_up(intf);
-
- return intf;
-
- err_out:
- if (intf) {
- rtnl_close(&intf->oi_rth);
- if (intf->oi_fd != -1) {
- close(intf->oi_fd);
- }
- free(intf);
- }
-
- return NULL;
-}
-
-int oob_intf_get_fd(const oob_intf *intf) {
- return intf->oi_fd;
-}
-
-int oob_intf_receive(const oob_intf *intf, char *buf, int len) {
- int rc;
- do {
- rc = read(intf->oi_fd, buf, len);
- } while (rc == -1 && errno == EINTR);
- if (rc < 0) {
- rc = errno;
- if (rc != EAGAIN) {
- LOG_ERR(rc, "Failed to read on interface fd %d", intf->oi_fd);
- return -rc;
- } else {
- /* nothing is available */
- return 0;
- }
- } else if (rc == 0) {
- // Nothing to read. It shall not happen as the fd is non-blocking.
- // Just add this case to be safe.
- return 0;
- } else if (rc > len) {
- // The pkt is larger than the buffer. We don't have complete packet.
- // It shall not happen unless the MTU is mis-match. Drop the packet.
- LOG_ERR(ENOSPC, "Received a too large packet (%d bytes > %d) from the "
- "tap interface. Drop it...", rc, len);
- return -ENOSPC;
- } else {
- LOG_VER("Recv a packet of %d bytes from %s", rc, intf->oi_name);
- return rc;
- }
-}
-
-int oob_intf_send(const oob_intf *intf, const char *buf, int len) {
- int rc;
- do {
- rc = write(intf->oi_fd, buf, len);
- } while (rc == -1 && errno == EINTR);
- if (rc < 0) {
- rc = errno;
- LOG_ERR(rc, "Failed to send on interface fd %d", intf->oi_fd);
- return -rc;
- } else if (rc < len) {
- LOG_ERR(EIO, "Failed to send the full packet (%d bytes > %d) for fd %d",
- len, rc, intf->oi_fd);
- return -EIO;
- } else {
- LOG_VER("Sent a packet of %d bytes to %s", rc, intf->oi_name);
- return rc;
- }
-}
diff --git a/meta-facebook/meta-yosemite/recipes-yosemite/oob-nic/oob-nic/src/intf.h b/meta-facebook/meta-yosemite/recipes-yosemite/oob-nic/oob-nic/src/intf.h
deleted file mode 100644
index 6ea7af1..0000000
--- a/meta-facebook/meta-yosemite/recipes-yosemite/oob-nic/oob-nic/src/intf.h
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Copyright 2014-present Facebook. All Rights Reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-#ifndef INTF_H
-#define INTF_H
-
-#include <stdint.h>
-
-typedef struct oob_intf_t oob_intf;
-
-oob_intf* oob_intf_create(const char *name, const uint8_t mac[6]);
-int oob_intf_get_fd(const oob_intf *intf);
-
-int oob_intf_receive(const oob_intf *intf, char *buf, int len);
-int oob_intf_send(const oob_intf *intf, const char *buf, int len);
-
-#endif
diff --git a/meta-facebook/meta-yosemite/recipes-yosemite/oob-nic/oob-nic/src/libnetlink.c b/meta-facebook/meta-yosemite/recipes-yosemite/oob-nic/oob-nic/src/libnetlink.c
deleted file mode 100644
index 019e2c8..0000000
--- a/meta-facebook/meta-yosemite/recipes-yosemite/oob-nic/oob-nic/src/libnetlink.c
+++ /dev/null
@@ -1,717 +0,0 @@
-/*
- * Note: Original file from iproute2 package
- *
- * libnetlink.c RTnetlink service routines.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version
- * 2 of the License, or (at your option) any later version.
- *
- * Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru>
- *
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <syslog.h>
-#include <fcntl.h>
-#include <net/if_arp.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <string.h>
-#include <errno.h>
-#include <time.h>
-#include <sys/uio.h>
-
-#include "libnetlink.h"
-
-int rcvbuf = 1024 * 1024;
-
-void rtnl_close(struct rtnl_handle *rth)
-{
- if (rth->fd >= 0) {
- close(rth->fd);
- rth->fd = -1;
- }
-}
-
-int rtnl_open_byproto(struct rtnl_handle *rth, unsigned subscriptions,
- int protocol)
-{
- socklen_t addr_len;
- int sndbuf = 32768;
-
- memset(rth, 0, sizeof(*rth));
-
- rth->fd = socket(AF_NETLINK, SOCK_RAW | SOCK_CLOEXEC, protocol);
- if (rth->fd < 0) {
- perror("Cannot open netlink socket");
- return -1;
- }
-
- if (setsockopt(rth->fd,SOL_SOCKET,SO_SNDBUF,&sndbuf,sizeof(sndbuf)) < 0) {
- perror("SO_SNDBUF");
- return -1;
- }
-
- if (setsockopt(rth->fd,SOL_SOCKET,SO_RCVBUF,&rcvbuf,sizeof(rcvbuf)) < 0) {
- perror("SO_RCVBUF");
- return -1;
- }
-
- memset(&rth->local, 0, sizeof(rth->local));
- rth->local.nl_family = AF_NETLINK;
- rth->local.nl_groups = subscriptions;
-
- if (bind(rth->fd, (struct sockaddr*)&rth->local, sizeof(rth->local)) < 0) {
- perror("Cannot bind netlink socket");
- return -1;
- }
- addr_len = sizeof(rth->local);
- if (getsockname(rth->fd, (struct sockaddr*)&rth->local, &addr_len) < 0) {
- perror("Cannot getsockname");
- return -1;
- }
- if (addr_len != sizeof(rth->local)) {
- fprintf(stderr, "Wrong address length %d\n", addr_len);
- return -1;
- }
- if (rth->local.nl_family != AF_NETLINK) {
- fprintf(stderr, "Wrong address family %d\n", rth->local.nl_family);
- return -1;
- }
- rth->seq = time(NULL);
- return 0;
-}
-
-int rtnl_open(struct rtnl_handle *rth, unsigned subscriptions)
-{
- return rtnl_open_byproto(rth, subscriptions, NETLINK_ROUTE);
-}
-
-int rtnl_wilddump_request(struct rtnl_handle *rth, int family, int type)
-{
- return rtnl_wilddump_req_filter(rth, family, type, RTEXT_FILTER_VF);
-}
-
-int rtnl_wilddump_req_filter(struct rtnl_handle *rth, int family, int type,
- __u32 filt_mask)
-{
- struct {
- struct nlmsghdr nlh;
- struct ifinfomsg ifm;
- /* attribute has to be NLMSG aligned */
- struct rtattr ext_req __attribute__ ((aligned(NLMSG_ALIGNTO)));
- __u32 ext_filter_mask;
- } req;
-
- memset(&req, 0, sizeof(req));
- req.nlh.nlmsg_len = sizeof(req);
- req.nlh.nlmsg_type = type;
- req.nlh.nlmsg_flags = NLM_F_DUMP|NLM_F_REQUEST;
- req.nlh.nlmsg_pid = 0;
- req.nlh.nlmsg_seq = rth->dump = ++rth->seq;
- req.ifm.ifi_family = family;
-
- req.ext_req.rta_type = IFLA_EXT_MASK;
- req.ext_req.rta_len = RTA_LENGTH(sizeof(__u32));
- req.ext_filter_mask = filt_mask;
-
- return send(rth->fd, (void*)&req, sizeof(req), 0);
-}
-
-int rtnl_send(struct rtnl_handle *rth, const void *buf, int len)
-{
- return send(rth->fd, buf, len, 0);
-}
-
-int rtnl_send_check(struct rtnl_handle *rth, const void *buf, int len)
-{
- struct nlmsghdr *h;
- int status;
- char resp[1024];
-
- status = send(rth->fd, buf, len, 0);
- if (status < 0)
- return status;
-
- /* Check for immediate errors */
- status = recv(rth->fd, resp, sizeof(resp), MSG_DONTWAIT|MSG_PEEK);
- if (status < 0) {
- if (errno == EAGAIN)
- return 0;
- return -1;
- }
-
- for (h = (struct nlmsghdr *)resp; NLMSG_OK(h, status);
- h = NLMSG_NEXT(h, status)) {
- if (h->nlmsg_type == NLMSG_ERROR) {
- struct nlmsgerr *err = (struct nlmsgerr*)NLMSG_DATA(h);
- if (h->nlmsg_len < NLMSG_LENGTH(sizeof(struct nlmsgerr)))
- fprintf(stderr, "ERROR truncated\n");
- else
- errno = -err->error;
- return -1;
- }
- }
-
- return 0;
-}
-
-int rtnl_dump_request(struct rtnl_handle *rth, int type, void *req, int len)
-{
- struct nlmsghdr nlh;
- struct sockaddr_nl nladdr = { .nl_family = AF_NETLINK };
- struct iovec iov[2] = {
- { .iov_base = &nlh, .iov_len = sizeof(nlh) },
- { .iov_base = req, .iov_len = len }
- };
- struct msghdr msg = {
- .msg_name = &nladdr,
- .msg_namelen = sizeof(nladdr),
- .msg_iov = iov,
- .msg_iovlen = 2,
- };
-
- nlh.nlmsg_len = NLMSG_LENGTH(len);
- nlh.nlmsg_type = type;
- nlh.nlmsg_flags = NLM_F_DUMP|NLM_F_REQUEST;
- nlh.nlmsg_pid = 0;
- nlh.nlmsg_seq = rth->dump = ++rth->seq;
-
- return sendmsg(rth->fd, &msg, 0);
-}
-
-int rtnl_dump_filter_l(struct rtnl_handle *rth,
- const struct rtnl_dump_filter_arg *arg)
-{
- struct sockaddr_nl nladdr;
- struct iovec iov;
- struct msghdr msg = {
- .msg_name = &nladdr,
- .msg_namelen = sizeof(nladdr),
- .msg_iov = &iov,
- .msg_iovlen = 1,
- };
- char buf[16384];
- int dump_intr = 0;
-
- iov.iov_base = buf;
- while (1) {
- int status;
- const struct rtnl_dump_filter_arg *a;
- int found_done = 0;
- int msglen = 0;
-
- iov.iov_len = sizeof(buf);
- status = recvmsg(rth->fd, &msg, 0);
-
- if (status < 0) {
- if (errno == EINTR || errno == EAGAIN)
- continue;
- fprintf(stderr, "netlink receive error %s (%d)\n",
- strerror(errno), errno);
- return -1;
- }
-
- if (status == 0) {
- fprintf(stderr, "EOF on netlink\n");
- return -1;
- }
-
- for (a = arg; a->filter; a++) {
- struct nlmsghdr *h = (struct nlmsghdr*)buf;
- msglen = status;
-
- while (NLMSG_OK(h, msglen)) {
- int err;
-
- if (nladdr.nl_pid != 0 ||
- h->nlmsg_pid != rth->local.nl_pid ||
- h->nlmsg_seq != rth->dump)
- goto skip_it;
-
- if (h->nlmsg_flags & NLM_F_DUMP_INTR)
- dump_intr = 1;
-
- if (h->nlmsg_type == NLMSG_DONE) {
- found_done = 1;
- break; /* process next filter */
- }
- if (h->nlmsg_type == NLMSG_ERROR) {
- struct nlmsgerr *err = (struct nlmsgerr*)NLMSG_DATA(h);
- if (h->nlmsg_len < NLMSG_LENGTH(sizeof(struct nlmsgerr))) {
- fprintf(stderr,
- "ERROR truncated\n");
- } else {
- errno = -err->error;
- perror("RTNETLINK answers");
- }
- return -1;
- }
- err = a->filter(&nladdr, h, a->arg1);
- if (err < 0)
- return err;
-
-skip_it:
- h = NLMSG_NEXT(h, msglen);
- }
- }
-
- if (found_done) {
- if (dump_intr)
- fprintf(stderr,
- "Dump was interrupted and may be inconsistent.\n");
- return 0;
- }
-
- if (msg.msg_flags & MSG_TRUNC) {
- fprintf(stderr, "Message truncated\n");
- continue;
- }
- if (msglen) {
- fprintf(stderr, "!!!Remnant of size %d\n", msglen);
- exit(1);
- }
- }
-}
-
-int rtnl_dump_filter(struct rtnl_handle *rth,
- rtnl_filter_t filter,
- void *arg1)
-{
- const struct rtnl_dump_filter_arg a[2] = {
- { .filter = filter, .arg1 = arg1, },
- { .filter = NULL, .arg1 = NULL, },
- };
-
- return rtnl_dump_filter_l(rth, a);
-}
-
-int rtnl_talk(struct rtnl_handle *rtnl, struct nlmsghdr *n, pid_t peer,
- unsigned groups, struct nlmsghdr *answer)
-{
- int status;
- unsigned seq;
- struct nlmsghdr *h;
- struct sockaddr_nl nladdr;
- struct iovec iov = {
- .iov_base = (void*) n,
- .iov_len = n->nlmsg_len
- };
- struct msghdr msg = {
- .msg_name = &nladdr,
- .msg_namelen = sizeof(nladdr),
- .msg_iov = &iov,
- .msg_iovlen = 1,
- };
- char buf[16384];
-
- memset(&nladdr, 0, sizeof(nladdr));
- nladdr.nl_family = AF_NETLINK;
- nladdr.nl_pid = peer;
- nladdr.nl_groups = groups;
-
- n->nlmsg_seq = seq = ++rtnl->seq;
-
- if (answer == NULL)
- n->nlmsg_flags |= NLM_F_ACK;
-
- status = sendmsg(rtnl->fd, &msg, 0);
-
- if (status < 0) {
- perror("Cannot talk to rtnetlink");
- return -1;
- }
-
- memset(buf,0,sizeof(buf));
-
- iov.iov_base = buf;
-
- while (1) {
- iov.iov_len = sizeof(buf);
- status = recvmsg(rtnl->fd, &msg, 0);
-
- if (status < 0) {
- if (errno == EINTR || errno == EAGAIN)
- continue;
- fprintf(stderr, "netlink receive error %s (%d)\n",
- strerror(errno), errno);
- return -1;
- }
- if (status == 0) {
- fprintf(stderr, "EOF on netlink\n");
- return -1;
- }
- if (msg.msg_namelen != sizeof(nladdr)) {
- fprintf(stderr, "sender address length == %d\n", msg.msg_namelen);
- exit(1);
- }
- for (h = (struct nlmsghdr*)buf; status >= sizeof(*h); ) {
- int len = h->nlmsg_len;
- int l = len - sizeof(*h);
-
- if (l < 0 || len>status) {
- if (msg.msg_flags & MSG_TRUNC) {
- fprintf(stderr, "Truncated message\n");
- return -1;
- }
- fprintf(stderr, "!!!malformed message: len=%d\n", len);
- exit(1);
- }
-
- if (nladdr.nl_pid != peer ||
- h->nlmsg_pid != rtnl->local.nl_pid ||
- h->nlmsg_seq != seq) {
- /* Don't forget to skip that message. */
- status -= NLMSG_ALIGN(len);
- h = (struct nlmsghdr*)((char*)h + NLMSG_ALIGN(len));
- continue;
- }
-
- if (h->nlmsg_type == NLMSG_ERROR) {
- struct nlmsgerr *err = (struct nlmsgerr*)NLMSG_DATA(h);
- if (l < sizeof(struct nlmsgerr)) {
- fprintf(stderr, "ERROR truncated\n");
- } else {
- if (!err->error) {
- if (answer)
- memcpy(answer, h, h->nlmsg_len);
- return 0;
- }
-
- fprintf(stderr, "RTNETLINK answers: %s\n", strerror(-err->error));
- errno = -err->error;
- }
- return -1;
- }
- if (answer) {
- memcpy(answer, h, h->nlmsg_len);
- return 0;
- }
-
- fprintf(stderr, "Unexpected reply!!!\n");
-
- status -= NLMSG_ALIGN(len);
- h = (struct nlmsghdr*)((char*)h + NLMSG_ALIGN(len));
- }
- if (msg.msg_flags & MSG_TRUNC) {
- fprintf(stderr, "Message truncated\n");
- continue;
- }
- if (status) {
- fprintf(stderr, "!!!Remnant of size %d\n", status);
- exit(1);
- }
- }
-}
-
-int rtnl_listen(struct rtnl_handle *rtnl,
- rtnl_filter_t handler,
- void *jarg)
-{
- int status;
- struct nlmsghdr *h;
- struct sockaddr_nl nladdr;
- struct iovec iov;
- struct msghdr msg = {
- .msg_name = &nladdr,
- .msg_namelen = sizeof(nladdr),
- .msg_iov = &iov,
- .msg_iovlen = 1,
- };
- char buf[8192];
-
- memset(&nladdr, 0, sizeof(nladdr));
- nladdr.nl_family = AF_NETLINK;
- nladdr.nl_pid = 0;
- nladdr.nl_groups = 0;
-
- iov.iov_base = buf;
- while (1) {
- iov.iov_len = sizeof(buf);
- status = recvmsg(rtnl->fd, &msg, 0);
-
- if (status < 0) {
- if (errno == EINTR || errno == EAGAIN)
- continue;
- fprintf(stderr, "netlink receive error %s (%d)\n",
- strerror(errno), errno);
- if (errno == ENOBUFS)
- continue;
- return -1;
- }
- if (status == 0) {
- fprintf(stderr, "EOF on netlink\n");
- return -1;
- }
- if (msg.msg_namelen != sizeof(nladdr)) {
- fprintf(stderr, "Sender address length == %d\n", msg.msg_namelen);
- exit(1);
- }
- for (h = (struct nlmsghdr*)buf; status >= sizeof(*h); ) {
- int err;
- int len = h->nlmsg_len;
- int l = len - sizeof(*h);
-
- if (l<0 || len>status) {
- if (msg.msg_flags & MSG_TRUNC) {
- fprintf(stderr, "Truncated message\n");
- return -1;
- }
- fprintf(stderr, "!!!malformed message: len=%d\n", len);
- exit(1);
- }
-
- err = handler(&nladdr, h, jarg);
- if (err < 0)
- return err;
-
- status -= NLMSG_ALIGN(len);
- h = (struct nlmsghdr*)((char*)h + NLMSG_ALIGN(len));
- }
- if (msg.msg_flags & MSG_TRUNC) {
- fprintf(stderr, "Message truncated\n");
- continue;
- }
- if (status) {
- fprintf(stderr, "!!!Remnant of size %d\n", status);
- exit(1);
- }
- }
-}
-
-int rtnl_from_file(FILE *rtnl, rtnl_filter_t handler,
- void *jarg)
-{
- int status;
- struct sockaddr_nl nladdr;
- char buf[8192];
- struct nlmsghdr *h = (void*)buf;
-
- memset(&nladdr, 0, sizeof(nladdr));
- nladdr.nl_family = AF_NETLINK;
- nladdr.nl_pid = 0;
- nladdr.nl_groups = 0;
-
- while (1) {
- int err, len;
- int l;
-
- status = fread(&buf, 1, sizeof(*h), rtnl);
-
- if (status < 0) {
- if (errno == EINTR)
- continue;
- perror("rtnl_from_file: fread");
- return -1;
- }
- if (status == 0)
- return 0;
-
- len = h->nlmsg_len;
- l = len - sizeof(*h);
-
- if (l<0 || len>sizeof(buf)) {
- fprintf(stderr, "!!!malformed message: len=%d @%lu\n",
- len, ftell(rtnl));
- return -1;
- }
-
- status = fread(NLMSG_DATA(h), 1, NLMSG_ALIGN(l), rtnl);
-
- if (status < 0) {
- perror("rtnl_from_file: fread");
- return -1;
- }
- if (status < l) {
- fprintf(stderr, "rtnl-from_file: truncated message\n");
- return -1;
- }
-
- err = handler(&nladdr, h, jarg);
- if (err < 0)
- return err;
- }
-}
-
-int addattr(struct nlmsghdr *n, int maxlen, int type)
-{
- return addattr_l(n, maxlen, type, NULL, 0);
-}
-
-int addattr8(struct nlmsghdr *n, int maxlen, int type, __u8 data)
-{
- return addattr_l(n, maxlen, type, &data, sizeof(__u8));
-}
-
-int addattr16(struct nlmsghdr *n, int maxlen, int type, __u16 data)
-{
- return addattr_l(n, maxlen, type, &data, sizeof(__u16));
-}
-
-int addattr32(struct nlmsghdr *n, int maxlen, int type, __u32 data)
-{
- return addattr_l(n, maxlen, type, &data, sizeof(__u32));
-}
-
-int addattr64(struct nlmsghdr *n, int maxlen, int type, __u64 data)
-{
- return addattr_l(n, maxlen, type, &data, sizeof(__u64));
-}
-
-int addattrstrz(struct nlmsghdr *n, int maxlen, int type, const char *str)
-{
- return addattr_l(n, maxlen, type, str, strlen(str)+1);
-}
-
-int addattr_l(struct nlmsghdr *n, int maxlen, int type, const void *data,
- int alen)
-{
- int len = RTA_LENGTH(alen);
- struct rtattr *rta;
-
- if (NLMSG_ALIGN(n->nlmsg_len) + RTA_ALIGN(len) > maxlen) {
- fprintf(stderr, "addattr_l ERROR: message exceeded bound of %d\n",maxlen);
- return -1;
- }
- rta = NLMSG_TAIL(n);
- rta->rta_type = type;
- rta->rta_len = len;
- memcpy(RTA_DATA(rta), data, alen);
- n->nlmsg_len = NLMSG_ALIGN(n->nlmsg_len) + RTA_ALIGN(len);
- return 0;
-}
-
-int addraw_l(struct nlmsghdr *n, int maxlen, const void *data, int len)
-{
- if (NLMSG_ALIGN(n->nlmsg_len) + NLMSG_ALIGN(len) > maxlen) {
- fprintf(stderr, "addraw_l ERROR: message exceeded bound of %d\n",maxlen);
- return -1;
- }
-
- memcpy(NLMSG_TAIL(n), data, len);
- memset((void *) NLMSG_TAIL(n) + len, 0, NLMSG_ALIGN(len) - len);
- n->nlmsg_len = NLMSG_ALIGN(n->nlmsg_len) + NLMSG_ALIGN(len);
- return 0;
-}
-
-struct rtattr *addattr_nest(struct nlmsghdr *n, int maxlen, int type)
-{
- struct rtattr *nest = NLMSG_TAIL(n);
-
- addattr_l(n, maxlen, type, NULL, 0);
- return nest;
-}
-
-int addattr_nest_end(struct nlmsghdr *n, struct rtattr *nest)
-{
- nest->rta_len = (void *)NLMSG_TAIL(n) - (void *)nest;
- return n->nlmsg_len;
-}
-
-struct rtattr *addattr_nest_compat(struct nlmsghdr *n, int maxlen, int type,
- const void *data, int len)
-{
- struct rtattr *start = NLMSG_TAIL(n);
-
- addattr_l(n, maxlen, type, data, len);
- addattr_nest(n, maxlen, type);
- return start;
-}
-
-int addattr_nest_compat_end(struct nlmsghdr *n, struct rtattr *start)
-{
- struct rtattr *nest = (void *)start + NLMSG_ALIGN(start->rta_len);
-
- start->rta_len = (void *)NLMSG_TAIL(n) - (void *)start;
- addattr_nest_end(n, nest);
- return n->nlmsg_len;
-}
-
-int rta_addattr32(struct rtattr *rta, int maxlen, int type, __u32 data)
-{
- int len = RTA_LENGTH(4);
- struct rtattr *subrta;
-
- if (RTA_ALIGN(rta->rta_len) + len > maxlen) {
- fprintf(stderr,"rta_addattr32: Error! max allowed bound %d exceeded\n",maxlen);
- return -1;
- }
- subrta = (struct rtattr*)(((char*)rta) + RTA_ALIGN(rta->rta_len));
- subrta->rta_type = type;
- subrta->rta_len = len;
- memcpy(RTA_DATA(subrta), &data, 4);
- rta->rta_len = NLMSG_ALIGN(rta->rta_len) + len;
- return 0;
-}
-
-int rta_addattr_l(struct rtattr *rta, int maxlen, int type,
- const void *data, int alen)
-{
- struct rtattr *subrta;
- int len = RTA_LENGTH(alen);
-
- if (RTA_ALIGN(rta->rta_len) + RTA_ALIGN(len) > maxlen) {
- fprintf(stderr,"rta_addattr_l: Error! max allowed bound %d exceeded\n",maxlen);
- return -1;
- }
- subrta = (struct rtattr*)(((char*)rta) + RTA_ALIGN(rta->rta_len));
- subrta->rta_type = type;
- subrta->rta_len = len;
- memcpy(RTA_DATA(subrta), data, alen);
- rta->rta_len = NLMSG_ALIGN(rta->rta_len) + RTA_ALIGN(len);
- return 0;
-}
-
-int parse_rtattr(struct rtattr *tb[], int max, struct rtattr *rta, int len)
-{
- return parse_rtattr_flags(tb, max, rta, len, 0);
-}
-
-int parse_rtattr_flags(struct rtattr *tb[], int max, struct rtattr *rta,
- int len, unsigned short flags)
-{
- unsigned short type;
-
- memset(tb, 0, sizeof(struct rtattr *) * (max + 1));
- while (RTA_OK(rta, len)) {
- type = rta->rta_type & ~flags;
- if ((type <= max) && (!tb[type]))
- tb[type] = rta;
- rta = RTA_NEXT(rta,len);
- }
- if (len)
- fprintf(stderr, "!!!Deficit %d, rta_len=%d\n", len, rta->rta_len);
- return 0;
-}
-
-int parse_rtattr_byindex(struct rtattr *tb[], int max, struct rtattr *rta, int len)
-{
- int i = 0;
-
- memset(tb, 0, sizeof(struct rtattr *) * max);
- while (RTA_OK(rta, len)) {
- if (rta->rta_type <= max && i < max)
- tb[i++] = rta;
- rta = RTA_NEXT(rta,len);
- }
- if (len)
- fprintf(stderr, "!!!Deficit %d, rta_len=%d\n", len, rta->rta_len);
- return i;
-}
-
-int __parse_rtattr_nested_compat(struct rtattr *tb[], int max, struct rtattr *rta,
- int len)
-{
- if (RTA_PAYLOAD(rta) < len)
- return -1;
- if (RTA_PAYLOAD(rta) >= RTA_ALIGN(len) + sizeof(struct rtattr)) {
- rta = RTA_DATA(rta) + RTA_ALIGN(len);
- return parse_rtattr_nested(tb, max, rta);
- }
- memset(tb, 0, sizeof(struct rtattr *) * (max + 1));
- return 0;
-}
diff --git a/meta-facebook/meta-yosemite/recipes-yosemite/oob-nic/oob-nic/src/libnetlink.h b/meta-facebook/meta-yosemite/recipes-yosemite/oob-nic/oob-nic/src/libnetlink.h
deleted file mode 100644
index 9e72692..0000000
--- a/meta-facebook/meta-yosemite/recipes-yosemite/oob-nic/oob-nic/src/libnetlink.h
+++ /dev/null
@@ -1,161 +0,0 @@
-/*
- * Note: Original file from iproute2 package
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-#ifndef __LIBNETLINK_H__
-#define __LIBNETLINK_H__ 1
-
-#include <stdio.h>
-#include <string.h>
-#include <asm/types.h>
-#include <linux/netlink.h>
-#include <linux/rtnetlink.h>
-#include <linux/if_link.h>
-#include <linux/if_addr.h>
-#include <linux/neighbour.h>
-#include <linux/netconf.h>
-
-struct rtnl_handle
-{
- int fd;
- struct sockaddr_nl local;
- struct sockaddr_nl peer;
- __u32 seq;
- __u32 dump;
-};
-
-extern int rcvbuf;
-
-extern int rtnl_open(struct rtnl_handle *rth, unsigned subscriptions);
-extern int rtnl_open_byproto(struct rtnl_handle *rth, unsigned subscriptions, int protocol);
-extern void rtnl_close(struct rtnl_handle *rth);
-extern int rtnl_wilddump_request(struct rtnl_handle *rth, int fam, int type);
-extern int rtnl_wilddump_req_filter(struct rtnl_handle *rth, int fam, int type,
- __u32 filt_mask);
-extern int rtnl_dump_request(struct rtnl_handle *rth, int type, void *req, int len);
-
-typedef int (*rtnl_filter_t)(const struct sockaddr_nl *,
- struct nlmsghdr *n, void *);
-
-struct rtnl_dump_filter_arg
-{
- rtnl_filter_t filter;
- void *arg1;
-};
-
-extern int rtnl_dump_filter_l(struct rtnl_handle *rth,
- const struct rtnl_dump_filter_arg *arg);
-extern int rtnl_dump_filter(struct rtnl_handle *rth, rtnl_filter_t filter,
- void *arg);
-extern int rtnl_talk(struct rtnl_handle *rtnl, struct nlmsghdr *n, pid_t peer,
- unsigned groups, struct nlmsghdr *answer);
-extern int rtnl_send(struct rtnl_handle *rth, const void *buf, int);
-extern int rtnl_send_check(struct rtnl_handle *rth, const void *buf, int);
-
-extern int addattr(struct nlmsghdr *n, int maxlen, int type);
-extern int addattr8(struct nlmsghdr *n, int maxlen, int type, __u8 data);
-extern int addattr16(struct nlmsghdr *n, int maxlen, int type, __u16 data);
-extern int addattr32(struct nlmsghdr *n, int maxlen, int type, __u32 data);
-extern int addattr64(struct nlmsghdr *n, int maxlen, int type, __u64 data);
-extern int addattrstrz(struct nlmsghdr *n, int maxlen, int type, const char *data);
-
-extern int addattr_l(struct nlmsghdr *n, int maxlen, int type, const void *data, int alen);
-extern int addraw_l(struct nlmsghdr *n, int maxlen, const void *data, int len);
-extern struct rtattr *addattr_nest(struct nlmsghdr *n, int maxlen, int type);
-extern int addattr_nest_end(struct nlmsghdr *n, struct rtattr *nest);
-extern struct rtattr *addattr_nest_compat(struct nlmsghdr *n, int maxlen, int type, const void *data, int len);
-extern int addattr_nest_compat_end(struct nlmsghdr *n, struct rtattr *nest);
-extern int rta_addattr32(struct rtattr *rta, int maxlen, int type, __u32 data);
-extern int rta_addattr_l(struct rtattr *rta, int maxlen, int type, const void *data, int alen);
-
-extern int parse_rtattr(struct rtattr *tb[], int max, struct rtattr *rta, int len);
-extern int parse_rtattr_flags(struct rtattr *tb[], int max, struct rtattr *rta,
- int len, unsigned short flags);
-extern int parse_rtattr_byindex(struct rtattr *tb[], int max, struct rtattr *rta, int len);
-extern int __parse_rtattr_nested_compat(struct rtattr *tb[], int max, struct rtattr *rta, int len);
-
-#define parse_rtattr_nested(tb, max, rta) \
- (parse_rtattr((tb), (max), RTA_DATA(rta), RTA_PAYLOAD(rta)))
-
-#define parse_rtattr_nested_compat(tb, max, rta, data, len) \
- ({ data = RTA_PAYLOAD(rta) >= len ? RTA_DATA(rta) : NULL; \
- __parse_rtattr_nested_compat(tb, max, rta, len); })
-
-static inline __u8 rta_getattr_u8(const struct rtattr *rta)
-{
- return *(__u8 *)RTA_DATA(rta);
-}
-static inline __u16 rta_getattr_u16(const struct rtattr *rta)
-{
- return *(__u16 *)RTA_DATA(rta);
-}
-static inline __u32 rta_getattr_u32(const struct rtattr *rta)
-{
- return *(__u32 *)RTA_DATA(rta);
-}
-static inline __u64 rta_getattr_u64(const struct rtattr *rta)
-{
- __u64 tmp;
- memcpy(&tmp, RTA_DATA(rta), sizeof(__u64));
- return tmp;
-}
-static inline const char *rta_getattr_str(const struct rtattr *rta)
-{
- return (const char *)RTA_DATA(rta);
-}
-
-extern int rtnl_listen(struct rtnl_handle *, rtnl_filter_t handler,
- void *jarg);
-extern int rtnl_from_file(FILE *, rtnl_filter_t handler,
- void *jarg);
-
-#define NLMSG_TAIL(nmsg) \
- ((struct rtattr *) (((void *) (nmsg)) + NLMSG_ALIGN((nmsg)->nlmsg_len)))
-
-#ifndef IFA_RTA
-#define IFA_RTA(r) \
- ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct ifaddrmsg))))
-#endif
-#ifndef IFA_PAYLOAD
-#define IFA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct ifaddrmsg))
-#endif
-
-#ifndef IFLA_RTA
-#define IFLA_RTA(r) \
- ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct ifinfomsg))))
-#endif
-#ifndef IFLA_PAYLOAD
-#define IFLA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct ifinfomsg))
-#endif
-
-#ifndef NDA_RTA
-#define NDA_RTA(r) \
- ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct ndmsg))))
-#endif
-#ifndef NDA_PAYLOAD
-#define NDA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct ndmsg))
-#endif
-
-#ifndef NDTA_RTA
-#define NDTA_RTA(r) \
- ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct ndtmsg))))
-#endif
-#ifndef NDTA_PAYLOAD
-#define NDTA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct ndtmsg))
-#endif
-
-#endif /* __LIBNETLINK_H__ */
-
diff --git a/meta-facebook/meta-yosemite/recipes-yosemite/oob-nic/oob-nic/src/ll_map.c b/meta-facebook/meta-yosemite/recipes-yosemite/oob-nic/oob-nic/src/ll_map.c
deleted file mode 100644
index 64e5069..0000000
--- a/meta-facebook/meta-yosemite/recipes-yosemite/oob-nic/oob-nic/src/ll_map.c
+++ /dev/null
@@ -1,225 +0,0 @@
-/*
- * Note: Original file from iproute2 package
- *
- * ll_map.c
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version
- * 2 of the License, or (at your option) any later version.
- *
- * Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru>
- *
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <syslog.h>
-#include <fcntl.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <string.h>
-#include <net/if.h>
-
-#include "libnetlink.h"
-#include "ll_map.h"
-#include "hlist.h"
-
-struct ll_cache {
- struct hlist_node idx_hash;
- struct hlist_node name_hash;
- unsigned flags;
- int index;
- unsigned short type;
- char name[IFNAMSIZ];
-};
-
-#define IDXMAP_SIZE 1024
-static struct hlist_head idx_head[IDXMAP_SIZE];
-static struct hlist_head name_head[IDXMAP_SIZE];
-
-static struct ll_cache *ll_get_by_index(unsigned index)
-{
- struct hlist_node *n;
- unsigned h = index & (IDXMAP_SIZE - 1);
-
- hlist_for_each(n, &idx_head[h]) {
- struct ll_cache *im
- = container_of(n, struct ll_cache, idx_hash);
- if (im->index == index)
- return im;
- }
-
- return NULL;
-}
-
-static unsigned namehash(const char *str)
-{
- unsigned hash = 5381;
-
- while (*str)
- hash = ((hash << 5) + hash) + *str++; /* hash * 33 + c */
-
- return hash;
-}
-
-static struct ll_cache *ll_get_by_name(const char *name)
-{
- struct hlist_node *n;
- unsigned h = namehash(name) & (IDXMAP_SIZE - 1);
-
- hlist_for_each(n, &name_head[h]) {
- struct ll_cache *im
- = container_of(n, struct ll_cache, name_hash);
-
- if (strncmp(im->name, name, IFNAMSIZ) == 0)
- return im;
- }
-
- return NULL;
-}
-
-int ll_remember_index(const struct sockaddr_nl *who,
- struct nlmsghdr *n, void *arg)
-{
- unsigned int h;
- const char *ifname;
- struct ifinfomsg *ifi = NLMSG_DATA(n);
- struct ll_cache *im;
- struct rtattr *tb[IFLA_MAX+1];
-
- if (n->nlmsg_type != RTM_NEWLINK && n->nlmsg_type != RTM_DELLINK)
- return 0;
-
- if (n->nlmsg_len < NLMSG_LENGTH(sizeof(ifi)))
- return -1;
-
- im = ll_get_by_index(ifi->ifi_index);
- if (n->nlmsg_type == RTM_DELLINK) {
- if (im) {
- hlist_del(&im->name_hash);
- hlist_del(&im->idx_hash);
- free(im);
- }
- return 0;
- }
-
- memset(tb, 0, sizeof(tb));
- parse_rtattr(tb, IFLA_MAX, IFLA_RTA(ifi), IFLA_PAYLOAD(n));
- ifname = rta_getattr_str(tb[IFLA_IFNAME]);
- if (ifname == NULL)
- return 0;
-
- if (im) {
- /* change to existing entry */
- if (strcmp(im->name, ifname) != 0) {
- hlist_del(&im->name_hash);
- h = namehash(ifname) & (IDXMAP_SIZE - 1);
- hlist_add_head(&im->name_hash, &name_head[h]);
- }
-
- im->flags = ifi->ifi_flags;
- return 0;
- }
-
- im = malloc(sizeof(*im));
- if (im == NULL)
- return 0;
- im->index = ifi->ifi_index;
- strcpy(im->name, ifname);
- im->type = ifi->ifi_type;
- im->flags = ifi->ifi_flags;
-
- h = ifi->ifi_index & (IDXMAP_SIZE - 1);
- hlist_add_head(&im->idx_hash, &idx_head[h]);
-
- h = namehash(ifname) & (IDXMAP_SIZE - 1);
- hlist_add_head(&im->name_hash, &name_head[h]);
-
- return 0;
-}
-
-const char *ll_idx_n2a(unsigned idx, char *buf)
-{
- const struct ll_cache *im;
-
- if (idx == 0)
- return "*";
-
- im = ll_get_by_index(idx);
- if (im)
- return im->name;
-
- if (if_indextoname(idx, buf) == NULL)
- snprintf(buf, IFNAMSIZ, "if%d", idx);
-
- return buf;
-}
-
-const char *ll_index_to_name(unsigned idx)
-{
- static char nbuf[IFNAMSIZ];
-
- return ll_idx_n2a(idx, nbuf);
-}
-
-int ll_index_to_type(unsigned idx)
-{
- const struct ll_cache *im;
-
- if (idx == 0)
- return -1;
-
- im = ll_get_by_index(idx);
- return im ? im->type : -1;
-}
-
-unsigned ll_index_to_flags(unsigned idx)
-{
- const struct ll_cache *im;
-
- if (idx == 0)
- return 0;
-
- im = ll_get_by_index(idx);
- return im ? im->flags : -1;
-}
-
-unsigned ll_name_to_index(const char *name)
-{
- const struct ll_cache *im;
- unsigned idx;
-
- if (name == NULL)
- return 0;
-
- im = ll_get_by_name(name);
- if (im)
- return im->index;
-
- idx = if_nametoindex(name);
- if (idx == 0)
- sscanf(name, "if%u", &idx);
- return idx;
-}
-
-void ll_init_map(struct rtnl_handle *rth)
-{
- static int initialized;
-
- if (initialized)
- return;
-
- if (rtnl_wilddump_request(rth, AF_UNSPEC, RTM_GETLINK) < 0) {
- perror("Cannot send dump request");
- exit(1);
- }
-
- if (rtnl_dump_filter(rth, ll_remember_index, NULL) < 0) {
- fprintf(stderr, "Dump terminated\n");
- exit(1);
- }
-
- initialized = 1;
-}
diff --git a/meta-facebook/meta-yosemite/recipes-yosemite/oob-nic/oob-nic/src/ll_map.h b/meta-facebook/meta-yosemite/recipes-yosemite/oob-nic/oob-nic/src/ll_map.h
deleted file mode 100644
index d74a46f..0000000
--- a/meta-facebook/meta-yosemite/recipes-yosemite/oob-nic/oob-nic/src/ll_map.h
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Note: Original file from iproute2 package
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-
-#ifndef __LL_MAP_H__
-#define __LL_MAP_H__ 1
-
-extern int ll_remember_index(const struct sockaddr_nl *who,
- struct nlmsghdr *n, void *arg);
-
-extern void ll_init_map(struct rtnl_handle *rth);
-extern unsigned ll_name_to_index(const char *name);
-extern const char *ll_index_to_name(unsigned idx);
-extern const char *ll_idx_n2a(unsigned idx, char *buf);
-extern int ll_index_to_type(unsigned idx);
-extern unsigned ll_index_to_flags(unsigned idx);
-
-#endif /* __LL_MAP_H__ */
diff --git a/meta-facebook/meta-yosemite/recipes-yosemite/oob-nic/oob-nic/src/main.c b/meta-facebook/meta-yosemite/recipes-yosemite/oob-nic/oob-nic/src/main.c
deleted file mode 100644
index 4312402..0000000
--- a/meta-facebook/meta-yosemite/recipes-yosemite/oob-nic/oob-nic/src/main.c
+++ /dev/null
@@ -1,192 +0,0 @@
-/*
- * Copyright 2014-present Facebook. All Rights Reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-#include <stdio.h>
-#include <unistd.h>
-#include <sys/select.h>
-#include <sys/time.h>
-#include <sys/errno.h>
-
-#include "nic.h"
-#include "intf.h"
-
-#include "facebook/log.h"
-#include "facebook/wedge_eeprom.h"
-
-#define WAIT4PACKET_TIMEOUT 10000 /* 10ms */
-#define NO_RCV_CHECK_THRESHOLD 100 /* if not receiving pkt for 100 times (1s),
- * check the NIC status
- */
-
-static void io_loop(oob_nic *nic, oob_intf *intf, const uint8_t mac[6]) {
-
- fd_set rfds;
- int fd = oob_intf_get_fd(intf);
- struct timeval timeout;
- int rc;
- int n_fds;
- int n_io;
- char buf[NIC_PKT_SIZE_MAX];
- int no_rcv = 0;
- struct oob_nic_status_t sts;
-
- while (1) {
- memset(&timeout, 0, sizeof(timeout));
- timeout.tv_sec = 0;
- timeout.tv_usec = WAIT4PACKET_TIMEOUT;
-
- FD_ZERO(&rfds);
- FD_SET(fd, &rfds);
-
- n_fds = select(fd + 1, &rfds, NULL, NULL, &timeout);
- if (n_fds < 0) {
- rc = errno;
- LOG_ERR(rc, "Failed to select");
- continue;
- }
-
- /*
- * no matter what, receive packet from nic first, as the nic
- * has small amount of memory. Without read, the sending could
- * fail due to OOM.
- *
- * TODO: We might want to do something smart here to prevent attack or
- * just rx flooding. Disable the Receive Enable first, drain the buffer
- * with oob_nic_receive(), then Tx, and enable Receive Enable after.
- */
- for (n_io = 0; n_io < 16; n_io++) {
- rc = oob_nic_receive(nic, buf, sizeof(buf));
- if (rc <= 0) {
- no_rcv++;
- break;
- }
- oob_intf_send(intf, buf, rc);
- no_rcv = 0;
- }
-
- /*
- * if we didn't receive any packet for NO_RCV_CHECK_THRESHOLD times,
- * check the nic status
- */
- if (no_rcv >= NO_RCV_CHECK_THRESHOLD) {
- while(oob_nic_get_status(nic, &sts)) {
- usleep(1000);
- }
- LOG_INFO("Failed to receive packets for %d times. NIC status is "
- "%x.%x", NO_RCV_CHECK_THRESHOLD, sts.ons_byte1, sts.ons_byte2);
- /*
- * if the NIC went through initialization, or not set force up, need to
- * re-program the filters by calling oob_nic_start().
- */
- if ((sts.ons_byte1 & NIC_STATUS_D1_INIT)
- || !(sts.ons_byte1 & NIC_STATUS_D1_FORCE_UP)) {
- while(oob_nic_start(nic, mac)) {
- usleep(1000);
- }
- }
- no_rcv = 0;
- }
-
- if (n_fds > 0 && FD_ISSET(fd, &rfds)) {
- for (n_io = 0; n_io < 1; n_io++) {
- rc = oob_intf_receive(intf, buf, sizeof(buf));
- if (rc <= 0) {
- break;
- }
- oob_nic_send(nic, buf, rc);
- }
- }
- }
-}
-
-int main(int argc, const char **argv) {
-
- uint8_t mac[6];
- oob_nic *nic;
- oob_intf *intf;
- struct wedge_eeprom_st eeprom;
- int rc;
- int from_eeprom = 0;
-
- nic = oob_nic_open(0, 0x49);
- if (!nic) {
- return -1;
- }
-
- /* read EEPROM for the MAC */
- if (wedge_eeprom_parse(NULL, &eeprom) == 0) {
- if (eeprom.fbw_mac_size <= 0) {
- LOG_ERR(EFAULT, "Invalid extended MAC size: %d", eeprom.fbw_mac_size);
- } else {
- uint16_t carry;
- int pos;
- /* use the last MAC address from the extended MAC range */
- memcpy(mac, eeprom.fbw_mac_base, sizeof(mac));
- if (eeprom.fbw_mac_size > 128) {
- LOG_ERR(EFAULT, "Extended MAC size (%d) is too large.",
- eeprom.fbw_mac_size);
- carry = 127;
- } else {
- /*
- * hack around bug device which have the same MAC address on
- * left and right.
- */
- if (strncmp(eeprom.fbw_location, "LEFT", FBW_EEPROM_F_LOCATION) == 0) {
- carry = eeprom.fbw_mac_size - 2;
- } else {
- carry = eeprom.fbw_mac_size - 1;
- }
- }
- for (pos = sizeof(mac) - 1; pos >= 0 && carry; pos--) {
- uint16_t tmp = mac[pos] + carry;
- mac[pos] = tmp & 0xFF;
- carry = tmp >> 8;
- }
- from_eeprom = 1;
- }
- }
-
- if (!from_eeprom) {
- while (oob_nic_get_mac(nic, mac)) {
- usleep(1000);
- }
- /*
- * increase the last byte of the mac by 1 and turn on the
- * local administered bit to use it as the oob nic mac
- */
- mac[0] |= 0x2;
- mac[5]++;
- }
-
- LOG_INFO("Retrieve MAC %x:%x:%x:%x:%x:%x from %s",
- mac[0], mac[1], mac[2], mac[3], mac[4], mac[5],
- (from_eeprom) ? "EEPROM" : "NIC");
-
- /* create the tap interface */
- intf = oob_intf_create("oob", mac);
- if (!intf) {
- return -1;
- }
-
- while (oob_nic_start(nic, mac)) {
- usleep(1000);
- }
-
- io_loop(nic, intf, mac);
-
- return 0;
-}
diff --git a/meta-facebook/meta-yosemite/recipes-yosemite/oob-nic/oob-nic/src/nic.c b/meta-facebook/meta-yosemite/recipes-yosemite/oob-nic/oob-nic/src/nic.c
deleted file mode 100644
index a4dc071..0000000
--- a/meta-facebook/meta-yosemite/recipes-yosemite/oob-nic/oob-nic/src/nic.c
+++ /dev/null
@@ -1,487 +0,0 @@
-/*
- * Copyright 2014-present Facebook. All Rights Reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-#include "nic.h"
-
-#include <errno.h>
-#include <fcntl.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/ioctl.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-
-#include "facebook/i2c-dev.h"
-#include "facebook/log.h"
-
-struct oob_nic_t {
- int on_bus;
- uint8_t on_addr;
- int on_file; /* the file descriptor */
- uint8_t on_mac[6]; /* the mac address assigned to this NIC */
-};
-
-oob_nic* oob_nic_open(int bus, uint8_t addr) {
- oob_nic *dev = NULL;
- char fn[32];
- int rc;
-
- /* address must be 7 bits maximum */
- if ((addr & 0x80)) {
- LOG_ERR(EINVAL, "Address 0x%x has the 8th bit", addr);
- return NULL;
- }
-
- dev = calloc(1, sizeof(*dev));
- if (!dev) {
- return NULL;
- }
- dev->on_bus = bus;
- dev->on_addr = addr;
-
- /* construct the device file name */
- snprintf(fn, sizeof(fn), "/dev/i2c-%d", bus);
- dev->on_file = open(fn, O_RDWR);
- if (dev->on_file == -1) {
- LOG_ERR(errno, "Failed to open i2c device %s", fn);
- goto err_out;
- }
-
- /* assign the device address */
- rc = ioctl(dev->on_file, I2C_SLAVE, dev->on_addr);
- if (rc < 0) {
- LOG_ERR(errno, "Failed to open slave @ address 0x%x", dev->on_addr);
- goto err_out;
- }
-
- return dev;
-
- err_out:
- oob_nic_close(dev);
- return NULL;
-}
-
-void oob_nic_close(oob_nic *dev) {
- if (!dev) {
- return;
- }
- if (dev->on_file != -1) {
- close(dev->on_file);
- }
- free(dev);
-}
-
-int oob_nic_get_mac(oob_nic *dev, uint8_t mac[6]) {
- int rc;
- uint8_t buf[64];
-
- rc = i2c_smbus_read_block_data(dev->on_file, NIC_READ_MAC_CMD, buf);
- if (rc < 0) {
- rc = errno;
- LOG_ERR(rc, "Failed to get MAC on %d-%x",
- dev->on_bus, dev->on_addr);
- return -rc;
- }
-
- if (rc != NIC_READ_MAC_RES_LEN) {
- LOG_ERR(EFAULT, "Unexpected response len (%d) for get MAC on %d-%x",
- rc, dev->on_bus, dev->on_addr);
- return -EFAULT;
- }
-
- if (buf[0] != NIC_READ_MAC_RES_OPT) {
- LOG_ERR(EFAULT, "Unexpected response opt code (0x%x) get MAC on %d-%x",
- buf[0], dev->on_bus, dev->on_addr);
- return -EFAULT;
- }
-
- memcpy(mac, &buf[1], 6);
-
- LOG_DBG("Get MAC on %d-%x: %x:%x:%x:%x:%x:%x", dev->on_bus, dev->on_addr,
- mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]);
- return 0;
-}
-
-int oob_nic_get_status(oob_nic *dev, oob_nic_status *status) {
- int rc;
- uint8_t buf[64];
-
- rc = i2c_smbus_read_block_data(dev->on_file, NIC_READ_STATUS_CMD, buf);
- if (rc < 0) {
- rc = errno;
- LOG_ERR(rc, "Failed to get status on %d-%x",
- dev->on_bus, dev->on_addr);
- return -rc;
- }
-
- if (rc != NIC_READ_STATUS_RES_LEN) {
- LOG_ERR(EFAULT, "Unexpected response len (%d) for get status on %d-%x",
- rc, dev->on_bus, dev->on_addr);
- return -EFAULT;
- }
-
- if (buf[0] != NIC_READ_STATUS_RES_OPT) {
- LOG_ERR(EFAULT, "Unexpected response opt code (0x%x) get status on %d-%x",
- buf[0], dev->on_bus, dev->on_addr);
- return -EFAULT;
- }
-
- memset(status, 0, sizeof(*status));
- status->ons_byte1 = buf[1];
- status->ons_byte2 = buf[2];
-
- LOG_VER("Get status on %d-%x: byte1:0x%x byte2:0x%x",
- dev->on_bus, dev->on_addr,
- status->ons_byte1, status->ons_byte2);
- return 0;
-}
-
-int oob_nic_receive(oob_nic *dev, uint8_t *buf, int len) {
-
- int rc = 0;
- uint8_t pkt[I2C_SMBUS_BLOCK_LARGE_MAX];
- uint8_t opt;
- int copied = 0;
- int to_copy;
- int expect_first = 1;
- int n_frags = 0;
-
-#define _COPY_DATA(n, data) do { \
- int to_copy; \
- if (copied >= len) { \
- break; \
- } \
- to_copy = (n < len - copied) ? n : len - copied; \
- if (to_copy) { \
- memcpy(buf + copied, data, to_copy); \
- } \
- copied += to_copy; \
-} while(0)
-
- do {
- rc = i2c_smbus_read_block_large_data(dev->on_file, NIC_READ_PKT_CMD, pkt);
- if (rc < 0) {
- rc = errno;
- LOG_ERR(rc, "Failed to get packet on %d-%x",
- dev->on_bus, dev->on_addr);
- goto err_out;
- }
- if (rc > I2C_SMBUS_BLOCK_LARGE_MAX) {
- LOG_ERR(EFAULT, "Too large i2c block (%d) received on %d-%x",
- rc, dev->on_bus, dev->on_addr);
- rc = EFAULT;
- goto err_out;
- }
- opt = pkt[0];
- switch (opt) {
- case NIC_READ_PKT_RES_FIRST_OPT:
- if (!expect_first) {
- rc = EFAULT;
- LOG_ERR(rc, "Received more than one buffer with FIRST set");
- goto err_out;
- }
- expect_first = 0;
- n_frags++;
- _COPY_DATA(rc - 1, &pkt[1]);
- break;
- case NIC_READ_PKT_RES_MIDDLE_OPT:
- if (expect_first) {
- rc = EFAULT;
- LOG_ERR(rc, "Received MIDDLE before getting FIRST");
- goto err_out;
- }
- _COPY_DATA(rc - 1, &pkt[1]);
- n_frags++;
- break;
- case NIC_READ_PKT_RES_LAST_OPT:
- if (expect_first) {
- rc = EFAULT;
- LOG_ERR(rc, "Received LAST before getting FIRST");
- goto err_out;
- }
- if (rc != NIC_READ_PKT_RES_LAST_LEN) {
- LOG_ERR(EFAULT, "Expect %d bytes (got %d) for LAST segement",
- NIC_READ_PKT_RES_LAST_LEN, rc);
- rc = EFAULT;
- goto err_out;
- }
- /* TODO: pkt status???? */
- break;
- case NIC_READ_STATUS_RES_OPT:
- /* that means no pkt available */
- if (!expect_first) {
- rc = EFAULT;
- LOG_ERR(rc, "Received STATUS in the middle of packet");
- goto err_out;
- }
- //LOG_VER("Received STATUS when receiving the packet");
- return 0;
- default:
- rc = EFAULT;
- LOG_ERR(rc, "Unexpected opt code 0x%x", opt);
- goto err_out;
- }
- } while (opt != NIC_READ_PKT_RES_LAST_OPT);
-
- LOG_VER("Received a packet with %d bytes in %d fragments", copied, n_frags);
- return copied;
-
- err_out:
- return -rc;
-#undef _COPY_DATA
-}
-
-int oob_nic_send(oob_nic *dev, const uint8_t *data, int len) {
-
- int rc;
- uint8_t to_send;
- int has_sent = 0;
- int is_first = 1;
- uint8_t cmd;
- int n_frags = 0;
-
- if (len <= 0 || len > NIC_PKT_SIZE_MAX) {
- rc = EINVAL;
- LOG_ERR(rc, "Invalid packet length %d", len);
- return -rc;
- }
-
- while (len) {
- to_send = (len < OOB_NIC_PKT_FRAGMENT_SIZE)
- ? len : OOB_NIC_PKT_FRAGMENT_SIZE;
-
- if (is_first) {
- if (to_send >= len) {
- /* this is the last pkt also */
- cmd = NIC_WRITE_PKT_SINGLE_CMD;
- } else {
- cmd = NIC_WRITE_PKT_FIRST_CMD;
- }
- is_first = 0;
- } else {
- if (to_send >= len) {
- /* this is the last pkt */
- cmd = NIC_WRITE_PKT_LAST_CMD;
- } else {
- cmd = NIC_WRITE_PKT_MIDDLE_CMD;
- }
- }
-
- rc = i2c_smbus_write_block_large_data(dev->on_file, cmd,
- to_send, data + has_sent);
- if (rc < 0) {
- rc = errno;
- LOG_ERR(rc, "Failed to sent packet with cmd 0x%x, has_sent=%d "
- "to_send=%d", cmd, has_sent, to_send);
- return -rc;
- }
-
- has_sent += to_send;
- len -= to_send;
- n_frags++;
- }
-
- LOG_VER("Sent a packet with %d bytes in %d fragments", has_sent, n_frags);
-
- return has_sent;
-}
-
-static int oob_nic_set_mng_ctrl(oob_nic *dev, const uint8_t *data, int len) {
- int rc;
-
- if (len <= 0) {
- rc = EINVAL;
- LOG_ERR(rc, "Invalid data length: %d", len);
- return -rc;
- }
-
- rc = i2c_smbus_write_block_data(dev->on_file, NIC_WRITE_MNG_CTRL_CMD,
- len, data);
- if (rc < 0) {
- rc = errno;
- LOG_ERR(rc, "Failed to send management control command for parameter # %d",
- data[0]);
- return -rc;
- }
-
- return 0;
-}
-
-static int oob_nic_set_force_up(oob_nic *dev, int enable) {
- uint8_t cmd[2];
-
- cmd[0] = NIC_MNG_CTRL_KEEP_LINK_UP_NUM;
- cmd[1] = enable
- ? NIC_MNG_CTRL_KEEP_LINK_UP_ENABLE : NIC_MNG_CTRL_KEEP_LINK_UP_DISABLE;
-
- LOG_DBG("Turn %s link force up", enable ? "on" : "off");
- return oob_nic_set_mng_ctrl(dev, cmd, sizeof(cmd));
-}
-
-static int oob_nic_setup_filters(oob_nic *dev, const uint8_t mac[6]) {
- int rc;
- int i;
- uint32_t cmd32;
- uint8_t buf[32];
- uint8_t *cmd;
-
- /*
- * Command to set MAC filter
- * Seven bytes are required to load the MAC address filters.
- * Data 2—MAC address filters pair number (3:0).
- * Data 3—MSB of MAC address.
- * ...
- * Data 8: LSB of MAC address.
- */
- /* set MAC filter to pair 0 */
- cmd = buf;
- *cmd++ = NIC_FILTER_MAC_NUM;
- *cmd++ = NIC_FILTER_MAC_PAIR0; /* pair 0 */
- for (i = 0; i < 6; i++) {
- *cmd++ = mac[i];
- }
- rc = i2c_smbus_write_block_data(dev->on_file, NIC_WRITE_FILTER_CMD,
- cmd - buf, buf);
- if (rc < 0) {
- rc = errno;
- LOG_ERR(rc, "Failed to set MAC filter");
- return -rc;
- }
-
- /*
- * Command to enable filter
- *
- * 9 bytes to load the extended decision filters (MDEF_EXT & MDEF)
- * Data 2—MDEF filter index (valid values are 0...6)
- * Data 3—MSB of MDEF_EXT (DecisionFilter0)
- * ....
- * Data 6—LSB of MDEF_EXT (DecisionFilter0)
- * Data 7—MSB of MDEF (DecisionFilter0)
- * ....
- * Data 10—LSB of MDEF (DecisionFilter0)
- */
-
- /* enable MAC filter pair 0 on filter 0 */
- cmd = buf;
- *cmd++ = NIC_FILTER_DECISION_EXT_NUM;
- *cmd++ = NIC_FILTER_MDEF0;
- /* enable filter for traffic from network and host */
- cmd32 = NIC_FILTER_MDEF_BIT(NIC_FILTER_MDEF_EXT_NET_EN_OFFSET)
- | NIC_FILTER_MDEF_BIT(NIC_FILTER_MDEF_EXT_HOST_EN_OFFSET);
- for (i = 0; i < sizeof(cmd32); i++) {
- *cmd++ = (cmd32 >> (24 - 8 * i)) & 0xFF;
- }
- /* enable mac pair 0 */
- cmd32 = NIC_FILTER_MDEF_BIT_VAL(NIC_FILTER_MDEF_MAC_AND_OFFSET,
- NIC_FILTER_MAC_PAIR0);
- for (i = 0; i < sizeof(cmd32); i++) {
- *cmd++ = (cmd32 >> (24 - 8 * i)) & 0xFF;
- }
- rc = i2c_smbus_write_block_data(dev->on_file, NIC_WRITE_FILTER_CMD,
- cmd - buf, buf);
- if (rc < 0) {
- rc = errno;
- LOG_ERR(rc, "Failed to set MAC filter to MDEF 0");
- return -rc;
- }
- /* enable ARP and ND on filter 1*/
- cmd = buf;
- *cmd++ = NIC_FILTER_DECISION_EXT_NUM;
- *cmd++ = NIC_FILTER_MDEF1;
- /* enable filter for traffic from network and host */
- cmd32 = NIC_FILTER_MDEF_BIT(NIC_FILTER_MDEF_EXT_NET_EN_OFFSET)
- | NIC_FILTER_MDEF_BIT(NIC_FILTER_MDEF_EXT_HOST_EN_OFFSET);
- for (i = 0; i < sizeof(cmd32); i++) {
- *cmd++ = (cmd32 >> (24 - 8 * i)) & 0xFF;
- }
- /* enable ARP and ND */
- cmd32 = NIC_FILTER_MDEF_BIT(NIC_FILTER_MDEF_ARP_REQ_OR_OFFSET)
- | NIC_FILTER_MDEF_BIT(NIC_FILTER_MDEF_ARP_RES_OR_OFFSET)
- | NIC_FILTER_MDEF_BIT(NIC_FILTER_MDEF_NBG_OR_OFFSET);
- for (i = 0; i < sizeof(cmd32); i++) {
- *cmd++ = (cmd32 >> (24 - 8 * i)) & 0xFF;
- }
- rc = i2c_smbus_write_block_data(dev->on_file, NIC_WRITE_FILTER_CMD,
- cmd - buf, buf);
- if (rc < 0) {
- rc = errno;
- LOG_ERR(rc, "Failed to set ARP and ND filter to MDEF 1");
- return -rc;
- }
-
- /* make filter 0, matching MAC, to be mng only */
- cmd = buf;
- *cmd++ = NIC_FILTER_MNG_ONLY_NUM;
- cmd32 = NIC_FILTER_MNG_ONLY_FILTER0;
- for (i = 0; i < sizeof(cmd32); i++) {
- *cmd++ = (cmd32 >> (24 - 8 * i)) & 0xFF;
- }
- rc = i2c_smbus_write_block_data(dev->on_file, NIC_WRITE_FILTER_CMD,
- cmd - buf, buf);
- if (rc < 0) {
- rc = errno;
- LOG_ERR(rc, "Failed to enabled management only filter");
- return -rc;
- }
-
- return 0;
-}
-
-int oob_nic_start(oob_nic *dev, const uint8_t mac[6]) {
- int rc;
- uint8_t cmd;
-
- /* force the link up, no matter what the status of the main link */
- rc = oob_nic_set_force_up(dev, 1);
- if (rc != 0) {
- return rc;
- }
-
- oob_nic_setup_filters(dev, mac);
-
- /* first byte is the control */
- cmd = NIC_WRITE_RECV_ENABLE_EN
- | NIC_WRITE_RECV_ENABLE_STA
- | NIC_WRITE_RECV_ENABLE_NM_UNSUPP /* TODO, to support ALERT */
- | NIC_WRITE_RECV_ENABLE_RESERVED;
-
- rc = i2c_smbus_write_block_data(dev->on_file, NIC_WRITE_RECV_ENABLE_CMD,
- 1, &cmd);
- if (rc < 0) {
- rc = errno;
- LOG_ERR(rc, "Failed to start receive function");
- return -rc;
- }
- LOG_DBG("Started receive function");
- return 0;
-}
-
-int oob_nic_stop(oob_nic *dev) {
- int rc;
- uint8_t ctrl;
- /* don't set any enable bits, which turns off the receive func */
- ctrl = NIC_WRITE_RECV_ENABLE_RESERVED;
- rc = i2c_smbus_write_block_data(dev->on_file, NIC_WRITE_RECV_ENABLE_CMD,
- 1, &ctrl);
- if (rc < 0) {
- rc = errno;
- LOG_ERR(rc, "Failed to stop receive function");
- return -rc;
- }
- LOG_DBG("Stopped receive function");
- return 0;
-}
diff --git a/meta-facebook/meta-yosemite/recipes-yosemite/oob-nic/oob-nic/src/nic.h b/meta-facebook/meta-yosemite/recipes-yosemite/oob-nic/oob-nic/src/nic.h
deleted file mode 100644
index 1ac7ff8..0000000
--- a/meta-facebook/meta-yosemite/recipes-yosemite/oob-nic/oob-nic/src/nic.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Copyright 2014-present Facebook. All Rights Reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-#ifndef NIC_H
-#define NIC_H
-
-#include <stdint.h>
-
-#include "nic_defs.h"
-
-typedef struct oob_nic_t oob_nic;
-
-oob_nic* oob_nic_open(int bus, uint8_t addr);
-void oob_nic_close(oob_nic* dev);
-
-/* MAC */
-int oob_nic_get_mac(oob_nic *dev, uint8_t mac[6]);
-
-/* Status */
-typedef struct oob_nic_status_t oob_nic_status;
-int oob_nic_get_status(oob_nic *dev, oob_nic_status *status);
-
-int oob_nic_start(oob_nic *dev, const uint8_t mac[6]);
-int oob_nic_stop(oob_nic *dev);
-
-int oob_nic_send(oob_nic *dev, const uint8_t *data, int len);
-
-int oob_nic_receive(oob_nic *dev, uint8_t *buf, int len);
-
-#endif
diff --git a/meta-facebook/meta-yosemite/recipes-yosemite/oob-nic/oob-nic/src/nic_defs.h b/meta-facebook/meta-yosemite/recipes-yosemite/oob-nic/oob-nic/src/nic_defs.h
deleted file mode 100644
index 1ae8721..0000000
--- a/meta-facebook/meta-yosemite/recipes-yosemite/oob-nic/oob-nic/src/nic_defs.h
+++ /dev/null
@@ -1,143 +0,0 @@
-/*
- * Copyright 2014-present Facebook. All Rights Reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-#ifndef NIC_DEFS_H
-#define NIC_DEFS_H
-
-#include <stdint.h>
-
-#define OOB_NIC_PKT_FRAGMENT_SIZE 240
-#define NIC_PKT_SIZE_MAX 1536
-
-/** Get System MAC Address */
-#define NIC_READ_MAC_CMD 0xD4
-#define NIC_READ_MAC_RES_OPT 0xD4
-#define NIC_READ_MAC_RES_LEN 7
-
-/** Read Status */
-#define NIC_READ_STATUS_CMD 0xDE
-#define NIC_READ_STATUS_RES_OPT 0xDD
-#define NIC_READ_STATUS_RES_LEN 3
-
-struct oob_nic_status_t {
- uint8_t ons_byte1;
- uint8_t ons_byte2;
-};
-
-#define NIC_STATUS_D1_POWER_DR 0x00
-#define NIC_STATUS_D1_POWER_D0U 0x01
-#define NIC_STATUS_D1_POWER_D0 0x10
-#define NIC_STATUS_D1_POWER_D3 0x11
-#define NIC_STATUS_D1_PORT_MSB (0x1 << 2)
-#define NIC_STATUS_D1_INIT (0x1 << 3)
-#define NIC_STATUS_D1_FORCE_UP (0x1 << 4)
-#define NIC_STATUS_D1_LINK (0x1 << 5)
-#define NIC_STATUS_D1_TCO_CMD_ABORT (0x1 << 6)
-#define NIC_STATUS_D1_PORT_LSB (0x1 << 7)
-
-#define NIC_STATUS_D2_ICR (0x1 << 1)
-#define NIC_STATUS_D2_IPI (0x1 << 2)
-#define NIC_STATUS_D2_DRV_VALID (0x1 << 3)
-
-/** Receive TCO Packet */
-#define NIC_READ_PKT_CMD 0xC0
-#define NIC_READ_PKT_RES_FIRST_OPT 0x90
-#define NIC_READ_PKT_RES_MIDDLE_OPT 0x10
-#define NIC_READ_PKT_RES_LAST_OPT 0x50
-#define NIC_READ_PKT_RES_LAST_LEN 17
-
-/** Transmit Packet */
-#define NIC_WRITE_PKT_SINGLE_CMD 0xC4
-#define NIC_WRITE_PKT_FIRST_CMD 0x84
-#define NIC_WRITE_PKT_MIDDLE_CMD 0x04
-#define NIC_WRITE_PKT_LAST_CMD 0x44
-
-/** Management Control */
-#define NIC_WRITE_MNG_CTRL_CMD 0xC1
-
-#define NIC_MNG_CTRL_KEEP_LINK_UP_NUM 0x00
-#define NIC_MNG_CTRL_KEEP_LINK_UP_ENABLE 0x01
-#define NIC_MNG_CTRL_KEEP_LINK_UP_DISABLE 0x00
-
-/** Update MNG RCV Filter Parameters */
-#define NIC_WRITE_FILTER_CMD 0xCC
-
-#define NIC_FILTER_MAC_NUM 0x66
-#define NIC_FILTER_MAC_PAIR0 0
-#define NIC_FILTER_MAC_PAIR1 1
-#define NIC_FILTER_MAC_PAIR2 2
-#define NIC_FILTER_MAC_PAIR3 3
-
-#define NIC_FILTER_MNG_ONLY_NUM 0xF
-#define NIC_FILTER_MNG_ONLY_FILTER0 (0x1)
-#define NIC_FILTER_MNG_ONLY_FILTER1 (0x1 << 1)
-#define NIC_FILTER_MNG_ONLY_FILTER2 (0x1 << 2)
-#define NIC_FILTER_MNG_ONLY_FILTER3 (0x1 << 3)
-#define NIC_FILTER_MNG_ONLY_FILTER4 (0x1 << 4)
-
-#define NIC_FILTER_DECISION_EXT_NUM 0x68
-#define NIC_FILTER_MDEF0 0 /* index 0 */
-#define NIC_FILTER_MDEF1 1 /* index 1 */
-#define NIC_FILTER_MDEF2 2 /* index 2 */
-#define NIC_FILTER_MDEF3 3 /* index 3 */
-#define NIC_FILTER_MDEF4 4 /* index 4 */
-#define NIC_FILTER_MDEF5 5 /* index 5 */
-#define NIC_FILTER_MDEF6 6 /* index 6 */
-#define NIC_FILTER_MDEF7 7 /* index 7 */
-
-#define NIC_FILTER_MDEF_MAC_AND_OFFSET 0
-#define NIC_FILTER_MDEF_BCAST_AND_OFFSET 4
-#define NIC_FILTER_MDEF_VLAN_AND_OFFSET 5
-#define NIC_FILTER_MDEF_IPV4_AND_OFFSET 13
-#define NIC_FILTER_MDEF_IPV6_AND_OFFSET 17
-#define NIC_FILTER_MDEF_MAC_OR_OFFSET 21
-#define NIC_FILTER_MDEF_BCAST_OR_OFFSET 25
-#define NIC_FILTER_MDEF_MCAST_AND_OFFSET 26
-#define NIC_FILTER_MDEF_ARP_REQ_OR_OFFSET 27
-#define NIC_FILTER_MDEF_ARP_RES_OR_OFFSET 28
-#define NIC_FILTER_MDEF_NBG_OR_OFFSET 29
-#define NIC_FILTER_MDEF_PORT298_OR_OFFSET 30
-#define NIC_FILTER_MDEF_PORT26F_OR_OFFSET 31
-
-#define NIC_FILTER_MDEF_EXT_ETHTYPE_AND_OFFSET 0
-#define NIC_FILTER_MDEF_EXT_ETHTYPE_OR_OFFSET 8
-#define NIC_FILTER_MDEF_EXT_FLEX_PORT_OR_OFFSET 16
-#define NIC_FILTER_MDEF_EXT_FLEX_TCO_OR_OFFSET 24
-#define NIC_FILTER_MDEF_EXT_NCSI_DISABLE_OFFSET 28
-#define NIC_FILTER_MDEF_EXT_FLOW_CONTROL_DISCARD_OFFSET 29
-#define NIC_FILTER_MDEF_EXT_NET_EN_OFFSET 30
-#define NIC_FILTER_MDEF_EXT_HOST_EN_OFFSET 31
-
-#define NIC_FILTER_MDEF_BIT(offset) ((0x1) << (offset))
-#define NIC_FILTER_MDEF_BIT_VAL(offset, val) ((0x1) << ((offset) + (val)))
-
-/** Receive Enable */
-#define NIC_WRITE_RECV_ENABLE_CMD 0xCA
-#define NIC_WRITE_RECV_ENABLE_LEN_MAX 14
-
-#define NIC_WRITE_RECV_ENABLE_EN 0x1
-#define NIC_WRITE_RECV_ENABLE_ALL (0x1 << 1)
-#define NIC_WRITE_RECV_ENABLE_STA (0x1 << 2)
-#define NIC_WRITE_RECV_ENABLE_ARP_RES (0x1 << 3)
-#define NIC_WRITE_RECV_ENABLE_NM_ALERT (0x00 << 4)
-#define NIC_WRITE_RECV_ENABLE_NM_ASYNC (0x01 << 4)
-#define NIC_WRITE_RECV_ENABLE_NM_DIRECT (0x02 << 4)
-#define NIC_WRITE_RECV_ENABLE_NM_UNSUPP (0x03 << 4)
-#define NIC_WRITE_RECV_ENABLE_RESERVED (0x1 << 6)
-#define NIC_WRITE_RECV_ENABLE_CBDM (0x1 << 7)
-
-#endif
diff --git a/meta-facebook/meta-yosemite/recipes-yosemite/oob-nic/oob-nic_0.1.bb b/meta-facebook/meta-yosemite/recipes-yosemite/oob-nic/oob-nic_0.1.bb
deleted file mode 100644
index 30f167f..0000000
--- a/meta-facebook/meta-yosemite/recipes-yosemite/oob-nic/oob-nic_0.1.bb
+++ /dev/null
@@ -1,44 +0,0 @@
-# Copyright 2014-present Facebook. All Rights Reserved.
-#
-# This program file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program in a file named COPYING; if not, write to the
-# Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor,
-# Boston, MA 02110-1301 USA
-
-SUMMARY = "OOB Shared NIC driver"
-DESCRIPTION = "The shared-nic driver"
-SECTION = "base"
-PR = "r2"
-LICENSE = "GPLv2"
-LIC_FILES_CHKSUM = "file://main.c;beginline=4;endline=16;md5=da35978751a9d71b73679307c4d296ec"
-
-SRC_URI = "file://src \
- "
-
-S = "${WORKDIR}/src"
-
-DEPENDS += "fbutils libwedge-eeprom"
-
-RDEPENDS_${PN} += "libwedge-eeprom"
-
-do_install() {
- install -d ${D}${sbindir}
- install -m 755 oob-nic ${D}${sbindir}/oob-nic
- install -m 755 i2craw ${D}${sbindir}/i2craw
- install -d ${D}${sysconfdir}/init.d
- install -d ${D}${sysconfdir}/rcS.d
- install -m 755 etc/oob-nic.sh ${D}${sysconfdir}/init.d/oob-nic.sh
- update-rc.d -r ${D} oob-nic.sh start 80 S .
-}
-
-FILES_${PN} = " ${sbindir} ${sysconfdir} "
diff --git a/meta-facebook/meta-yosemite/recipes-yosemite/rest-api/files/plat_tree.py b/meta-facebook/meta-yosemite/recipes-yosemite/rest-api/files/plat_tree.py
deleted file mode 100644
index b93e98e..0000000
--- a/meta-facebook/meta-yosemite/recipes-yosemite/rest-api/files/plat_tree.py
+++ /dev/null
@@ -1,84 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2014-present Facebook. All Rights Reserved.
-#
-# This program file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program in a file named COPYING; if not, write to the
-# Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor,
-# Boston, MA 02110-1301 USA
-#
-
-from ctypes import *
-import json
-import ssl
-import socket
-import os
-from node_api import get_node_api
-from node_spb import get_node_spb
-from node_bmc import get_node_bmc
-from node_server import get_node_server
-from node_fruid import get_node_fruid
-from node_sensors import get_node_sensors
-from node_config import get_node_config
-from tree import tree
-from pal import *
-
-def populate_server_node(num):
- prsnt = pal_is_server_prsnt(num)
- if prsnt == None or prsnt == 0:
- return None
-
- r_server = tree("server" + repr(num), data = get_node_server(num))
-
- r_fruid = tree("fruid", data = get_node_fruid("slot" + repr(num)))
-
- r_sensors = tree("sensors", data = get_node_sensors("slot" + repr(num)))
-
- r_config = tree("config", data = get_node_config("slot" + repr(num)))
-
- r_server.addChildren([r_fruid, r_sensors, r_config])
-
- return r_server
-
-# Initialize Platform specific Resource Tree
-def init_plat_tree():
-
- # Create /api end point as root node
- r_api = tree("api", data = get_node_api())
-
- # Add /api/spb to represent side plane board
- r_spb = tree("spb", data = get_node_spb())
- r_api.addChild(r_spb)
-
- # Add servers /api/server[1-max]
- num = pal_get_num_slots()
- for i in range(1, num+1):
- r_server = populate_server_node(i)
- if r_server:
- r_api.addChild(r_server)
-
- # TODO: Need to add /api/nic to represent NIC Mezz Card
-
- # Add /api/spb/fruid end point
- r_temp = tree("fruid", data = get_node_fruid("spb"))
- r_spb.addChild(r_temp)
-
- # /api/spb/bmc end point
- r_temp = tree("bmc", data = get_node_bmc())
- r_spb.addChild(r_temp)
-
- # /api/spb/sensors end point
- r_temp = tree("sensors", data = get_node_sensors("spb"))
- r_spb.addChild(r_temp)
-
- return r_api
diff --git a/meta-facebook/meta-yosemite/recipes-yosemite/rest-api/files/setup-rest-api.sh b/meta-facebook/meta-yosemite/recipes-yosemite/rest-api/files/setup-rest-api.sh
deleted file mode 100644
index bdd79b6..0000000
--- a/meta-facebook/meta-yosemite/recipes-yosemite/rest-api/files/setup-rest-api.sh
+++ /dev/null
@@ -1,32 +0,0 @@
-#!/bin/sh
-#
-# Copyright 2014-present Facebook. All Rights Reserved.
-#
-# This program file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program in a file named COPYING; if not, write to the
-# Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor,
-# Boston, MA 02110-1301 USA
-#
-
-### BEGIN INIT INFO
-# Provides: setup-rest-api
-# Required-Start:
-# Required-Stop:
-# Default-Start: S
-# Default-Stop:
-# Short-Description: Set REST API handler
-### END INIT INFO
-
-echo -n "Setup REST API handler... "
-/usr/local/bin/rest.py > /tmp/rest.log 2>&1 &
-echo "done."
diff --git a/meta-facebook/meta-yosemite/recipes-yosemite/rest-api/rest-api_0.2.bbappend b/meta-facebook/meta-yosemite/recipes-yosemite/rest-api/rest-api_0.2.bbappend
deleted file mode 100644
index 701a8d1..0000000
--- a/meta-facebook/meta-yosemite/recipes-yosemite/rest-api/rest-api_0.2.bbappend
+++ /dev/null
@@ -1,62 +0,0 @@
-# Copyright 2015-present Facebook. All Rights Reserved.
-#
-# This program file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program in a file named COPYING; if not, write to the
-# Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor,
-# Boston, MA 02110-1301 USA
-SUMMARY = "Rest API Daemon"
-DESCRIPTION = "Daemon to handle RESTful interface."
-SECTION = "base"
-PR = "r1"
-LICENSE = "GPLv2"
-LIC_FILES_CHKSUM = "file://rest.py;beginline=5;endline=18;md5=0b1ee7d6f844d472fa306b2fee2167e0"
-
-DEPENDS_append = " update-rc.d-native"
-
-S = "${WORKDIR}"
-
-FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
-SRC_URI += "file://setup-rest-api.sh \
- file://plat_tree.py \
- file://node_api.py \
- file://node_spb.py \
- file://node_bmc.py \
- file://node_server.py \
- file://node_fruid.py \
- file://node_sensors.py \
- file://node_config.py \
- "
-
-binfiles += "setup-rest-api.sh plat_tree.py node_api.py node_spb.py node_bmc.py node_server.py node_fruid.py node_sensors.py node_config.py"
-
-do_install() {
- dst="${D}/usr/local/fbpackages/${pkgdir}"
- bin="${D}/usr/local/bin"
- install -d $dst
- install -d $bin
- for f in ${binfiles}; do
- install -m 755 $f ${dst}/$f
- ln -snf ../fbpackages/${pkgdir}/$f ${bin}/$f
- done
- for f in ${otherfiles}; do
- install -m 644 $f ${dst}/$f
- done
- install -d ${D}${sysconfdir}/init.d
- install -d ${D}${sysconfdir}/rcS.d
- install -m 755 setup-rest-api.sh ${D}${sysconfdir}/init.d/setup-rest-api.sh
- update-rc.d -r ${D} setup-rest-api.sh start 95 5 .
-}
-
-FBPACKAGEDIR = "${prefix}/local/fbpackages"
-
-FILES_${PN} = "${FBPACKAGEDIR}/rest-api ${prefix}/local/bin ${sysconfdir} "
diff --git a/meta-facebook/meta-yosemite/recipes-yosemite/sensor-mon/files/setup-sensord.sh b/meta-facebook/meta-yosemite/recipes-yosemite/sensor-mon/files/setup-sensord.sh
deleted file mode 100644
index f387d20..0000000
--- a/meta-facebook/meta-yosemite/recipes-yosemite/sensor-mon/files/setup-sensord.sh
+++ /dev/null
@@ -1,55 +0,0 @@
-#!/bin/sh
-#
-# Copyright 2015-present Facebook. All Rights Reserved.
-#
-# This program file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program in a file named COPYING; if not, write to the
-# Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor,
-# Boston, MA 02110-1301 USA
-#
-
-### BEGIN INIT INFO
-# Provides: setup-sensord
-# Required-Start:
-# Required-Stop:
-# Default-Start: S
-# Default-Stop:
-# Short-Description: Setup sensor monitoring
-### END INIT INFO
-
-. /usr/local/fbpackages/utils/ast-functions
-
-echo -n "Setup sensor monitoring for yosemite... "
-
-# Check for the slots present and run sensord for those slots only.
-SLOTS=
- if [ $(is_server_prsnt 1) == "1" ]; then
- SLOTS="$SLOTS slot1"
- fi
-
- if [ $(is_server_prsnt 2) == "1" ]; then
- SLOTS="$SLOTS slot2"
- fi
-
- if [ $(is_server_prsnt 3) == "1" ]; then
- SLOTS="$SLOTS slot3"
- fi
-
- if [ $(is_server_prsnt 4) == "1" ]; then
- SLOTS="$SLOTS slot4"
- fi
-
-SLOTS="$SLOTS spb nic"
-/usr/local/bin/sensord $SLOTS
-
-echo "done."
diff --git a/meta-facebook/meta-yosemite/recipes-yosemite/sensor-mon/sensor-mon_0.1.bbappend b/meta-facebook/meta-yosemite/recipes-yosemite/sensor-mon/sensor-mon_0.1.bbappend
deleted file mode 100644
index b920973..0000000
--- a/meta-facebook/meta-yosemite/recipes-yosemite/sensor-mon/sensor-mon_0.1.bbappend
+++ /dev/null
@@ -1,55 +0,0 @@
-# Copyright 2015-present Facebook. All Rights Reserved.
-#
-# This program file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program in a file named COPYING; if not, write to the
-# Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor,
-# Boston, MA 02110-1301 USA
-
-FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
-
-SRC_URI += "file://setup-sensord.sh \
- "
-
-S = "${WORKDIR}"
-
-
-DEPENDS_append = "update-rc.d-native"
-
-pkgdir = "sensor-mon"
-
-do_install() {
- dst="${D}/usr/local/fbpackages/${pkgdir}"
- bin="${D}/usr/local/bin"
- install -d $dst
- install -d $bin
- for f in ${binfiles}; do
- install -m 755 $f ${dst}/$f
- ln -snf ../fbpackages/${pkgdir}/$f ${bin}/$f
- done
- for f in ${otherfiles}; do
- install -m 644 $f ${dst}/$f
- done
- install -d ${D}${sysconfdir}/init.d
- install -d ${D}${sysconfdir}/rcS.d
- install -m 755 setup-sensord.sh ${D}${sysconfdir}/init.d/setup-sensord.sh
- update-rc.d -r ${D} setup-sensord.sh start 91 5 .
-}
-
-FBPACKAGEDIR = "${prefix}/local/fbpackages"
-
-FILES_${PN} = "${FBPACKAGEDIR}/sensor-mon ${prefix}/local/bin ${sysconfdir} "
-
-# Inhibit complaints about .debug directories for the sensord binary:
-
-INHIBIT_PACKAGE_DEBUG_SPLIT = "1"
-INHIBIT_PACKAGE_STRIP = "1"
diff --git a/meta-facebook/meta-yosemite/recipes-yosemite/sensor-setup/files/sensor-setup.sh b/meta-facebook/meta-yosemite/recipes-yosemite/sensor-setup/files/sensor-setup.sh
deleted file mode 100644
index a53b316..0000000
--- a/meta-facebook/meta-yosemite/recipes-yosemite/sensor-setup/files/sensor-setup.sh
+++ /dev/null
@@ -1,54 +0,0 @@
-#!/bin/sh
-#
-# Copyright 2014-present Facebook. All Rights Reserved.
-#
-# This program file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program in a file named COPYING; if not, write to the
-# Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor,
-# Boston, MA 02110-1301 USA
-#
-
-### BEGIN INIT INFO
-# Provides: sensor-setup
-# Required-Start: power-on
-# Required-Stop:
-# Default-Start: S
-# Default-Stop:
-# Short-Description: Power on micro-server
-### END INIT INFO
-
-# Eventually, this will be used to configure the various (mostly
-# i2c-based) sensors, once we have a kernel version that supports
-# doing this more dynamically.
-#
-# For now, we're using it to install the lm75 and pmbus module so that it
-# can detect the fourth temperature sensor, which is located
-# on the uServer, which doesn't get power until power-on executes.
-#
-# Similarly, the pmbus sensor seems to have an easier time of
-# detecting the NCP4200 buck converters after poweron. This has not
-# been carefully explored.
-
-modprobe lm75
-modprobe pmbus
-
-# Enable the ADC inputs; adc0 - adc7 are connected to various voltage sensors
-
-echo 1 > /sys/devices/platform/ast_adc.0/adc0_en
-echo 1 > /sys/devices/platform/ast_adc.0/adc1_en
-echo 1 > /sys/devices/platform/ast_adc.0/adc2_en
-echo 1 > /sys/devices/platform/ast_adc.0/adc3_en
-echo 1 > /sys/devices/platform/ast_adc.0/adc4_en
-echo 1 > /sys/devices/platform/ast_adc.0/adc5_en
-echo 1 > /sys/devices/platform/ast_adc.0/adc6_en
-echo 1 > /sys/devices/platform/ast_adc.0/adc7_en
diff --git a/meta-facebook/meta-yosemite/recipes-yosemite/sensor-setup/sensor-setup_0.1.bb b/meta-facebook/meta-yosemite/recipes-yosemite/sensor-setup/sensor-setup_0.1.bb
deleted file mode 100644
index 1b0f937..0000000
--- a/meta-facebook/meta-yosemite/recipes-yosemite/sensor-setup/sensor-setup_0.1.bb
+++ /dev/null
@@ -1,38 +0,0 @@
-# Copyright 2014-present Facebook. All Rights Reserved.
-#
-# This program file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program in a file named COPYING; if not, write to the
-# Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor,
-# Boston, MA 02110-1301 USA
-SUMMARY = "Configure the sensors"
-DESCRIPTION = "The script configure sensors"
-SECTION = "base"
-PR = "r1"
-LICENSE = "GPLv2"
-LIC_FILES_CHKSUM = "file://sensor-setup.sh;beginline=5;endline=18;md5=0b1ee7d6f844d472fa306b2fee2167e0"
-
-DEPENDS_append = " update-rc.d-native"
-
-SRC_URI = "file://sensor-setup.sh \
- "
-
-S = "${WORKDIR}"
-
-do_install() {
- install -d ${D}${sysconfdir}/init.d
- install -d ${D}${sysconfdir}/rcS.d
- install -m 755 sensor-setup.sh ${D}${sysconfdir}/init.d/sensor-setup.sh
- update-rc.d -r ${D} sensor-setup.sh start 90 S .
-}
-
-FILES_${PN} = " ${sysconfdir} "
diff --git a/meta-facebook/meta-yosemite/recipes-yosemite/usb-console/files/usbcons.sh b/meta-facebook/meta-yosemite/recipes-yosemite/usb-console/files/usbcons.sh
deleted file mode 100755
index de284bb..0000000
--- a/meta-facebook/meta-yosemite/recipes-yosemite/usb-console/files/usbcons.sh
+++ /dev/null
@@ -1,80 +0,0 @@
-#! /bin/sh
-#
-# Copyright 2014-present Facebook. All Rights Reserved.
-#
-# This program file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program in a file named COPYING; if not, write to the
-# Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor,
-# Boston, MA 02110-1301 USA
-#
-
-### BEGIN INIT INFO
-# Provides: usbcons
-# Required-Start:
-# Required-Stop:
-# Default-Start: S
-# Default-Stop: 0 6
-# Short-Description: Creates a virtual USB serial device and starts a console
-# on it.
-#
-### END INIT INFO
-
-PATH=/sbin:/bin:/usr/sbin:/usr/bin
-NAME=usbcons
-PIDFILE=/run/usbcons.pid
-DESC="USB Serial Console"
-
-# source function library
-. /etc/init.d/functions
-
-STOPPER=
-ACTION="$1"
-
-case "$ACTION" in
- start)
- # Ability to prevent this from starting by editing cmdline in u-boot.
- # Keeping this here until I get gadget switching working properly. (t4906522)
- if grep "nousbcons" /proc/cmdline > /dev/null 2>&1
- then
- echo "USB Console Disabled."
- exit 0
- fi
- echo -n "Starting $DESC: "
- /usr/local/bin/usbmon.sh > /dev/null 2>&1 &
- echo "$NAME."
- ;;
- stop)
- echo -n "Stopping $DESC: "
- killall usbmon.sh
- echo "$NAME."
- ;;
- restart|force-reload)
- echo -n "Restarting $DESC: "
- killall usbmon.sh
- sleep 1
- /usr/local/bin/usbmon.sh > /dev/null 2>&1 &
- echo "$NAME."
- ;;
- status)
- status $DAEMON
- exit $?
- ;;
- *)
- N=${0##*/}
- N=${N#[SK]??}
- echo "Usage: $N {start|stop|status|restart|force-reload}" >&2
- exit 1
- ;;
-esac
-
-exit 0
diff --git a/meta-facebook/meta-yosemite/recipes-yosemite/usb-console/files/usbmon.sh b/meta-facebook/meta-yosemite/recipes-yosemite/usb-console/files/usbmon.sh
deleted file mode 100755
index 0030775..0000000
--- a/meta-facebook/meta-yosemite/recipes-yosemite/usb-console/files/usbmon.sh
+++ /dev/null
@@ -1,25 +0,0 @@
-#!/bin/sh
-#
-# Copyright 2014-present Facebook. All Rights Reserved.
-#
-# This program file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program in a file named COPYING; if not, write to the
-# Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor,
-# Boston, MA 02110-1301 USA
-#
-
-modprobe g_cdc host_addr=02:00:00:00:00:02 dev_addr=02:00:00:00:00:01
-while true; do
- getty /dev/ttyGS0 57600
- sleep 1
-done
diff --git a/meta-facebook/meta-yosemite/recipes-yosemite/usb-console/usb-console_0.1.bb b/meta-facebook/meta-yosemite/recipes-yosemite/usb-console/usb-console_0.1.bb
deleted file mode 100644
index c934f46..0000000
--- a/meta-facebook/meta-yosemite/recipes-yosemite/usb-console/usb-console_0.1.bb
+++ /dev/null
@@ -1,42 +0,0 @@
-# Copyright 2014-present Facebook. All Rights Reserved.
-#
-# This program file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program in a file named COPYING; if not, write to the
-# Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor,
-# Boston, MA 02110-1301 USA
-SUMMARY = "Set up a USB serial console"
-DESCRIPTION = "Sets up a USB serial console"
-SECTION = "base"
-PR = "r1"
-LICENSE = "GPLv2"
-LIC_FILES_CHKSUM = "file://usbcons.sh;beginline=5;endline=18;md5=0b1ee7d6f844d472fa306b2fee2167e0"
-
-DEPENDS_append = " update-rc.d-native"
-
-SRC_URI = "file://usbcons.sh \
- file://usbmon.sh \
- "
-
-S = "${WORKDIR}"
-
-do_install() {
- install -d ${D}${sysconfdir}/init.d
- install -d ${D}${sysconfdir}/rcS.d
- install -m 755 usbcons.sh ${D}${sysconfdir}/init.d/usbcons.sh
- update-rc.d -r ${D} usbcons.sh start 90 S .
- localbindir="${D}/usr/local/bin"
- install -d ${localbindir}
- install -m 755 usbmon.sh ${localbindir}/usbmon.sh
-}
-
-FILES_${PN} = " ${sysconfdir} /usr/local"
OpenPOWER on IntegriCloud