Fix eeprog
This commit is contained in:
3
you-ass-bee-see/.gitignore
vendored
Normal file
3
you-ass-bee-see/.gitignore
vendored
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
eeprom.rom
|
||||||
|
eeprog-*/*.o
|
||||||
|
eeprog-*/eeprog
|
@@ -72,7 +72,8 @@ static int i2c_write_3b(struct eeprom *e, __u8 buf[3])
|
|||||||
|
|
||||||
int eeprom_open(char *dev_fqn, int addr, int type, int write_cycle_time, struct eeprom* e)
|
int eeprom_open(char *dev_fqn, int addr, int type, int write_cycle_time, struct eeprom* e)
|
||||||
{
|
{
|
||||||
int funcs, fd, r;
|
unsigned long funcs;
|
||||||
|
int fd, r;
|
||||||
e->fd = e->addr = 0;
|
e->fd = e->addr = 0;
|
||||||
e->dev = 0;
|
e->dev = 0;
|
||||||
|
|
||||||
|
9
you-ass-bee-see/usb4-pd.sh
Normal file → Executable file
9
you-ass-bee-see/usb4-pd.sh
Normal file → Executable file
@@ -1,6 +1,11 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
shopt -s nullglob
|
||||||
set -ex
|
set -ex
|
||||||
|
|
||||||
gcc -o eeprom eeprom.c
|
I2C_PCI_SYSFS="/sys/bus/pci/devices/0000:00:15.1"
|
||||||
./eeprom -f usb4-pd.rom -r
|
I2C_SYSFS="$(echo "${I2C_PCI_SYSFS}/i2c_designware."*"/i2c-"*)"
|
||||||
|
I2C_DEV="/dev/$(basename "${I2C_SYSFS}")"
|
||||||
|
|
||||||
|
make -C eeprog-0.7.6-tear12
|
||||||
|
sudo ./eeprog-0.7.6-tear12/eeprog "${I2C_DEV}" 0x50 -r 0 -o eeprom.rom
|
||||||
|
Reference in New Issue
Block a user