Skip to content

Commit 0ed9e73

Browse files
david56mshych
authored andcommitted
Accton AS9926_24D: add to support ONIE
Signed-off-by: david_yang <[email protected]> Signed-off-by: Michael Shych <[email protected]>
1 parent c518311 commit 0ed9e73

File tree

12 files changed

+273
-0
lines changed

12 files changed

+273
-0
lines changed

build-config/scripts/onie-build-targets.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@
6565
{ "Vendor": "accton", "Platform": "accton_as9716_32d", "BuildEnv": "Debian10", "Release": "2023.05br", "Architecture": "amd64", "Notes": "No notes." },
6666
{ "Vendor": "accton", "Platform": "accton_as7946_30xb", "BuildEnv": "Debian10", "Release": "2023.05br", "Architecture": "amd64", "Notes": "No notes." },
6767
{ "Vendor": "accton", "Platform": "accton_as7946_74xkb", "BuildEnv": "Debian10", "Release": "2023.05br", "Architecture": "amd64", "Notes": "No notes." },
68+
{ "Vendor": "accton", "Platform": "accton_as9926_24d", "BuildEnv": "Debian10", "Release": "2023.05br", "Architecture": "amd64", "Notes": "No notes." },
6869
{ "Vendor": "accton", "Platform": "accton_as9926_24db", "BuildEnv": "Debian10", "Release": "2023.05br", "Architecture": "amd64", "Notes": "No notes." },
6970
{ "Vendor": "accton", "Platform": "accton_as_28t_ops", "BuildEnv": "Debian9", "Release": "2021.08br", "Architecture": "armv7", "Notes": "No notes." },
7071
{ "Vendor": "accton", "Platform": "accton_asgvolt64", "BuildEnv": "Debian10", "Release": "2023.05br", "Architecture": "amd64", "Notes": "No notes." },
Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
====================================
2+
Installing ONIE on Accton AS9926_24D
3+
====================================
4+
5+
Cross-Compiling ONIE
6+
====================
7+
8+
Change directories to ``build-config`` to compile ONIE.
9+
10+
To compile ONIE first change directories to ``build-config`` and then
11+
type ``"make MACHINEROOT=../machine/accton MACHINE=accton_as9926_24d all"``.
12+
For example::
13+
14+
$ cd build-config
15+
$ make -j4 MACHINEROOT=../machine/accton MACHINE=accton_as9926_24d all
16+
17+
When complete, the ONIE binaries are located in
18+
``build/images``::
19+
20+
-rw-rw-r-- 1 8217496 Sep 17 14:24 accton_as9926_24d-r0.initrd
21+
-rw-rw-r-- 1 3445024 Sep 17 14:23 accton_as9926_24d-r0.vmlinuz
22+
-rw-rw-r-- 1 25952256 Sep 17 14:25 onie-recovery-x86_64-accton_as9926_24d-r0.iso
23+
-rw-rw-r-- 1 11695991 Sep 17 14:24 onie-updater-x86_64-accton_as9926_24d-r0
24+
25+
accton_as9926_24d-r0.vmlinuz -- This is the ONIE kernel image
26+
27+
accton_as9926_24d-r0.initrd -- This is the ONIE initramfs (filesystem)
28+
29+
onie-recovery-x86_64-accton_as9926_24d-r0.iso -- This is the ONIE recovery
30+
ISO image. This image can be used to create a bootable USB memory stick
31+
for installing/recovery ONIE.
32+
33+
onie-updater-x86_64-accton_as9926_24d-r0 -- This is the ONIE self-update
34+
image. This image is a self-extracting archive used for installing ONIE.
35+
36+
Installing ONIE on a Blank Machine
37+
==================================
38+
39+
To install ONIE on a new machine, you can use the recovery ISO image to
40+
create a bootable USB memory stick.
41+
42+
Creating bootable USB stick
43+
---------------------------
44+
45+
Use ``dd`` to copy the .iso image to a USB stick and boot from that::
46+
47+
dd if=<machine>.iso of=/dev/sdX bs=10M
48+
49+
You can find the correct ``/dev/sdX`` by inspecing the ``dmesg``
50+
output after inserting the USB stick into your work station.
51+
52+
Booting from USB stick
53+
----------------------
54+
55+
To enable booting from USB in the BIOS:
56+
57+
1. Insert the USB stick
58+
59+
2. Power on the switch and enter the BIOS configuration
60+
61+
3. Set the hard drive boot order:
62+
63+
In "Boot Option #1" select the device that corresponds to your
64+
device::
65+
66+
Boot-->Boot Option Priorities-->Boot Option #1
67+
68+
If the device name is not listed in "Boot Option #1", please
69+
check the priorities in the hard drive boot order::
70+
71+
Boot-->Hard Drive BBS Priorities-->Boot Option #1
72+
73+
Taking ``JetFlashTranscend 8GB 8.07`` as an example, the boot
74+
order will look like following::
75+
76+
Boot Option Priorities
77+
Boot Option #1 [JetFlashTranscend 8...]
78+
Boot Option #2 [ATP ATP IG eUSB 1100]
79+
Boot Option #3 [IBA GE Slot 00A0 v1543]
80+
Boot Option #4 [UEFI: Built-in EFI ...]
81+
82+
4. Save and Exit the BIOS configuration
83+
84+
5. After several seconds, you should see:
85+
86+
GNU GRUB version 2.02~beta2+e4a1fe391
87+
88+
+----------------------------------------------------------------------------+
89+
|*ONIE: Rescue |
90+
| ONIE: Embed ONIE |
91+
| |
92+
| |
93+
| |
94+
| |
95+
| |
96+
| |
97+
| |
98+
| |
99+
| |
100+
| |
101+
+----------------------------------------------------------------------------+
102+
103+
Use the ^ and v keys to select which entry is highlighted.
104+
Press enter to boot the selected OS, `e' to edit the commands
105+
before booting or `c' for a command-line.
106+
107+
- Choose ``ONIE: Embed ONIE`` for creating a fresh partition layout and
108+
installing ONIE automatically. All data on the mass storage will be
109+
erased.
110+
- Choose ``ONIE: Rescue`` for entering ONIE recovery command-line shell.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
CONFIG_SYS_EEPROM=y
2+
CONFIG_SYS_EEPROM_DEVICE_I2C=y
3+
CONFIG_SYS_EEPROM_I2C_DEVICE="/dev/i2c-0"
4+
CONFIG_SYS_EEPROM_I2C_ADDR=0x55
5+
CONFIG_SYS_EEPROM_I2C_MEM_ADDR_BITS=16
6+
CONFIG_SYS_EEPROM_I2C_WRITE_2B_DELAY=4000
7+
CONFIG_SYS_EEPROM_I2C_WRITE_3B_DELAY=4000
8+
CONFIG_SYS_EEPROM_OFFSET=0
9+
CONFIG_SYS_EEPROM_SIZE=256
10+
CONFIG_SYS_EEPROM_MAX_SIZE=256
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
patches for platform
2+
3+
diff --git a/miscutils/24cXX.c b/miscutils/24cXX.c
4+
index ccc0965..6a50511 100644
5+
--- a/miscutils/24cXX.c
6+
+++ b/miscutils/24cXX.c
7+
@@ -92,6 +92,21 @@ int eeprom_open(char *dev_fqn, int addr, int type, struct eeprom* e)
8+
CHECK_I2C_FUNC( funcs, I2C_FUNC_SMBUS_READ_WORD_DATA );
9+
CHECK_I2C_FUNC( funcs, I2C_FUNC_SMBUS_WRITE_WORD_DATA );
10+
11+
+ if (addr == 0x55) {
12+
+ if( ( r = ioctl(fd, I2C_SLAVE, 0x77)) < 0)
13+
+ return r;
14+
+ r = i2c_smbus_write_byte_data(fd, 0, 0x1);
15+
+ if(r < 0)
16+
+ fprintf(stderr, "Error: setting channel: %s\n", strerror(errno));
17+
+ usleep(10);
18+
+ if( ( r = ioctl(fd, I2C_SLAVE, 0x76)) < 0)
19+
+ return r;
20+
+ r = i2c_smbus_write_byte_data(fd, 0, 0x40);
21+
+ if(r < 0)
22+
+ fprintf(stderr, "Error: setting channel: %s\n", strerror(errno));
23+
+ usleep(10);
24+
+ }
25+
+
26+
// set working device
27+
if( ( r = ioctl(fd, I2C_SLAVE, addr)) < 0)
28+
return r;
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
onie-syseeprom-i2c-mux.patch
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# as9926_24d specific info
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Accton as9926_24d ONIE installer configuration
2+
3+
description="Accton, as9926_24d"
4+
5+
mass_dev="storage-not-found"
6+
discover_mass_storage()
7+
{
8+
mass_bus="$1"
9+
for i in a b c d e ; do
10+
if $(ls -l /sys/block/sd$i/device 2>/dev/null | grep -q "$mass_bus") ; then
11+
mass_dev="/dev/sd$i"
12+
return 0
13+
fi
14+
done
15+
return 1
16+
}
17+
18+
# Default ONIE block device
19+
install_device_platform()
20+
{
21+
discover_mass_storage "target0:0:0" ||
22+
discover_mass_storage "target1:0:0"
23+
ret=$?
24+
echo "$mass_dev"
25+
return $ret
26+
}
27+
28+
# Local Variables:
29+
# mode: shell-script
30+
# eval: (sh-set-shell "/bin/sh" t nil)
31+
# End:
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
CONFIG_IGB=y
2+
CONFIG_I2C_I801=y
3+
CONFIG_USB_XHCI_HCD=y
4+
# CONFIG_USB_XHCI_PLATFORM is not set
5+
# CONFIG_DCB is not set
6+
CONFIG_IXGBE=y
7+
CONFIG_IXGBE_HWMON=y
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
driver-ixgbe-phy.patch
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# Accton AS9926_24D
2+
3+
# Vendor's version number can be defined here.
4+
# Available variable is 'VENDOR_VERSION'.
5+
# e.g.,
6+
# VENDOR_VERSION = .00.01
7+
8+
ONIE_ARCH ?= x86_64
9+
SWITCH_ASIC_VENDOR = bcm
10+
11+
VENDOR_REV ?= 0
12+
13+
# Translate hardware revision to ONIE hardware revision
14+
ifeq ($(VENDOR_REV),0)
15+
MACHINE_REV = 0
16+
else
17+
$(warning Unknown VENDOR_REV '$(VENDOR_REV)' for MACHINE '$(MACHINE)')
18+
$(error Unknown VENDOR_REV)
19+
endif
20+
21+
# Vendor ID -- IANA Private Enterprise Number:
22+
# http://www.iana.org/assignments/enterprise-numbers
23+
# Accton Technology Corporation IANA number
24+
VENDOR_ID = 259
25+
26+
SKIP_ETHMGMT_MACS = yes
27+
28+
UEFI_ENABLE = yes
29+
PXE_EFI64_ENABLE = yes
30+
31+
# Console parameters
32+
CONSOLE_DEV = 0
33+
34+
# Set Linux kernel version
35+
LINUX_VERSION = 5.4
36+
LINUX_MINOR_VERSION = 86
37+
38+
GCC_VERSION = 8.3.0
39+
40+
#-------------------------------------------------------------------------------
41+
#
42+
# Local Variables:
43+
# mode: makefile-gmake
44+
# End:

0 commit comments

Comments
 (0)