|
@@ -25,6 +25,8 @@
|
|
#include <linux/compiler.h>
|
|
#include <linux/compiler.h>
|
|
#include <fdtdec.h>
|
|
#include <fdtdec.h>
|
|
|
|
|
|
|
|
+DECLARE_GLOBAL_DATA_PTR;
|
|
|
|
+
|
|
struct bcm283x_mu_regs {
|
|
struct bcm283x_mu_regs {
|
|
u32 io;
|
|
u32 io;
|
|
u32 iir;
|
|
u32 iir;
|
|
@@ -132,9 +134,35 @@ static const struct dm_serial_ops bcm283x_mu_serial_ops = {
|
|
.setbrg = bcm283x_mu_serial_setbrg,
|
|
.setbrg = bcm283x_mu_serial_setbrg,
|
|
};
|
|
};
|
|
|
|
|
|
|
|
+#if CONFIG_IS_ENABLED(OF_CONTROL)
|
|
|
|
+static const struct udevice_id bcm283x_mu_serial_id[] = {
|
|
|
|
+ {.compatible = "brcm,bcm2835-aux-uart"},
|
|
|
|
+ {}
|
|
|
|
+};
|
|
|
|
+
|
|
|
|
+static int bcm283x_mu_serial_ofdata_to_platdata(struct udevice *dev)
|
|
|
|
+{
|
|
|
|
+ struct bcm283x_mu_serial_platdata *plat = dev_get_platdata(dev);
|
|
|
|
+ fdt_addr_t addr;
|
|
|
|
+
|
|
|
|
+ addr = dev_get_addr(dev);
|
|
|
|
+ if (addr == FDT_ADDR_T_NONE)
|
|
|
|
+ return -EINVAL;
|
|
|
|
+
|
|
|
|
+ plat->base = addr;
|
|
|
|
+ plat->clock = fdtdec_get_int(gd->fdt_blob, dev->of_offset, "clock", 1);
|
|
|
|
+ plat->skip_init = fdtdec_get_bool(gd->fdt_blob, dev->of_offset,
|
|
|
|
+ "skip-init");
|
|
|
|
+ plat->disabled = false;
|
|
|
|
+ return 0;
|
|
|
|
+}
|
|
|
|
+#endif
|
|
|
|
+
|
|
U_BOOT_DRIVER(serial_bcm283x_mu) = {
|
|
U_BOOT_DRIVER(serial_bcm283x_mu) = {
|
|
.name = "serial_bcm283x_mu",
|
|
.name = "serial_bcm283x_mu",
|
|
.id = UCLASS_SERIAL,
|
|
.id = UCLASS_SERIAL,
|
|
|
|
+ .of_match = of_match_ptr(bcm283x_mu_serial_id),
|
|
|
|
+ .ofdata_to_platdata = of_match_ptr(bcm283x_mu_serial_ofdata_to_platdata),
|
|
.platdata_auto_alloc_size = sizeof(struct bcm283x_mu_serial_platdata),
|
|
.platdata_auto_alloc_size = sizeof(struct bcm283x_mu_serial_platdata),
|
|
.probe = bcm283x_mu_serial_probe,
|
|
.probe = bcm283x_mu_serial_probe,
|
|
.ops = &bcm283x_mu_serial_ops,
|
|
.ops = &bcm283x_mu_serial_ops,
|