[coreboot-gerrit] Change in coreboot[master]: soc/intel/common/block/gpio: Port gpio code from Apollolake ...

Furquan Shaikh (Code Review) gerrit at coreboot.org
Thu Jun 1 21:08:44 CEST 2017


Furquan Shaikh has posted comments on this change. ( https://review.coreboot.org/19759 )

Change subject: soc/intel/common/block/gpio: Port gpio code from Apollolake to common
......................................................................


Patch Set 20:

(11 comments)

https://review.coreboot.org/#/c/19759/20/src/soc/intel/common/block/gpio/Kconfig
File src/soc/intel/common/block/gpio/Kconfig:

Line 16: 	default n
It would be helpful to have help text explaining what this config option does. Same with the config option below.


https://review.coreboot.org/#/c/19759/20/src/soc/intel/common/block/gpio/gpio.c
File src/soc/intel/common/block/gpio/gpio.c:

PS20, Line 54: 32
Shouldn't this be GPIO_MAX_NUM_PER_GROUP?


PS20, Line 55: 32
GPIO_MAX_NUM_PER_GROUP?


PS20, Line 80: soc_gpio_configure_itss
Why does this have soc_ in its name?


PS20, Line 105: pad_cfg_offset + sizeof(uint32_t)
It would be better to have macros like PAD_CFG1_OFFSET, PAD_CFG0_OFFSET defined as:

#define PAD_CFG0_OFFSET(x)         ((x) + GPIO_DWx_SIZE(0))
#define PAD_CFG1_OFFSET(x)         ((x) + GPIO_DWx_SIZE(1))

That way it will be clear what register is being read/written to.


PS20, Line 123: PAD_CFG_BASE
I believe this has to be provided by the SoC. It would be good to document it somewhere what exactly is expected to be implemented by the SoC. Might also be a good idea to have an assert here to ensure that we catch it early if SoC fails to initialize this.


PS20, Line 155: gpio_configure_owner(cfg, comm->port, cfg->pad - comm->first_pad);
              : 
              : 	gpi_enable_smi(cfg, comm->port, cfg->pad - comm->first_pad);
You can also just pass in cfg and comm and let the called function deal with what parameters it wants to use:
gpio_configure_owner(cfg, comm);
gpi_enable_smi(cfg, comm);


PS20, Line 247: int index = 0
You are setting this before using. No need to initialize it to 0.


https://review.coreboot.org/#/c/19759/20/src/soc/intel/common/block/include/intelblocks/gpio.h
File src/soc/intel/common/block/include/intelblocks/gpio.h:

Line 67: 
extra blank line


PS20, Line 87:  
extra blank


Line 112: 
blank line not needed?


-- 
To view, visit https://review.coreboot.org/19759
To unsubscribe, visit https://review.coreboot.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Ic48401e92103ff0ec278fb69a3d304148a2d79aa
Gerrit-PatchSet: 20
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Owner: Hannah Williams <hannah.williams at intel.com>
Gerrit-Reviewer: Aaron Durbin <adurbin at chromium.org>
Gerrit-Reviewer: Barnali Sarkar <barnali.sarkar at intel.com>
Gerrit-Reviewer: Bora Guvendik <bora.guvendik at intel.com>
Gerrit-Reviewer: Divya Chellappa <divya.chella at gmail.com>
Gerrit-Reviewer: Furquan Shaikh <furquan at google.com>
Gerrit-Reviewer: Hannah Williams <hannah.williams at intel.com>
Gerrit-Reviewer: Martin Roth <martinroth at google.com>
Gerrit-Reviewer: Nico Huber <nico.h at gmx.de>
Gerrit-Reviewer: Paul Menzel <paulepanter at users.sourceforge.net>
Gerrit-Reviewer: Ravishankar Sarawadi <ravishankar.sarawadi at intel.com>
Gerrit-Reviewer: Shaunak Saha <shaunak.saha at intel.com>
Gerrit-Reviewer: Subrata Banik <subrata.banik at intel.com>
Gerrit-Reviewer: V Sowmya <v.sowmya at intel.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply at coreboot.org>
Gerrit-HasComments: Yes



More information about the coreboot-gerrit mailing list