Opened 9 years ago

Closed 5 years ago

#65 closed enhancement (fixed)

Unify SuperIO code?

Reported by: stepan Owned by: uwe
Priority: major Milestone: Cosmetic fixes
Component: coreboot Keywords:
Cc: Dependencies:
Patch Status: there is no patch


One thing I've been noticing in the current superio implementations: A lot of differences come from having the part names used in variable and macro names.

   #define FDC37M60X_CONFIG_REG_CC 0x02

Maybe we should change that to some unique names

   #define SUPERIO_CONFIG_REG_CC 0x02
  • Those names are usually file local only, so name clashes wont be a problem
  • They are the same for most (all?) SuperIOs?

Doing so (maybe with function names as well?) would unify the superio interface, or at least make diffing the code of different devices a bit easier..

Attachments (0)

Change History (4)

comment:1 Changed 8 years ago by uwe

Yes, the Super I/O code should definately be unified. Ideally one "driver" per Super I/O vendor should handle all the various chips of that vendor.

An example of how this can work is the 'smscsuperio' driver in v2, which should support almost all recent SMSC Super I/O chips. At least for v3 we should only accept this kind of generalized Super I/O drivers in the repository.

comment:2 Changed 8 years ago by uwe

  • Priority changed from minor to major
  • version v2 deleted

comment:3 Changed 8 years ago by stepan

  • Owner changed from somebody to uwe

comment:4 Changed 5 years ago by stepan

  • Resolution set to fixed
  • Status changed from new to closed

As original reporter of the "issue" I am closing it now, since there is no clear description or issue that could be fixed in order to ever "succeed" in the goal of reducing code duplication. Also, what might seem like wasteful code duplication is sometimes two different pieces of hardware that happen to behave the same way without any systematic reason. Two chips might seem exactly the same, but need very different workarounds, and moving the distinction from the device tree model into the code just moves complexity, and in addition and much worse, the required testing overhead significantly.

So, if you recognize evil code duplication, it should be fixed. At all cost? No. Only if it makes sense.

Add Comment

Modify Ticket

as closed The owner will remain uwe.
The resolution will be deleted. Next status will be 'reopened'.

E-mail address and user name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.