configuring lpc register from user space

Vijay Khemka vijaykhemka at fb.com
Fri Jan 25 13:36:45 AEDT 2019


Thanks Tony,
I will try that.

From: "Tony_Ao at wiwynn.com" <Tony_Ao at wiwynn.com>
Date: Thursday, January 24, 2019 at 5:58 PM
To: Vijay Khemka <vijaykhemka at fb.com>, "openbmc at lists.ozlabs.org" <openbmc at lists.ozlabs.org>
Subject: RE: configuring lpc register from user space

Hi Vijay,

Maybe you can try this way.
Use ‘mknod -m 660 /dev/mem c 1 1’ to create /dev/mem in the BMC runtime system(This way does not require a system reboot. Please refer to Snapshot#1)
But /dev/mem will disappear when you reboot the system.

So I suggest you can use the mknod to create /dev/mem in the runtime environment.
In order to avoid the /dev/mem disappear when system rebooting, you can use mem.devmem parameters(once you set it, the value will be kept in the flash) to prevent this situation.
You can refer to mem.devmem setting in the previous mail.

Snapshot#1
[cid:image003.png at 01D4B48F.40B713D0]

Regards,
Tony

From: Vijay Khemka [mailto:vijaykhemka at fb.com]
Sent: Friday, January 25, 2019 2:35 AM
To: Tony Ao/WYHQ/Wiwynn; openbmc at lists.ozlabs.org
Subject: Re: configuring lpc register from user space

Hi Tony,
It is not feasible to set boot parameter and reboot in production release. We need to set some lpc register while system is booting.

Regards
-Vijay

From: "Tony_Ao at wiwynn.com" <Tony_Ao at wiwynn.com>
Date: Wednesday, January 23, 2019 at 5:31 PM
To: Vijay Khemka <vijaykhemka at fb.com>, "openbmc at lists.ozlabs.org" <openbmc at lists.ozlabs.org>
Subject: RE: configuring lpc register from user space

Hi Vijay,

The following steps for your reference.

In BMC OS,
1.      Use fw_printenv to check the bootargs
2.      Use fw_setenv to append mem.devmem=1 to the bootargs
root at tiogapass:~# fw_setenv bootargs console=ttyS4,115200n8 root=/dev/ram rw mem.devmem=1

3.      Use fw_printenv to check the bootargs again
4.      Reboot the BMC system
5.      When BMC is ready, you can use devmem to modify the register values

The snapshots:
[cid:image002.png at 01D4B3C7.7B047320]

[cid:image003.png at 01D4B3C7.7B047320]


Regards,
Tony

From: Vijay Khemka [mailto:vijaykhemka at fb.com]
Sent: Thursday, January 24, 2019 2:26 AM
To: Tony Ao/WYHQ/Wiwynn; openbmc at lists.ozlabs.org
Subject: Re: configuring lpc register from user space

Hi Tony,
How do you append this to bootargs, can you please give me some example and I have to enable this in my production code.

Regards
-Vijay

From: "Tony_Ao at wiwynn.com" <Tony_Ao at wiwynn.com>
Date: Tuesday, January 22, 2019 at 9:22 PM
To: Vijay Khemka <vijaykhemka at fb.com>, "openbmc at lists.ozlabs.org" <openbmc at lists.ozlabs.org>
Subject: RE: configuring lpc register from user space

Hi Vijay,

If you want to use devmem to set the specific register, you can append mem.devmem to bootargs and restart the system.

Then you can set the specific register using devmem.
You can refer the below link for details.
https://patchwork.ozlabs.org/patch/982894/<https://urldefense.proofpoint.com/v2/url?u=https-3A__patchwork.ozlabs.org_patch_982894_&d=DwMGaQ&c=5VD0RTtNlTh3ycd41b3MUw&r=v9MU0Ki9pWnTXCWwjHPVgpnCR80vXkkcrIaqU7USl5g&m=KA69FVnlR8bLEMZ31BR4OQYBvagLgpv1hn8STKGirbo&s=hzAe_Ozp-uao2QqzTI-4i7xWFnFPihbN1lFEqIUy0aA&e=>

Regards,
Tony

From: openbmc [mailto:openbmc-bounces+tony_ao=wiwynn.com at lists.ozlabs.org] On Behalf Of Vijay Khemka
Sent: Wednesday, January 23, 2019 8:02 AM
To: openbmc at lists.ozlabs.org
Subject: configuring lpc register from user space

Team,
I know /dev/mem is not supported in production, I need to configure some lpc register to route uart output, so please suggest what is the best ways to do the same. Is there any application or driver interface available which can be used to set some lpc register like 0x1E78909C.

Regards
-Vijay
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ozlabs.org/pipermail/openbmc/attachments/20190125/e3890edd/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 7135 bytes
Desc: image001.png
URL: <http://lists.ozlabs.org/pipermail/openbmc/attachments/20190125/e3890edd/attachment-0003.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image002.png
Type: image/png
Size: 17928 bytes
Desc: image002.png
URL: <http://lists.ozlabs.org/pipermail/openbmc/attachments/20190125/e3890edd/attachment-0004.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image003.png
Type: image/png
Size: 2587 bytes
Desc: image003.png
URL: <http://lists.ozlabs.org/pipermail/openbmc/attachments/20190125/e3890edd/attachment-0005.png>


More information about the openbmc mailing list