[OpenWrt-Devel] Current "OpenWrt Style Guide for DTS"?
Rafał Miłecki
zajec5 at gmail.com
Wed Jan 23 03:29:37 EST 2019
Thank you Chuanhong for handling this so well!
Few minor comments below.
On Wed, 23 Jan 2019 at 04:09, Chuanhong Guo <gch981213 at gmail.com> wrote:
> On Wed, Jan 23, 2019 at 6:07 AM Jeff Kletsky <lede at allycomm.com> wrote:
> ...
> >
> > Choice of Node Naming for Partitions
> > ====================================
> >
> > In some DTS files, the partitions are named using sequential integers.
> > In others, the offset of the partition is used.
> >
> > * Which of the two is preferred?
> >
> > uboot: u-boot at 0 {
> > firmware at 20000 {
> > art: art at ff0000 {
> >
> > vs.
> >
> > partition at 0 {
> > partition at 1 {
> > partition at 2 {
> > art: partition at 3 {
> Neither. It's partition@<start address>:
> https://git.openwrt.org/?p=openwrt/openwrt.git;a=commitdiff;h=6dd94c2781b79ffd20f1a57a48fa2314d67ee190
It's mean to be properly documented in the:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/devicetree/bindings/mtd/partition.txt
but it seems to need fixing.
> > TAB vs. SPACE Indentation
> > =========================
> >
> > * It appears that TAB indentation is being used. Is this correct?
> Yes.
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/coding-style.rst
> > read-only Partitions
> > ====================
> >
> > * Is it appropriate to mark the boot-loader partition as read-only?
> >
> > * What about the art partition?
> >
> > Doing so would seem to be able help prevent users following outdated
> > or ill-advised suggestions to write to their file systems using
> > low-level access.
> Correct. Both of those partitions aren't supposed to be written normally.
> >
> > Advanced users that, for some reason, want to overwrite these critical
> > partitions could always compile their own kernel with the restriction
> > removed.
> Yes. They are always able to make their custom firmware for this purpose.
> >
> >
> >
> > ---
> > Context for the following questions is discussed below the "8<" marker
> > TL;DR Stable references to partitions for DT modification when "inheriting"
> > ---
> >
> > Partition "label" Properties
> > ============================
> >
> > Some of the "label" properties seem obviously named, like "firmware"
> > and "art" and I assume that the kernel and drivers key off of these.
> >
> > * Is there a list of "reserved" and/or "preferred" values for the
> > label property of the partitions?
> OpenWrt kernel will try to automatically split "firmware“ into
> kernel/rootfs, and it'll auto-attach "ubi" partition as a ubi device.
> Besides these two the other names doesn't have any strict
> requirements. People usually follow what the manufacturer defined in
> their stock firmware.
Auto-splitting "firmware" partition (by its name) is enabled by:
CONFIG_MTD_SPLIT_FIRMWARE
If you use a proper compatible string it doesn't has to be named
"firmware" and you don't need CONFIG_MTD_SPLIT_FIRMWARE
--
Rafał
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel
More information about the openwrt-devel
mailing list