ron minnich has posted comments on this change. ( https://review.coreboot.org/c/SerialTest/+/39083 )
Change subject: Add rough approximation of SerialTest scaffold
......................................................................
Patch Set 5:
(9 comments)
https://review.coreboot.org/c/SerialTest/+/39083/5/drivers/drivers.go
File drivers/drivers.go:
https://review.coreboot.org/c/SerialTest/+/39083/5/drivers/drivers.go@24
PS5, Line 24: // ConsoleDriverInit is the signature of a function creating a console driver
generally, it is not done this way (sorry I missed it first time through).
You would not define these types.
Rather, you might declare the following:
func NewConsole(name string, output <- chan string) Driver {
return &Console{Name: name, Output: output,}
}
and
func NewFlash(whatever) Driver{
}
and so on. All your types are supposed (I think) to satisfy the Driver interface.
Also, since this is the drivers package (really, driver would do), then you can just call them Console, Flash, and Button, else the names get a bit awkward.
So then your code:
c := driver.NewConsole(whatever)
Now this leaves the driver interface, above, a but confusing to me. Do all these devices have IO?
A common way to do this is actually to have them implement some other interface, typically
io.Reader
or io.Writer
Then it does not matter what the internals are.
So:
n, err := c.Read(bytes)
For the flash driver it could even implement io.WriterAt / io.ReaderAt, then you can use the offset param as the offset in flash.
Sorry if this review is a little long and a little late, but if we can take the time we can make it a pretty good example for Go in coreboot, which would be nice to do as we crush C out of existence, ha ha :-)
You can, btw, consider having them implement some other interface (pipe comes to mind) but in most cases, io.Reader etc. do the job.
https://review.coreboot.org/c/SerialTest/+/39083/5/drivers/servo/servo.go
File drivers/servo/servo.go:
https://review.coreboot.org/c/SerialTest/+/39083/5/drivers/servo/servo.go@16
PS5, Line 16: // This package is a singleton, so global variables are no problem.
could we ever want to have the ability to run more than one server from one program? it seems you are giving something up here.
https://review.coreboot.org/c/SerialTest/+/39083/5/drivers/servo/servo.go@29
PS5, Line 29: /*
I'd consider making a servo driver which embeds the other Drivers.
Or even a thing that returns a Servo, no big deal.
Then you'd have something like
type Servo struct {
cpu, ec, cr50 Driver // maybe? or just os.File
button Driver
}
func NewServo() (*Servo, error) {
/// most of the code you have below, but no globals
}
https://review.coreboot.org/c/SerialTest/+/39083/5/drivers/servo/servo.go@64
PS5, Line 64: func ConsoleDriver() *drivers.ConsoleDriver {
I would consider separating out the creation from the IO.
Your driver interface might include a Start() method, or something, but this is putting allocation and file opening and IO in this one thing, which seems wrong somehow.
https://review.coreboot.org/c/SerialTest/+/39083/5/eve.toml
File eve.toml:
https://review.coreboot.org/c/SerialTest/+/39083/5/eve.toml@2
PS5, Line 2: ConsoleDriverName = "servo"
same thing here: you're in a package called driver(s), and the repetition is frowned upon.
ConsoleName
etc. would be nicer.
https://review.coreboot.org/c/SerialTest/+/39083/5/events/events.go
File events/events.go:
https://review.coreboot.org/c/SerialTest/+/39083/5/events/events.go@10
PS5, Line 10: // An Event defines what an EventStream is looking for on its input.
this is neat. I'll have to reread it again to fully get it.
https://review.coreboot.org/c/SerialTest/+/39083/5/events/events.go@34
PS5, Line 34: console *drivers.ConsoleDriver
if we think of a Driver as a special type of fd or os.File, then we ought to be able to make this
console Driver
and then anything that implements Driver could be part of an event stream. I would say anywhere you have these concrete types is a good place to look again and see if you can have a Driver instead.
https://review.coreboot.org/c/SerialTest/+/39083/5/serialtest.go
File serialtest.go:
https://review.coreboot.org/c/SerialTest/+/39083/5/serialtest.go@34
PS5, Line 34: ConsoleDriverName string
I still feel like the Driver word should not be here:
drivers.Configuration.ConsoleDriverName is a bit much.
I'd still feel better if this were done in a way that concrete types became Drivers.
https://review.coreboot.org/c/SerialTest/+/39083/5/serialtest.go@114
PS5, Line 114: quit := make(chan bool)
who uses quit? Also, there are standard Go ways of dealing with "reader closes channel" via select that would let you avoid using the quit channel at all, which would in turn let you change or remove the Driver interface and have your types satisfy io.Reader instead.
--
To view, visit https://review.coreboot.org/c/SerialTest/+/39083
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: SerialTest
Gerrit-Branch: master
Gerrit-Change-Id: Iab8d507dee6087bf32280ad6845fdd2d7715bf5c
Gerrit-Change-Number: 39083
Gerrit-PatchSet: 5
Gerrit-Owner: Patrick Georgi <pgeorgi(a)google.com>
Gerrit-Reviewer: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Reviewer: Dossym Nurmukhanov <dossym(a)google.com>
Gerrit-Reviewer: Martin Roth <martinroth(a)google.com>
Gerrit-Reviewer: Patrick Georgi <pgeorgi(a)google.com>
Gerrit-Reviewer: ron minnich <rminnich(a)gmail.com>
Gerrit-CC: Greg Edelston <gredelston(a)google.com>
Gerrit-CC: Paul Menzel <paulepanter(a)users.sourceforge.net>
Gerrit-Comment-Date: Tue, 25 Feb 2020 07:09:15 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment
Frans Hendriks has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/39095 )
Change subject: superio/aspeed/ast2400: rename SWAK to SWC to match the datasheet
......................................................................
Patch Set 2: Code-Review+2
--
To view, visit https://review.coreboot.org/c/coreboot/+/39095
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I8b3a14946e37f805d1c4e3df343dfcd7f67f6dc8
Gerrit-Change-Number: 39095
Gerrit-PatchSet: 2
Gerrit-Owner: Michael Niewöhner
Gerrit-Reviewer: Felix Held <felix-coreboot(a)felixheld.de>
Gerrit-Reviewer: Frans Hendriks <fhendriks(a)eltan.com>
Gerrit-Reviewer: Michael Niewöhner
Gerrit-Reviewer: Nico Huber <nico.h(a)gmx.de>
Gerrit-Reviewer: Patrick Georgi <pgeorgi(a)google.com>
Gerrit-Reviewer: Patrick Rudolph <siro(a)das-labor.org>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Paul Menzel <paulepanter(a)users.sourceforge.net>
Gerrit-Comment-Date: Tue, 25 Feb 2020 06:33:57 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
Benjamin Doron has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/38960 )
Change subject: payloads/tianocore: Enable PS2 keyboard module
......................................................................
Patch Set 3:
This change is ready for review.
--
To view, visit https://review.coreboot.org/c/coreboot/+/38960
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: If6d468809142a0049ce1648217d62b070229ad6b
Gerrit-Change-Number: 38960
Gerrit-PatchSet: 3
Gerrit-Owner: Benjamin Doron <benjamin.doron00(a)gmail.com>
Gerrit-Reviewer: Benjamin Doron <benjamin.doron00(a)gmail.com>
Gerrit-Reviewer: Matt DeVillier <matt.devillier(a)gmail.com>
Gerrit-Reviewer: Nico Huber <nico.h(a)gmx.de>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Comment-Date: Tue, 25 Feb 2020 03:51:42 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: No
Gerrit-MessageType: comment
Subrata Banik has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/26138 )
Change subject: soc/intel/common/block: Move smihandler common functions into common code
......................................................................
Patch Set 43:
> Patch Set 43: Code-Review+2
>
> (1 comment)
Furquan, if you could review this as well https://review.coreboot.org/c/coreboot/+/26133/39
--
To view, visit https://review.coreboot.org/c/coreboot/+/26138
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Ic082bc5d556dd19617d83ab86f93a53574b5bc03
Gerrit-Change-Number: 26138
Gerrit-PatchSet: 43
Gerrit-Owner: Subrata Banik <subrata.banik(a)intel.com>
Gerrit-Reviewer: Aamir Bohra <aamir.bohra(a)intel.com>
Gerrit-Reviewer: Aaron Durbin <adurbin(a)chromium.org>
Gerrit-Reviewer: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Reviewer: Duncan Laurie <dlaurie(a)chromium.org>
Gerrit-Reviewer: Furquan Shaikh <furquan(a)google.com>
Gerrit-Reviewer: Hannah Williams <hannah.williams(a)intel.com>
Gerrit-Reviewer: Jeremy Soller <jeremy(a)system76.com>
Gerrit-Reviewer: Krzysztof M Sywula <krzysztof.m.sywula(a)intel.com>
Gerrit-Reviewer: Lance Zhao <lance.zhao(a)gmail.com>
Gerrit-Reviewer: Martin Roth <martinroth(a)google.com>
Gerrit-Reviewer: Maulik V Vaghela <maulik.v.vaghela(a)intel.com>
Gerrit-Reviewer: Patrick Georgi <pgeorgi(a)google.com>
Gerrit-Reviewer: Patrick Rudolph <siro(a)das-labor.org>
Gerrit-Reviewer: Paul Menzel <paulepanter(a)users.sourceforge.net>
Gerrit-Reviewer: Pratikkumar V Prajapati <pratikkumar.v.prajapati(a)intel.com>
Gerrit-Reviewer: Shelley Chen <shchen(a)google.com>
Gerrit-Reviewer: Subrata Banik <subrata.banik(a)intel.com>
Gerrit-Reviewer: V Sowmya <v.sowmya(a)intel.com>
Gerrit-Reviewer: Wonkyu Kim <wonkyu.kim(a)intel.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Comment-Date: Tue, 25 Feb 2020 02:47:12 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: No
Gerrit-MessageType: comment
Furquan Shaikh has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/26138 )
Change subject: soc/intel/common/block: Move smihandler common functions into common code
......................................................................
Patch Set 43: Code-Review+2
(1 comment)
https://review.coreboot.org/c/coreboot/+/26138/41/src/soc/intel/common/bloc…
File src/soc/intel/common/block/smm/smihandler.c:
https://review.coreboot.org/c/coreboot/+/26138/41/src/soc/intel/common/bloc…
PS41, Line 70: tco_sts
> @Furquan, as this function don't get called directly from soc code rather this function is getting c […]
Thanks for checking Subrata.
--
To view, visit https://review.coreboot.org/c/coreboot/+/26138
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Ic082bc5d556dd19617d83ab86f93a53574b5bc03
Gerrit-Change-Number: 26138
Gerrit-PatchSet: 43
Gerrit-Owner: Subrata Banik <subrata.banik(a)intel.com>
Gerrit-Reviewer: Aamir Bohra <aamir.bohra(a)intel.com>
Gerrit-Reviewer: Aaron Durbin <adurbin(a)chromium.org>
Gerrit-Reviewer: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Reviewer: Duncan Laurie <dlaurie(a)chromium.org>
Gerrit-Reviewer: Furquan Shaikh <furquan(a)google.com>
Gerrit-Reviewer: Hannah Williams <hannah.williams(a)intel.com>
Gerrit-Reviewer: Jeremy Soller <jeremy(a)system76.com>
Gerrit-Reviewer: Krzysztof M Sywula <krzysztof.m.sywula(a)intel.com>
Gerrit-Reviewer: Lance Zhao <lance.zhao(a)gmail.com>
Gerrit-Reviewer: Martin Roth <martinroth(a)google.com>
Gerrit-Reviewer: Maulik V Vaghela <maulik.v.vaghela(a)intel.com>
Gerrit-Reviewer: Patrick Georgi <pgeorgi(a)google.com>
Gerrit-Reviewer: Patrick Rudolph <siro(a)das-labor.org>
Gerrit-Reviewer: Paul Menzel <paulepanter(a)users.sourceforge.net>
Gerrit-Reviewer: Pratikkumar V Prajapati <pratikkumar.v.prajapati(a)intel.com>
Gerrit-Reviewer: Shelley Chen <shchen(a)google.com>
Gerrit-Reviewer: Subrata Banik <subrata.banik(a)intel.com>
Gerrit-Reviewer: V Sowmya <v.sowmya(a)intel.com>
Gerrit-Reviewer: Wonkyu Kim <wonkyu.kim(a)intel.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Comment-Date: Mon, 24 Feb 2020 20:43:58 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Comment-In-Reply-To: Subrata Banik <subrata.banik(a)intel.com>
Comment-In-Reply-To: Furquan Shaikh <furquan(a)google.com>
Gerrit-MessageType: comment