1. Broadcom-SSB SPROM data modification tool
  2. =========================================
  3. About this software
  4. -------------------
  5. A tool for the convenient modification of the
  6. Broadcom Sonics Silicon Backplane SPROM.
  7. This tool automatically adjusts the CRC after the modification.
  8. Requirements
  9. ------------
  10. 1) C99 compatible compiler.
  11. Usage
  12. -----
  13. The contents of the sprom are exposed to the user in sysfs. This
  14. tool can, in principle, read and write the sprom in place; however,
  15. making a mistake during sprom writing could render your device
  16. unusable. For this reason, we recommend copying the sprom contents
  17. to disk as the first step. This copy can then be modified until it
  18. contains the desired new information. Only then and with caution
  19. should the sprom be rewritten. DO NOT MAKE ANY CHANGES UNLESS YOU
  20. KNOW WHAT YOU ARE DOING!!!! You have been warned!!!
  21. Obtaining a disk copy of the sprom contents
  22. -------------------------------------------
  23. This file name for the sprom contents depends on the bus layout of
  24. the specific computer being used and will be something like
  25. /sys/devices/pci0000:00/0000:00:0d.0/0000:04:00.0/ssb_sprom
  26. It is not recommended that you try to type the name. Instead, you
  27. should use the following commands to get and check the path for the
  28. sprom file:
  29. SSB_SPROM=$(find /sys -name ssb_sprom)
  30. echo $SSB_SPROM
  31. If the echo command only results in a single instance of "/sys/...",
  32. you may proceed. For systems with more than one SSB-based interface,
  33. there will be such a string for each, and the command that sets the
  34. SSB_SPROM symbol will have to be changed. In the name above, the
  35. sequence states that this device is attached to the 0'th PCI bus via
  36. bridge 0d.0 and is device 04:00.0 on that bridge. To find which of
  37. your SSB devices to select, use the 'lspci -v' command. On my system,
  38. the first line of such output for my interface is "04:00.0 Network
  39. controller: Broadcom Corporation BCM94311MCG wlan mini-PCI (rev 02)".
  40. To select only this device, one would use
  41. SSB_SPROM=$(find /sys -name ssb_sprom | grep 04:00.0)
  42. echo $SSB_SPROM
  43. Of course, the "04:00.0" needs to match your system, and check the
  44. output value to determine that there is now a single instance of
  45. "/sys..." and that the path matches the device whose SPROM is to be
  46. changed. If not, adjust the string after 'grep' accordingly.
  47. Once the SSB_SPROM variable matches the path to ssb_sprom for your
  48. device, get a working copy of the sprom contents with
  49. sudo cat $SSB_SPROM > ssb_sprom_copy
  50. Modifying the contents of the working copy
  51. ------------------------------------------
  52. You may now see the contents of your sprom with the command
  53. ssb-sprom -i ssb_sprom_copy -P
  54. As an example, let us suppose that you have purchased a Dell mini-pci
  55. card to use in an HP laptop. The HP BIOS refuses to use the card when
  56. the pcivendor is Dell (code 0x1028), not HP (code 0x103C). From the
  57. information provided by an "ssb-prom --help" command, we learn that
  58. the switch needed to change this vendor code is "--subv". To change
  59. that code, we use the command
  60. ssb-sprom -i ssb_sprom_copy -o new_ssb_sprom_copy --subv 0x103C
  61. to write the HP vendor ID to our working copy. I use different
  62. input and output files so as not to destroy the original. If further
  63. changes are needed, for example the PCI product ID, the command
  64. ssb-sprom -i new_ssb_sprom_copy -o new_ssb_sprom_copy --subp 0x137C
  65. would be used. Note that the input and output files may be the same.
  66. Once you think you have updated correctly, use
  67. ssb-sprom -i new_ssb_sprom_copy -P
  68. to check the contents.
  69. Rewriting the sprom contents
  70. ----------------------------
  71. Once the sprom contents are the way you want them, and presumably
  72. correct, you are ready to rewrite the file. First, use
  73. echo $SSB_SPROM
  74. to ensure that this symbol still contains the SPROM path. If not,
  75. then it will have to be reloaded as discussed above.
  76. You are then ready to rewrite the sprom with
  77. sudo cp new_ssb_sprom_copy $SSB_SPROM
  78. Once again, you are urged to be absolutely certain of the contents
  79. of the working copy BEFORE taking this step. If your interface
  80. becomes unusable as a result of writing incorrect data into the
  81. sprom, the responsibility is YOURS. Once again, you have been warned.