lca14: lca14-107: acpi upstreaming

12
Wed-5-Mar, 11:15am, Al Stone, G Gregory, Hanjun Guo LCA14-107: ACPI upstreaming

Upload: linaro

Post on 10-May-2015

218 views

Category:

Technology


1 download

DESCRIPTION

Resource: LCA14 Name: LCA14-107: ACPI upstreaming Date: 05-03-2014 Speaker: Al Stone, G Gregory, Hanjun Guo Video: https://www.youtube.com/watch?v=l3v14bgMpcc Website: http://www.linaro.org/ Linaro Connect: http://connect.linaro.org/ Slide: https://www.slideshare.net/linaroorg/lca14-107-acpiupstreaming

TRANSCRIPT

Page 1: LCA14: LCA14-107: ACPI upstreaming

Wed-5-Mar, 11:15am, Al Stone, G Gregory, Hanjun Guo

LCA14-107: ACPI upstreaming

Page 2: LCA14: LCA14-107: ACPI upstreaming

• Staged for 3.15 (in linux-next):• Odds and ends: APEI cleanups, white space, minor bugs in ACPI driver• Reduced Hardware mode: config option, strict enforcement ruled out [0]• Preliminary patches for moving around some arch-dependent code (simplifies ACPI for non-x86 machines)

• Probable for 3.16:• Core functionality: load and recognize tables, enable ACPI for AArch64 driver use• SMP/GIC initialization based on MADT• Arch timer initialization based on ACPI table GTDT• Enable APEI for AArch64• This has a dependency on early_ioremap and PCI from 3.15

• Pending acceptance of Core [1]:• Driver changes enabling boot of FVP with ACPI only• Better CPU topology initialization• Better GIC initialization• Further non-FVP drivers• Further Coordination with ASWG proposals

[0] Strict enforcement of reduced hardware mode in Linux will not be possible due to existing x86 platforms that violate the specification; will need to fix any problems this causes for ARMv8 (there are none yet).

[1] Maybe 3.16, maybe 3.17, depending on what upstream decides to do

ACPI Upstreaming

Page 3: LCA14: LCA14-107: ACPI upstreaming

• Grand Unified Firmware Interface• Why: make it easy to use either FDT or ACPI in the same driver• What: shim layer in kernel to call right API under the right conditions,

providing a simple API merging FDT and ACPI calls• How: prototype one or more non-trivial drivers• When: now -- need to complete prototypes, then RFC• Where: ideally, new drivers only, as needed for ARMv8 servers• More Info: Prototype GUFI Card (https://cards.linaro.org/browse/CARD-1059)

A Modest Proposal: GUFI

Page 4: LCA14: LCA14-107: ACPI upstreaming

• Introduce drivers/gufi to hold code for the new interface• drivers/gufi/core.c GUFI initialisation code

int gufi_register_protocol(struct gufi_protocol *prot)

• Called to register ACPI/FDT/... with gufi this tells the core about the custom mappings to GUFI.

void gufi_unregister_protocol(struct gufi_protocol *prot)• The reverse of the above.

A Modest Proposal: GUFI Structure

Page 5: LCA14: LCA14-107: ACPI upstreaming

• GUFI Protocol Structure

struct gufi_protocol {

const char *name;

struct list_head entry;

struct gufi_device_node *(*find_first_node)(const char *name);

struct gufi_device_node *(*node_get)(struct gufi_device_node *gdn);

void (*node_put)(struct gufi_device_node *gdn);

const struct gufi_device_id (*match_device)(

const struct gufi_device_id ids,

const struct device *dev);

bool (*test_match)(const struct gufi_device_id id);

int (*property_read_u32)(const struct gufi_device_node *gdn,

const char *propname, u32 *out_value);

};

A Modest Proposal: GUFI Structure

Page 6: LCA14: LCA14-107: ACPI upstreaming

• Currently 2 protocols available• OF: drivers/gufi/of_protocol.c• ACPI: drivers/gufi/acpi_protocol.c• This is a prototype so has now been expanded to full list

of datatypes which are available with OF/ACPI yet.

A Modest Proposal: GUFI Structure

Page 7: LCA14: LCA14-107: ACPI upstreaming

• drivers/net/ethernet/smsc/smc91x.c

static int smc_drv_probe(struct platform_device *pdev){

struct smc91x_platdata *pd = dev_get_platdata(&pdev->dev);- const struct of_device_id *match = NULL;+ struct gufi_device_id match = { NULL, NULL };

struct smc_local *lp;struct net_device *ndev;struct resource *res, *ires;

• Converted the matching functions to GUFI

A Modest Proposal: Converting Driver

Page 8: LCA14: LCA14-107: ACPI upstreaming

• drivers/net/ethernet/smsc/smc91x.c

-#if IS_BUILTIN(CONFIG_OF)- match = of_match_device(of_match_ptr(smc91x_match), &pdev->dev);- if (match) {- struct device_node *np = pdev->dev.of_node;+ match = gufi_match_device(smc91x_gufi_match, &pdev->dev);+ if (gufi_test_match(match)) {+ struct gufi_device_node *gdn = gufi_look_for_node(+ pdev->dev.of_node, ACPI_COMPANION(&pdev->dev));

u32 val;/* Combination of IO widths supported, default to 16-bit */

- if (!of_property_read_u32(np, "reg-io-width", &val)) {+ if (!gufi_property_read_u32(gdn, "reg-io-width", &val)) {

• Instead of protocol specific property functions use generic GUFI.

A Modest Proposal: Converting Driver

Page 9: LCA14: LCA14-107: ACPI upstreaming

• drivers/net/ethernet/smsc/smc91x.c

- if (!pd && !match) {+ if (!pd && !gufi_test_match(match)) {

lp->cfg.flags |= (SMC_CAN_USE_8BIT) ? SMC91X_USE_8BIT : 0;lp->cfg.flags |= (SMC_CAN_USE_16BIT) ? SMC91X_USE_16BIT : 0;lp->cfg.flags |= (SMC_CAN_USE_32BIT) ? SMC91X_USE_32BIT : 0;

• Instead of protocol specific device matching use generic GUFI.

A Modest Proposal: Converting Driver

Page 10: LCA14: LCA14-107: ACPI upstreaming

1. Spin-table enabled SMP initialization is walking away on ARM64? there is no PSCI support in ACPI now, how can we initialize SMP in ACPI way?

2. Move ACPI based GIC initialization code into irq-gic.c? how to find a scalable way to support GICv3 in the future?

3. Single kernel image for both ACPI and FDT?4. GIC ID and UID, who should be MPIDR? http://www.kernelhub.org/?msg=417247&p=2

Issues we got for current patches

Page 11: LCA14: LCA14-107: ACPI upstreaming

• ACPI Power Management 2:55pm Loulan 4103-4104

Further Sessions

Page 12: LCA14: LCA14-107: ACPI upstreaming

More about Linaro Connect: http://connect.linaro.orgMore about Linaro: http://www.linaro.org/about/

More about Linaro engineering: http://www.linaro.org/engineering/Linaro members: www.linaro.org/members