]>
git.ipfire.org Git - people/ms/u-boot.git/blob - drivers/pch/pch-uclass.c
2 * Copyright (c) 2015 Google, Inc
3 * Written by Simon Glass <sjg@chromium.org>
5 * SPDX-License-Identifier: GPL-2.0+
13 DECLARE_GLOBAL_DATA_PTR
;
15 int pch_get_spi_base(struct udevice
*dev
, ulong
*sbasep
)
17 struct pch_ops
*ops
= pch_get_ops(dev
);
20 if (!ops
->get_spi_base
)
23 return ops
->get_spi_base(dev
, sbasep
);
26 int pch_set_spi_protect(struct udevice
*dev
, bool protect
)
28 struct pch_ops
*ops
= pch_get_ops(dev
);
30 if (!ops
->set_spi_protect
)
33 return ops
->set_spi_protect(dev
, protect
);
36 int pch_get_gpio_base(struct udevice
*dev
, u32
*gbasep
)
38 struct pch_ops
*ops
= pch_get_ops(dev
);
41 if (!ops
->get_gpio_base
)
44 return ops
->get_gpio_base(dev
, gbasep
);
47 int pch_get_io_base(struct udevice
*dev
, u32
*iobasep
)
49 struct pch_ops
*ops
= pch_get_ops(dev
);
52 if (!ops
->get_io_base
)
55 return ops
->get_io_base(dev
, iobasep
);
58 static int pch_uclass_post_bind(struct udevice
*bus
)
61 * Scan the device tree for devices
63 * Before relocation, only bind devices marked for pre-relocation
66 return dm_scan_fdt_node(bus
, gd
->fdt_blob
, bus
->of_offset
,
67 gd
->flags
& GD_FLG_RELOC
? false : true);
70 UCLASS_DRIVER(pch
) = {
73 .post_bind
= pch_uclass_post_bind
,