+static void aspeed_set_uart(Object *obj, const char *value, Error **errp)
+{
+ AspeedMachineState *bmc = ASPEED_MACHINE(obj);
+ AspeedMachineClass *amc = ASPEED_MACHINE_GET_CLASS(bmc);
+ AspeedSoCClass *sc = ASPEED_SOC_CLASS(object_class_by_name(amc->soc_name));
+ int val;
+
+ if (sscanf(value, "uart%u", &val) != 1) {
+ error_setg(errp, "Bad value for \"uart\" property");
Why are you asking for a string and not an index?
because the literal name is what people find in the DT. See files
arch/arm/boot/dts/aspeed-bmc-* under Linux.
OK. After looking at this file, I suppose people would expect
a "bmc-console" property name:
-M ast2500-evb,bmc-console=uart3
yes. This is better naming for the user. I will keep the internal
'uart_chosen' though.
Thanks,
C.